diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index 45dc4dabdcf..f998ae32522 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -103,7 +103,7 @@ static Fifo* luaRxFifo = nullptr; static bool luaRxFifoGetByte(void*, uint8_t* data) { - if (!luaRxFifo) return -1; + if (!luaRxFifo) return false; return luaRxFifo->pop(*data); } diff --git a/radio/src/sbus.cpp b/radio/src/sbus.cpp index e8758a197a1..1a964438f93 100644 --- a/radio/src/sbus.cpp +++ b/radio/src/sbus.cpp @@ -38,13 +38,13 @@ static bool (*_sbusAuxGetByte)(void*, uint8_t*) = nullptr; static void* _sbusAuxGetByteCtx = nullptr; -void sbusSetAuxGetByte(void* ctx, bool (*fct)(void*, uint8_t*)) +void sbusSetAuxGetByte(void* const ctx, bool (* const fct)(void*, uint8_t*)) { _sbusAuxGetByteCtx = ctx; _sbusAuxGetByte = fct; } -bool sbusAuxGetByte(uint8_t* byte) +bool sbusAuxGetByte(uint8_t* const byte) { auto _getByte = _sbusAuxGetByte; auto _ctx = _sbusAuxGetByteCtx; diff --git a/radio/src/serial.cpp b/radio/src/serial.cpp index 6003c952b26..cc4e8e68809 100644 --- a/radio/src/serial.cpp +++ b/radio/src/serial.cpp @@ -248,7 +248,6 @@ static void serialSetupPort(int mode, etx_serial_init& params) params.parity = ETX_Parity_None; params.stop_bits = ETX_StopBits_One; params.rx_enable = true; - power_required = true; break; case UART_MODE_CRSF_TRAINER: @@ -257,7 +256,6 @@ static void serialSetupPort(int mode, etx_serial_init& params) params.parity = ETX_Parity_None; params.stop_bits = ETX_StopBits_One; params.rx_enable = true; - power_required = true; break; case UART_MODE_SUMD_TRAINER: @@ -266,7 +264,6 @@ static void serialSetupPort(int mode, etx_serial_init& params) params.parity = ETX_Parity_None; params.stop_bits = ETX_StopBits_One; params.rx_enable = true; - power_required = true; break; #if defined(LUA) @@ -365,11 +362,6 @@ void serialInit(uint8_t port_nr, int mode) if (port->uart && port->uart->init) state->usart_ctx = port->uart->init(¶ms); - // Set power on/off - if (port->set_pwr) { - port->set_pwr(power_required); - } - #if !defined(BLUETOOTH) && defined(PCBHORUS) && defined(BT_EN_GPIO_PIN) && !defined(SIMU) && !defined(GTESTS) if (port_nr == SP_AUX2) { TRACE_DEBUG("disbale bt EN (set EN pin high)\n\r");