summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-05-26 09:33:28 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-05-26 09:33:28 +0200
commit46b7f97720293e098fa26eb5269b481c45819deb (patch)
treea99550aa1b045fac84e682f1034d6fe2952fb3f8 /src
parent8a0f9a5bdc69ef8ce457a6c5db6a4c144f822ac3 (diff)
downloadradio-controller-46b7f97720293e098fa26eb5269b481c45819deb.tar.gz
radio-controller-46b7f97720293e098fa26eb5269b481c45819deb.tar.bz2
radio-controller-46b7f97720293e098fa26eb5269b481c45819deb.tar.xz
radio-controller-46b7f97720293e098fa26eb5269b481c45819deb.zip
o Updating to latest mcucpp.
Diffstat (limited to 'src')
-rw-r--r--src/radio-controller.cpp13
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");