Skip to content

Commit 92fbf2a

Browse files
committed
Add versioning information to mbed OS 5.5 release branch
1 parent 40042f0 commit 92fbf2a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

mbed.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,28 @@
1616
#ifndef MBED_H
1717
#define MBED_H
1818

19+
#define MBED_LIBRARY_VERSION -1
20+
21+
#if MBED_CONF_RTOS_PRESENT
22+
// RTOS present, this is valid only for mbed OS 5
23+
#define MBED_MAJOR_VERSION 5
24+
#define MBED_MINOR_VERSION 5
25+
#define MBED_PATCH_VERSION -1
26+
27+
#else
28+
// mbed 2
29+
#define MBED_MAJOR_VERSION 2
30+
#define MBED_MINOR_VERSION 0
31+
#define MBED_PATCH_VERSION MBED_LIBRARY_VERSION
32+
#endif
33+
34+
#define MBED_ENCODE_VERSION(major, minor, patch) ((major)*10000 + (minor)*100 + (patch))
35+
#define MBED_VERSION MBED_ENCODE_VERSION(MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION)
36+
37+
#if MBED_CONF_RTOS_PRESENT
38+
#include "rtos/rtos.h"
39+
#endif
40+
1941
#if MBED_CONF_RTOS_PRESENT
2042
#include "rtos/rtos.h"
2143
#endif

0 commit comments

Comments
 (0)