summaryrefslogtreecommitdiff
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
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.
-rw-r--r--.config19
-rw-r--r--CMakeLists.txt6
-rw-r--r--src/radio-controller.cpp13
m---------thirdparty/mcucpp0
4 files changed, 24 insertions, 14 deletions
diff --git a/.config b/.config
index fb84335..9664ef0 100644
--- a/.config
+++ b/.config
@@ -2,19 +2,26 @@
# Automatically generated file; DO NOT EDIT.
# MCU C++ Configuration
#
-# CONFIG_PRINTF_TARGET_SEMIHOSTING is not set
-CONFIG_PRINTF_TARGET_UART=y
-CONFIG_TINYPRINTF=y
#
# tinyprintf settings
#
+CONFIG_TINYPRINTF=y
CONFIG_TINYPRINTF_PRINTF=y
CONFIG_TINYPRINTF_SNPRINTF=y
-CONFIG_SEMIHOSTING=y
#
# Semihosting settings
#
-CONFIG_SEMIHOSTING_PUTCHAR=y
-CONFIG_SEMIHOSTING_PUTS=y
+CONFIG_SEMIHOSTING=y
+# CONFIG_SEMIHOSTING_PUTCHAR is not set
+# CONFIG_SEMIHOSTING_PUTS is not set
+
+#
+# stdio settings
+#
+# CONFIG_STDIO_TARGET_SEMIHOSTING is not set
+CONFIG_STDIO_TARGET_STM32CUBE_UART=y
+# CONFIG_STDIO_TARGET_STM32CUBE_UART_PORT_1 is not set
+CONFIG_STDIO_TARGET_STM32CUBE_UART_PORT_2=y
+CONFIG_STDIO_TARGET_STM32CUBE_UART_PORT="huart2"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf1aecd..4fc7403 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.6)
set(MCU_CHIP stm32f103C6)
-set(MCU_USE_STM32CUBEMX TRUE)
+set(MCU_USE_STM32CUBE TRUE)
set(MCU_LTO_MODE OFF)
include(thirdparty/mcu.cmake/mcu.cmake)
project(radio-controller C CXX ASM)
@@ -10,7 +10,7 @@ set(CMAKE_CXX_STANDARD 14)
include(thirdparty/mcucpp/cmake/mcucpp.cmake)
add_executable(firmware src/radio-controller.cpp include/radio-controller.h)
-target_compile_definitions(firmware PUBLIC MCUCMAKE_USING_STM32CUBEMX=1)
+target_compile_definitions(firmware PUBLIC MCUCMAKE_USING_STM32CUBE=1)
target_include_directories(firmware PUBLIC include)
target_link_libraries(firmware PUBLIC gcc)
mcu_add_executable(TARGET firmware)
@@ -34,7 +34,7 @@ target_sources(firmware PUBLIC
mcucpp_process(TARGET firmware)
-# stm32cubemx sources
+# stm32cube sources
mcu_include_directories_from_sources(
SOURCE_DIR stm32cubemx
EXCLUDE Templates
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");
diff --git a/thirdparty/mcucpp b/thirdparty/mcucpp
-Subproject 4a7d31a8218a167ea19a7e43942bf698443c539
+Subproject 2c9851f00520d83615a5041dfd1c31180ed0c44