diff --git a/Inc/config.h b/Inc/config.h index 141ac42..bc8daf8 100644 --- a/Inc/config.h +++ b/Inc/config.h @@ -176,7 +176,7 @@ #ifndef VARIANT_TRANSPOTTER //#define DEBUG_SERIAL_SERVOTERM - //#define DEBUG_SERIAL_ASCII + #define DEBUG_SERIAL_ASCII #endif // ########################### END OF DEBUG SERIAL ############################ diff --git a/Src/main.c b/Src/main.c index de6370e..6f2b4ba 100644 --- a/Src/main.c +++ b/Src/main.c @@ -550,6 +550,7 @@ int main(void) { if (main_loop_counter % 25 == 0 && command.start != IBUS_LENGTH && command.start != 0xFF) { HAL_UART_DMAStop(&huart); HAL_UART_Receive_DMA(&huart, (uint8_t *)&command, sizeof(command)); + command.start = 0xFF; // Change the Start Frame to avoid entering again here if no data is received } } #else @@ -572,6 +573,7 @@ int main(void) { if (main_loop_counter % 25 == 0 && command.start != START_FRAME && command.start != 0xFFFF) { HAL_UART_DMAStop(&huart); HAL_UART_Receive_DMA(&huart, (uint8_t *)&command, sizeof(command)); + command.start = 0xFFFF; // Change the Start Frame to avoid entering again here if no data is received } } #endif