Skip to content

Commit

Permalink
Populate MICROBIT_DAL_VERSION and add microbit_dal_version().
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-carlos committed Jul 9, 2024
1 parent 8c8db00 commit 56f817c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
11 changes: 7 additions & 4 deletions inc/MicroBitConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion inc/MicroBitDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
9 changes: 9 additions & 0 deletions source/MicroBitDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
Expand Down
2 changes: 1 addition & 1 deletion target-locked.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 56f817c

Please sign in to comment.