diff options
author | Damien George <damien@micropython.org> | 2022-04-26 17:28:39 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-04-28 17:23:03 +1000 |
commit | 402df833fe6da5233c83c58421e81493cda54f67 (patch) | |
tree | c56176da71b30711764decc5068fdb8ea9376c4d /py/mpconfig.h | |
parent | 59c5d4161120db28bc6cbc7653f2e7fdb4a87370 (diff) |
py/modsys: Introduce sys.implementation._machine constant.
This contains a string useful for identifying the underlying machine. This
string is kept consistent with the second part of the REPL banner via the
new config option MICROPY_BANNER_MACHINE.
This makes os.uname() more or less redundant, as all the information in
os.uname() is now available in the sys module.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 0b190a997..b58cef309 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1719,6 +1719,15 @@ typedef double mp_float_t; #define MICROPY_BANNER_NAME_AND_VERSION "MicroPython " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE #endif +// String used for the second part of the banner, and sys.implementation._machine +#ifndef MICROPY_BANNER_MACHINE +#ifdef MICROPY_HW_BOARD_NAME +#define MICROPY_BANNER_MACHINE MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME +#else +#define MICROPY_BANNER_MACHINE MICROPY_PY_SYS_PLATFORM " [" MICROPY_PLATFORM_COMPILER "] version" +#endif +#endif + // On embedded platforms, these will typically enable/disable irqs. #ifndef MICROPY_BEGIN_ATOMIC_SECTION #define MICROPY_BEGIN_ATOMIC_SECTION() (0) |