From cca0631354c2581c4de8a0373091720da70052c5 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Mon, 11 Mar 2024 19:03:13 +0000 Subject: [PATCH] Implement microbit_dal_version() and set MICROBIT_DAL_VERSION. --- inc/MicroBitConfig.h | 6 +++++- source/MicroBitDevice.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) 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). *