From 8e1a15c79f4efb5dff88ab2a4dd82d9e1b24d2b2 Mon Sep 17 00:00:00 2001 From: Joe Finney Date: Fri, 4 Sep 2015 00:08:20 +0100 Subject: [PATCH] microbit: Added support for custom configuration files through yotta A header file containing custom configuration options for the microbit:runtime can now be defined through a yotaa configuration option. For example, including the following inside a top level config.json file will load configuration options from a file called "MicroBitCustomConfig.h" that is stored alongside an application's main.cpp. Any options defined there will override the defaults defined in microbit-dal/inc/MicroBitConfig.h : { "microbit" :{ "configfile" : "source/MicroBitCustomConfig.h" } } --- source/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 39af54f..e23a9bc 100755 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -30,6 +30,10 @@ set(YOTTA_AUTO_MICROBIT-DAL_CPP_FILES "MicroBitHeapAllocator.cpp" ) +if (YOTTA_CFG_MICROBIT_CONFIGFILE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${YOTTA_FORCE_INCLUDE_FLAG} \"${YOTTA_CFG_MICROBIT_CONFIGFILE}\"") +endif () + if(CMAKE_COMPILER_IS_GNUCC) file(REMOVE "CortexContextSwitch.s") configure_file("CortexContextSwitch.s.gcc" "CortexContextSwitch.s" COPYONLY)