diff --git a/inc/MicroBitConfig.h b/inc/MicroBitConfig.h index 6641e4e8..ff11aa51 100644 --- a/inc/MicroBitConfig.h +++ b/inc/MicroBitConfig.h @@ -283,12 +283,15 @@ #endif // Versioning options. -// We use semantic versioning (http://semver.org/) to identify differnet versions of the micro:bit runtime. -// Where possible we use yotta (an ARM mbed build tool) to help us track versions. -// if this isn't available, it can be defined manually as a configuration option. +// We use semantic versioning (http://semver.org/) to identify different versions of the micro:bit runtime. +// If this isn't available, it can be defined manually as a configuration option. // #ifndef MICROBIT_DAL_VERSION - #define MICROBIT_DAL_VERSION "unknown" + #ifdef DEVICE_DAL_VERSION + #define MICROBIT_DAL_VERSION DEVICE_DAL_VERSION + #else + #define MICROBIT_DAL_VERSION "unknown" + #endif #endif // Allow USB serial events to wake the board from deep sleep. diff --git a/inc/MicroBitDevice.h b/inc/MicroBitDevice.h index c597b44e..a95cd68f 100644 --- a/inc/MicroBitDevice.h +++ b/inc/MicroBitDevice.h @@ -96,7 +96,7 @@ namespace codal void microbit_reset(); /** - * Determine the version of microbit-dal currently running. + * For DAL compatibility, determine the version of DAL/CODAL currently running. * @return a pointer to a character buffer containing a representation of the semantic version number. */ const char * microbit_dal_version(); diff --git a/source/MicroBitDevice.cpp b/source/MicroBitDevice.cpp index 2bd4ccae..115739b7 100644 --- a/source/MicroBitDevice.cpp +++ b/source/MicroBitDevice.cpp @@ -192,6 +192,15 @@ __NO_RETURN void microbit_reset() for (;;); } +/** + * For DAL compatibility, determine the version of DAL/CODAL currently running. + * @return a pointer to a character buffer containing a representation of the semantic version number. + */ +const char * microbit_dal_version() +{ + return MICROBIT_DAL_VERSION; +} + /** * Seed the random number generator (RNG). * diff --git a/target-locked.json b/target-locked.json index 704c36d6..0a88b058 100644 --- a/target-locked.json +++ b/target-locked.json @@ -50,7 +50,7 @@ "generate_hex": true, "libraries": [ { - "branch": "992c0b11a0eb2a1edca9c2f76821f89a99a3acec", + "branch": "c46d62943bc05a1b8296663ac4c643475a3e8a4c", "name": "codal-core", "type": "git", "url": "https://github.com/lancaster-university/codal-core"