Skip to content

Commit 5cbc65b

Browse files
author
Colin Hogben
committed
Add mbed-os version macros
Allow compile-time tests on the version of mbed-os to cope with e.g. API changes across versions.
1 parent e435a07 commit 5cbc65b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mbed.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818

1919
#define MBED_LIBRARY_VERSION 128
2020

21+
#define MBED_MAJOR_VERSION 5
22+
#define MBED_MINOR_VERSION 2
23+
#define MBED_PATCH_VERSION 0
24+
25+
#define MBED_ENCODE_VERSION(major,minor,patch) ((major)*10000 + (minor)*100 + (patch))
26+
27+
#define MBED_VERSION MBED_ENCODE_VERSION(MBED_MAJOR_VERSION,MBED_MINOR_VERSION,MBED_PATCH_VERSION)
28+
2129
#if MBED_CONF_RTOS_PRESENT
2230
#include "rtos/rtos.h"
2331
#endif

0 commit comments

Comments
 (0)