Skip to content

Commit 782d5b2

Browse files
iabdalkaderdpgeorge
authored andcommitted
stm32: Enable platform module.
The HAL version is based on the stm32lib version.
1 parent 2c5e9bb commit 782d5b2

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

ports/stm32/mpconfigport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@
228228
#ifndef MICROPY_PY_ONEWIRE
229229
#define MICROPY_PY_ONEWIRE (1)
230230
#endif
231+
#ifndef MICROPY_PY_UPLATFORM
232+
#define MICROPY_PY_UPLATFORM (1)
233+
#endif
231234

232235
// fatfs configuration used in ffconf.h
233236
#define MICROPY_FATFS_ENABLE_LFN (1)

ports/stm32/mphalport.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
#include STM32_HAL_H
33
#include "pin.h"
44

5+
// 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
6+
#if defined(STM32F0)
7+
#define MICROPY_HAL_VERSION "1.9.0"
8+
#elif defined(STM32F4)
9+
#define MICROPY_HAL_VERSION "1.16.0"
10+
#elif defined(STM32F7)
11+
#define MICROPY_HAL_VERSION "1.7.0"
12+
#elif defined(STM32H7)
13+
#define MICROPY_HAL_VERSION "1.6.0"
14+
#elif defined(STM32L0)
15+
#define MICROPY_HAL_VERSION "1.11.2"
16+
#elif defined(STM32L4)
17+
#define MICROPY_HAL_VERSION "1.8.1"
18+
#elif defined(STM32WB)
19+
#define MICROPY_HAL_VERSION "1.10.0"
20+
#endif
21+
522
extern const unsigned char mp_hal_status_to_errno_table[4];
623

724
static inline int mp_hal_status_to_neg_errno(HAL_StatusTypeDef status) {

0 commit comments

Comments
 (0)