From 46b7f97720293e098fa26eb5269b481c45819deb Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 26 May 2017 09:33:28 +0200 Subject: o Updating to latest mcucpp. --- src/radio-controller.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') 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"); -- cgit v1.2.3