Skip to content

Commit 5900257

Browse files
stinosdpgeorge
authored andcommitted
extmod/uplatform: Use generic custom platform string.
Don't force the 'HAL' string to be part of the platform string because it doesn't have a sensible meaning for all possible platforms, and swap it with the PLATFORM_ARCH string so the strings which most platforms have come first.
1 parent 1e58755 commit 5900257

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

extmod/moduplatform.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@
9999
#define PLATFORM_SYSTEM "MicroPython"
100100
#endif
101101

102-
#ifndef MICROPY_HAL_VERSION
103-
#define MICROPY_HAL_VERSION ""
102+
#ifndef MICROPY_PLATFORM_VERSION
103+
#define MICROPY_PLATFORM_VERSION ""
104104
#endif
105105

106-
STATIC const MP_DEFINE_STR_OBJ(info_platform_obj, PLATFORM_SYSTEM "-" MICROPY_VERSION_STRING "-HAL" \
107-
MICROPY_HAL_VERSION "-" PLATFORM_ARCH "-with-" PLATFORM_LIBC_LIB "" PLATFORM_LIBC_VER);
106+
STATIC const MP_DEFINE_STR_OBJ(info_platform_obj, PLATFORM_SYSTEM "-" MICROPY_VERSION_STRING "-" \
107+
PLATFORM_ARCH "-" MICROPY_PLATFORM_VERSION "-with-" PLATFORM_LIBC_LIB "" PLATFORM_LIBC_VER);
108108
STATIC const MP_DEFINE_STR_OBJ(info_python_compiler_obj, PLATFORM_COMPILER);
109109
STATIC const MP_DEFINE_STR_OBJ(info_libc_lib_obj, PLATFORM_LIBC_LIB);
110110
STATIC const MP_DEFINE_STR_OBJ(info_libc_ver_obj, PLATFORM_LIBC_VER);

ports/stm32/mphalport.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
// F0-1.9.0+F4-1.16.0+F7-1.7.0+H7-1.6.0+L0-1.11.2+L4-1.8.1+WB-1.10.0
66
#if defined(STM32F0)
7-
#define MICROPY_HAL_VERSION "1.9.0"
7+
#define MICROPY_PLATFORM_VERSION "HAL1.9.0"
88
#elif defined(STM32F4)
9-
#define MICROPY_HAL_VERSION "1.16.0"
9+
#define MICROPY_PLATFORM_VERSION "HAL1.16.0"
1010
#elif defined(STM32F7)
11-
#define MICROPY_HAL_VERSION "1.7.0"
11+
#define MICROPY_PLATFORM_VERSION "HAL1.7.0"
1212
#elif defined(STM32H7)
13-
#define MICROPY_HAL_VERSION "1.6.0"
13+
#define MICROPY_PLATFORM_VERSION "HAL1.6.0"
1414
#elif defined(STM32L0)
15-
#define MICROPY_HAL_VERSION "1.11.2"
15+
#define MICROPY_PLATFORM_VERSION "HAL1.11.2"
1616
#elif defined(STM32L4)
17-
#define MICROPY_HAL_VERSION "1.8.1"
17+
#define MICROPY_PLATFORM_VERSION "HAL1.8.1"
1818
#elif defined(STM32WB)
19-
#define MICROPY_HAL_VERSION "1.10.0"
19+
#define MICROPY_PLATFORM_VERSION "HAL1.10.0"
2020
#endif
2121

2222
extern const unsigned char mp_hal_status_to_errno_table[4];

0 commit comments

Comments
 (0)