mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-18 00:03:07 +01:00
cleanup unused code, make fallback_serial working again
This commit is contained in:
@@ -12,8 +12,9 @@
|
||||
#define N2K_CHANNEL_ID 0
|
||||
#define USB_CHANNEL_ID 1
|
||||
#define SERIAL1_CHANNEL_ID 2
|
||||
#define TCP_CLIENT_CHANNEL_ID 3
|
||||
#define MIN_TCP_CHANNEL_ID 4
|
||||
#define SERIAL2_CHANNEL_ID 3
|
||||
#define TCP_CLIENT_CHANNEL_ID 4
|
||||
#define MIN_TCP_CHANNEL_ID 5
|
||||
|
||||
#define MIN_USER_TASK 200
|
||||
class GwSocketServer;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define GWLED_PIN GPIO_NUM_27
|
||||
//brightness 0...255
|
||||
#define GWLED_BRIGHTNESS 64
|
||||
#define USBSerial Serial
|
||||
|
||||
void exampleTask(GwApi *param);
|
||||
void exampleInit(GwApi *param);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
board = m5stack-atom
|
||||
lib_deps =
|
||||
${env.lib_deps}
|
||||
own_lib
|
||||
build_flags=
|
||||
-D BOARD_TEST
|
||||
${env.build_flags}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "GwLog.h"
|
||||
#include "GwHardware.h"
|
||||
|
||||
class DefaultLogWriter: public GwLogWriter{
|
||||
public:
|
||||
virtual ~DefaultLogWriter(){};
|
||||
virtual void write(const char *data){
|
||||
Serial.print(data);
|
||||
USBSerial.print(data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
14
src/main.cpp
14
src/main.cpp
@@ -14,7 +14,6 @@
|
||||
#include "GwAppInfo.h"
|
||||
// #define GW_MESSAGE_DEBUG_ENABLED
|
||||
//#define FALLBACK_SERIAL
|
||||
//#define CAN_ESP_DEBUG
|
||||
const unsigned long HEAP_REPORT_TIME=2000; //set to 0 to disable heap reporting
|
||||
#include <Arduino.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 "GwChannelList.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
|
||||
@@ -709,8 +699,8 @@ void setup() {
|
||||
#ifdef FALLBACK_SERIAL
|
||||
fallbackSerial=true;
|
||||
//falling back to old style serial for logging
|
||||
Serial.begin(115200);
|
||||
Serial.printf("fallback serial enabled\n");
|
||||
USBSerial.begin(115200);
|
||||
USBSerial.printf("fallback serial enabled\n");
|
||||
logger.prefix="FALLBACK:";
|
||||
#endif
|
||||
userCodeHandler.startInitTasks(MIN_USER_TASK);
|
||||
|
||||
Reference in New Issue
Block a user