summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorMark Olsson <mark@markolsson.se>2020-04-24 17:15:55 +0200
committerMark Olsson <mark@markolsson.se>2020-04-27 18:18:43 +0200
commit31d8e46063a897ec3cccb85ed989aec4308d7c08 (patch)
treeeb1544cefa4de9dea8f3829ce9902b5c1534debd /ports
parent9e4b94f4662b6dd21d39e9fb75cf9745b0db055e (diff)
Enables os on STM32F7
os.uname() works os.urandom() doesn't work yet, will enable in another PR
Diffstat (limited to 'ports')
-rwxr-xr-xports/stm/Makefile2
-rw-r--r--ports/stm/common-hal/os/__init__.c6
-rw-r--r--ports/stm/mpconfigport.mk4
3 files changed, 7 insertions, 5 deletions
diff --git a/ports/stm/Makefile b/ports/stm/Makefile
index c152b76f1..6bb690fc6 100755
--- a/ports/stm/Makefile
+++ b/ports/stm/Makefile
@@ -110,6 +110,8 @@ CFLAGS += $(MCU_FLAGS_$(MCU_SERIES))
# Select HAL file for distribution via mpconfigport
CFLAGS += -DSTM32_HAL_H='<stm32$(MCU_SERIES_LOWER)xx_hal.h>'
+CFLAGS += -DSTM32_SERIES_LOWER='"stm32$(MCU_SERIES_LOWER)"'
+
# Floating point settings
ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx))
CFLAGS += -mfpu=fpv5-d16 -mfloat-abi=hard
diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c
index 1a1efef9f..eef58bfe2 100644
--- a/ports/stm/common-hal/os/__init__.c
+++ b/ports/stm/common-hal/os/__init__.c
@@ -32,15 +32,15 @@
#include "py/mperrno.h"
#include "py/runtime.h"
-#include "stm32f4xx_hal.h"
+#include STM32_HAL_H
#include "peripherals/periph.h"
STATIC const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
};
-STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "stm32f4");
-STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "stm32f4");
+STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, STM32_SERIES_LOWER);
+STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, STM32_SERIES_LOWER);
STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk
index 7ed2aa49a..8305c0d0c 100644
--- a/ports/stm/mpconfigport.mk
+++ b/ports/stm/mpconfigport.mk
@@ -22,7 +22,7 @@ ifeq ($(MCU_SERIES),H7)
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 0
- CIRCUITPY_OS = 0
+ CIRCUITPY_OS = 1
CIRCUITPY_NVM = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
@@ -41,7 +41,7 @@ ifeq ($(MCU_SERIES),F7)
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 0
- CIRCUITPY_OS = 0
+ CIRCUITPY_OS = 1
CIRCUITPY_NVM = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0