cleanup unused code, make fallback_serial working again

This commit is contained in:
andreas 2023-08-30 20:20:28 +02:00
parent dc2f353893
commit 17615adca5
5 changed files with 8 additions and 16 deletions

View File

@ -12,8 +12,9 @@
#define N2K_CHANNEL_ID 0 #define N2K_CHANNEL_ID 0
#define USB_CHANNEL_ID 1 #define USB_CHANNEL_ID 1
#define SERIAL1_CHANNEL_ID 2 #define SERIAL1_CHANNEL_ID 2
#define TCP_CLIENT_CHANNEL_ID 3 #define SERIAL2_CHANNEL_ID 3
#define MIN_TCP_CHANNEL_ID 4 #define TCP_CLIENT_CHANNEL_ID 4
#define MIN_TCP_CHANNEL_ID 5
#define MIN_USER_TASK 200 #define MIN_USER_TASK 200
class GwSocketServer; class GwSocketServer;

View File

@ -22,6 +22,7 @@
#define GWLED_PIN GPIO_NUM_27 #define GWLED_PIN GPIO_NUM_27
//brightness 0...255 //brightness 0...255
#define GWLED_BRIGHTNESS 64 #define GWLED_BRIGHTNESS 64
#define USBSerial Serial
void exampleTask(GwApi *param); void exampleTask(GwApi *param);
void exampleInit(GwApi *param); void exampleInit(GwApi *param);

View File

@ -7,7 +7,6 @@
board = m5stack-atom board = m5stack-atom
lib_deps = lib_deps =
${env.lib_deps} ${env.lib_deps}
own_lib
build_flags= build_flags=
-D BOARD_TEST -D BOARD_TEST
${env.build_flags} ${env.build_flags}

View File

@ -1,10 +1,11 @@
#include "GwLog.h" #include "GwLog.h"
#include "GwHardware.h"
class DefaultLogWriter: public GwLogWriter{ class DefaultLogWriter: public GwLogWriter{
public: public:
virtual ~DefaultLogWriter(){}; virtual ~DefaultLogWriter(){};
virtual void write(const char *data){ virtual void write(const char *data){
Serial.print(data); USBSerial.print(data);
} }
}; };

View File

@ -14,7 +14,6 @@
#include "GwAppInfo.h" #include "GwAppInfo.h"
// #define GW_MESSAGE_DEBUG_ENABLED // #define GW_MESSAGE_DEBUG_ENABLED
//#define FALLBACK_SERIAL //#define FALLBACK_SERIAL
//#define CAN_ESP_DEBUG
const unsigned long HEAP_REPORT_TIME=2000; //set to 0 to disable heap reporting const unsigned long HEAP_REPORT_TIME=2000; //set to 0 to disable heap reporting
#include <Arduino.h> #include <Arduino.h>
#include "GwApi.h" #include "GwApi.h"
@ -66,15 +65,6 @@ const unsigned long HEAP_REPORT_TIME=2000; //set to 0 to disable heap reporting
#include "GwChannel.h" #include "GwChannel.h"
#include "GwChannelList.h" #include "GwChannelList.h"
#include "GwTimer.h" #include "GwTimer.h"
#ifdef FALLBACK_SERIAL
#ifdef CAN_ESP_DEBUG
#define CDBS &Serial
#else
#define CDBS NULL
#endif
#else
#define CDBS NULL
#endif
#define MAX_NMEA2000_MESSAGE_SEASMART_SIZE 500 #define MAX_NMEA2000_MESSAGE_SEASMART_SIZE 500
@ -709,8 +699,8 @@ void setup() {
#ifdef FALLBACK_SERIAL #ifdef FALLBACK_SERIAL
fallbackSerial=true; fallbackSerial=true;
//falling back to old style serial for logging //falling back to old style serial for logging
Serial.begin(115200); USBSerial.begin(115200);
Serial.printf("fallback serial enabled\n"); USBSerial.printf("fallback serial enabled\n");
logger.prefix="FALLBACK:"; logger.prefix="FALLBACK:";
#endif #endif
userCodeHandler.startInitTasks(MIN_USER_TASK); userCodeHandler.startInitTasks(MIN_USER_TASK);