From 69955e5dd1bec08046dfb4201b846fae43456371 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sun, 1 May 2022 11:08:18 +0200 Subject: [PATCH] some fixes for DEBUG --- radio/src/cli.cpp | 2 ++ radio/src/serial.cpp | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/radio/src/cli.cpp b/radio/src/cli.cpp index 1bf83f241..d3a7e2b2d 100644 --- a/radio/src/cli.cpp +++ b/radio/src/cli.cpp @@ -1279,6 +1279,8 @@ int cliDisplay(const char ** argv) cliSerialPrint("[%s] = %s", STR_VKEYS[i]+1, keys[i].state() ? "on" : "off"); } #if defined(ROTARY_ENCODER_NAVIGATION) + typedef int32_t rotenc_t; + extern volatile rotenc_t rotencValue; cliSerialPrint("[Enc.] = %d", rotencValue / ROTARY_ENCODER_GRANULARITY); #endif for (int i=TRM_BASE; i<=TRM_LAST; i++) { diff --git a/radio/src/serial.cpp b/radio/src/serial.cpp index 0e2721ced..da2e67c95 100644 --- a/radio/src/serial.cpp +++ b/radio/src/serial.cpp @@ -25,11 +25,17 @@ #include #include +#include + #include "aux_serial_driver.h" #include "hal/serial_port.h" -#include "opentx.h" -#include "lua/lua_api.h" +#if !defined(BOOT) + #include "opentx.h" + #include "lua/lua_api.h" +#else + #include "dataconstants.h" +#endif #define PRINTF_BUFFER_SIZE 128 @@ -285,6 +291,7 @@ static void serialSetPowerState(uint8_t port_nr) } } +#if !defined(BOOT) void serialSetPower(uint8_t port_nr, bool enabled) { if (port_nr >= MAX_SERIAL_PORTS) return; @@ -295,6 +302,7 @@ void serialSetPower(uint8_t port_nr, bool enabled) serialSetPowerState(port_nr); } +#endif void serialInit(uint8_t port_nr, int mode) { @@ -366,6 +374,7 @@ bool serialGetPower(uint8_t port_nr) return getSerialPower(port_nr); } +#if !defined(BOOT) void serialSetMode(uint8_t port_nr, int mode) { if (port_nr >= MAX_SERIAL_PORTS) return; @@ -375,6 +384,7 @@ void serialSetMode(uint8_t port_nr, int mode) ~(SERIAL_CONF_MODE_MASK << port_nr * SERIAL_CONF_BITS_PER_PORT)) | (m << port_nr * SERIAL_CONF_BITS_PER_PORT); } +#endif // uint8_t serialTracesEnabled(int port_nr) // {