diff options
author | Damien George <damien.p.george@gmail.com> | 2018-12-15 15:13:33 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-12-22 01:40:38 +1100 |
commit | 7cd59c5bc3ed2d4ade54e73fae18985b4b46ee42 (patch) | |
tree | 34524fa1c2f31addcad3374c8f05702128cd8a5c /py/mpconfig.h | |
parent | ce0c58117913f805db99767b22ecb7255b8686a1 (diff) |
py/mpconfig: Move MICROPY_VERSION macros to static ones in mpconfig.h.
It's more robust to have the version defined statically in a header file,
rather than dynamically generating it via git using a git tag. In case
git doesn't exist, or a different source control tool is used, it's
important to still have the uPy version number available.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 6edeb7a1c..7b0d78914 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -26,6 +26,23 @@ #ifndef MICROPY_INCLUDED_PY_MPCONFIG_H #define MICROPY_INCLUDED_PY_MPCONFIG_H +// Current version of MicroPython +#define MICROPY_VERSION_MAJOR (1) +#define MICROPY_VERSION_MINOR (9) +#define MICROPY_VERSION_MICRO (4) + +// Combined version as a 32-bit number for convenience +#define MICROPY_VERSION ( \ + MICROPY_VERSION_MAJOR << 16 \ + | MICROPY_VERSION_MINOR << 8 \ + | MICROPY_VERSION_MICRO) + +// String version +#define MICROPY_VERSION_STRING \ + MP_STRINGIFY(MICROPY_VERSION_MAJOR) "." \ + MP_STRINGIFY(MICROPY_VERSION_MINOR) "." \ + MP_STRINGIFY(MICROPY_VERSION_MICRO) + // This file contains default configuration settings for MicroPython. // You can override any of the options below using mpconfigport.h file // located in a directory of your port. |