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"
   }
}
master
Joe Finney 2015-09-04 00:08:20 +01:00
parent f616011ac1
commit 8e1a15c79f
1 changed files with 4 additions and 0 deletions

View File

@ -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)