From e0aca6433ec7dc949491c0479403c0f1b85fe1ea Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sat, 4 May 2024 08:31:57 +1000 Subject: [PATCH] fix(debug): don't initalise SP_AUX1 if not exist (#4962) --- radio/src/targets/horus/board.cpp | 2 +- radio/src/targets/nv14/board.cpp | 2 +- radio/src/targets/nv14/board.h | 1 - radio/src/targets/pl18/board.cpp | 2 +- radio/src/targets/pl18/board.h | 1 - radio/src/targets/taranis/board.cpp | 2 +- 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/radio/src/targets/horus/board.cpp b/radio/src/targets/horus/board.cpp index 3a04840093b..bedfc8ef381 100644 --- a/radio/src/targets/horus/board.cpp +++ b/radio/src/targets/horus/board.cpp @@ -104,7 +104,7 @@ void boardInit() __enable_irq(); -#if defined(DEBUG) +#if defined(DEBUG) && defined(AUX_SERIAL) serialSetMode(SP_AUX1, UART_MODE_DEBUG); // indicate AUX1 is used serialInit(SP_AUX1, UART_MODE_DEBUG); // early AUX1 init #endif diff --git a/radio/src/targets/nv14/board.cpp b/radio/src/targets/nv14/board.cpp index 79cd5e9ad88..3258e2678a8 100644 --- a/radio/src/targets/nv14/board.cpp +++ b/radio/src/targets/nv14/board.cpp @@ -161,7 +161,7 @@ void boardInit() // detect NV14 vs EL18 hardwareOptions.pcbrev = boardGetPcbRev(); -#if defined(DEBUG) +#if defined(DEBUG) && defined(AUX_SERIAL) serialSetMode(SP_AUX1, UART_MODE_DEBUG); // indicate AUX1 is used serialInit(SP_AUX1, UART_MODE_DEBUG); // early AUX1 init #endif diff --git a/radio/src/targets/nv14/board.h b/radio/src/targets/nv14/board.h index dbc9a95648f..a86447cb27a 100644 --- a/radio/src/targets/nv14/board.h +++ b/radio/src/targets/nv14/board.h @@ -242,7 +242,6 @@ void hapticOff(); void hapticOn(uint32_t pwmPercent); // Second serial port driver -//#define AUX_SERIAL #define DEBUG_BAUDRATE 115200 #define LUA_DEFAULT_BAUDRATE 115200 diff --git a/radio/src/targets/pl18/board.cpp b/radio/src/targets/pl18/board.cpp index 0022c810463..dc64dbb29dc 100644 --- a/radio/src/targets/pl18/board.cpp +++ b/radio/src/targets/pl18/board.cpp @@ -128,7 +128,7 @@ void boardInit() __enable_irq(); #endif -#if defined(DEBUG) +#if defined(DEBUG) && defined(AUX_SERIAL) serialSetMode(SP_AUX1, UART_MODE_DEBUG); // indicate AUX1 is used serialInit(SP_AUX1, UART_MODE_DEBUG); // early AUX1 init #endif diff --git a/radio/src/targets/pl18/board.h b/radio/src/targets/pl18/board.h index 7809a5225a6..461c1f82031 100644 --- a/radio/src/targets/pl18/board.h +++ b/radio/src/targets/pl18/board.h @@ -226,7 +226,6 @@ void hapticOff(); void hapticOn(uint32_t pwmPercent); // Second serial port driver -//#define AUX_SERIAL #define DEBUG_BAUDRATE 115200 #define LUA_DEFAULT_BAUDRATE 115200 diff --git a/radio/src/targets/taranis/board.cpp b/radio/src/targets/taranis/board.cpp index 37fa2dc357f..8f0b680e575 100644 --- a/radio/src/targets/taranis/board.cpp +++ b/radio/src/targets/taranis/board.cpp @@ -215,7 +215,7 @@ void boardInit() ws2812_update(&_led_timer); #endif -#if defined(DEBUG) +#if defined(DEBUG) && defined(AUX_SERIAL) serialSetMode(SP_AUX1, UART_MODE_DEBUG); // indicate AUX1 is used serialInit(SP_AUX1, UART_MODE_DEBUG); // early AUX1 init #endif