diff --git a/inc/MicroBitConfig.h b/inc/MicroBitConfig.h index 6641e4e8..e9c08d8e 100644 --- a/inc/MicroBitConfig.h +++ b/inc/MicroBitConfig.h @@ -288,7 +288,11 @@ // 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/source/MicroBitDevice.cpp b/source/MicroBitDevice.cpp index 2bd4ccae..01f789c2 100644 --- a/source/MicroBitDevice.cpp +++ b/source/MicroBitDevice.cpp @@ -192,6 +192,10 @@ __NO_RETURN void microbit_reset() for (;;); } +const char * microbit_dal_version() { + return MICROBIT_DAL_VERSION; +} + /** * Seed the random number generator (RNG). *