diff --git a/App/app/breakout.c b/App/app/breakout.c index 6059eb63..ea0be553 100644 --- a/App/app/breakout.c +++ b/App/app/breakout.c @@ -16,6 +16,10 @@ #include "app/breakout.h" +#if defined(ENABLE_UART) || defined(ENABLE_USB) +#include "app/uart.h" +#endif + #ifdef ENABLE_FEAT_F4HWN_K5VIEWER #include "k5viewer.h" #endif @@ -359,6 +363,9 @@ void APP_RunBreakout(void) { while(isInitialized) { +#if defined(ENABLE_UART) || defined(ENABLE_USB) + UART_ServiceCommands(); +#endif Tick(); if(!isPaused) { diff --git a/App/app/foxhunt.c b/App/app/foxhunt.c index 0fa144a3..ab34ff00 100644 --- a/App/app/foxhunt.c +++ b/App/app/foxhunt.c @@ -18,6 +18,10 @@ #ifdef ENABLE_FEAT_F4HWN_FOXHUNT +#if defined(ENABLE_UART) || defined(ENABLE_USB) +#include "app/uart.h" +#endif + #ifdef ENABLE_FEAT_F4HWN_K5VIEWER #include "k5viewer.h" #endif @@ -965,6 +969,9 @@ void APP_RunFoxHunt(void) foxRunning = true; while (foxRunning) { +#if defined(ENABLE_UART) || defined(ENABLE_USB) + UART_ServiceCommands(); +#endif if (foxBeacon) { FOXHUNT_BeaconTick(); continue; diff --git a/App/app/spectrum.c b/App/app/spectrum.c index d4830b07..f86cb8a1 100644 --- a/App/app/spectrum.c +++ b/App/app/spectrum.c @@ -18,6 +18,10 @@ #include "audio.h" #include "misc.h" +#if defined(ENABLE_UART) || defined(ENABLE_USB) +#include "app/uart.h" +#endif + #ifdef ENABLE_SCAN_RANGES #include "chFrScanner.h" #endif @@ -2608,6 +2612,9 @@ void APP_RunSpectrum() while (isInitialized) { +#if defined(ENABLE_UART) || defined(ENABLE_USB) + UART_ServiceCommands(); +#endif Tick(); } diff --git a/App/app/uart.c b/App/app/uart.c index 7d14e65e..5c052430 100644 --- a/App/app/uart.c +++ b/App/app/uart.c @@ -866,4 +866,17 @@ void UART_HandleCommand(uint32_t Port) #ifdef ENABLE_FEAT_F4HWN_K5VIEWER gUART_LockK5Viewer = 20; // lock the K5Viewer stream #endif -} \ No newline at end of file +} + +void UART_ServiceCommands(void) +{ +#ifdef ENABLE_USB + if (UART_IsCommandAvailable(UART_PORT_VCP)) + UART_HandleCommand(UART_PORT_VCP); +#endif + +#ifdef ENABLE_UART + if (UART_IsCommandAvailable(UART_PORT_UART)) + UART_HandleCommand(UART_PORT_UART); +#endif +} diff --git a/App/app/uart.h b/App/app/uart.h index cac62817..45f5e5ce 100644 --- a/App/app/uart.h +++ b/App/app/uart.h @@ -32,6 +32,6 @@ enum bool UART_IsCommandAvailable(uint32_t Port); void UART_HandleCommand(uint32_t Port); +void UART_ServiceCommands(void); #endif -