diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/radio-controller.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/radio-controller.cpp b/src/radio-controller.cpp index 9795574..461a910 100644 --- a/src/radio-controller.cpp +++ b/src/radio-controller.cpp @@ -1,8 +1,8 @@ #include "radio-controller.h" #include "stm32f1xx_hal.h" #include "mcu/arm/semihosting.h" -#include "mcu/stm32cubemx/uart.h" -#include "mcu/stm32cubemx/debug.h" +#include "mcu/stm32cube/uart.h" +#include "mcu/stm32cube/debug.h" #ifdef HAL_IWDG_MODULE_ENABLED extern IWDG_HandleTypeDef hiwdg; @@ -11,14 +11,17 @@ extern IWDG_HandleTypeDef hiwdg; extern TIM_HandleTypeDef htim1; extern UART_HandleTypeDef huart2; -mcu::stm32cubemx::uart::uart_port uart2(&huart2); -mcu::stm32cubemx::debug::dbg<100> dbg(uart2); +mcu::stm32cube::uart::uart_port uart2(&huart2); +mcu::stm32cube::debug::dbg<100> dbg(uart2); void main_pre_init() { } void main_post_init() { - semihosting::enable(); + bool debugger_connected = (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) != 0; + if (debugger_connected) { + semihosting::enable(); + } printf("Radio Controller\n"); |