From 73cc6b750e0709170183ce7da89af618eae40329 Mon Sep 17 00:00:00 2001 From: robert-hh Date: Wed, 31 May 2023 10:32:55 +0200 Subject: [PATCH] ports: Enable os.sync() for esp32, esp8266, rp2, mimxrt, samd51. These have by default FAT support. The SAMD21 build does not support FAT. The nrf port also implements os.sync(), but has it's own copy of moduos.c. Code size increases seen: 40 to 56 bytes. Signed-off-by: robert-hh --- ports/esp32/mpconfigport.h | 1 + ports/esp8266/mpconfigport.h | 1 + ports/mimxrt/mpconfigport.h | 1 + ports/rp2/mpconfigport.h | 1 + ports/samd/mcu/samd51/mpconfigmcu.h | 1 + 5 files changed, 5 insertions(+) diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h index ea3487bcd8..4701040e66 100644 --- a/ports/esp32/mpconfigport.h +++ b/ports/esp32/mpconfigport.h @@ -91,6 +91,7 @@ #define MICROPY_PY_UOS_INCLUDEFILE "ports/esp32/moduos.c" #define MICROPY_PY_OS_DUPTERM (1) #define MICROPY_PY_UOS_DUPTERM_NOTIFY (1) +#define MICROPY_PY_UOS_SYNC (1) #define MICROPY_PY_UOS_UNAME (1) #define MICROPY_PY_UOS_URANDOM (1) #define MICROPY_PY_MACHINE (1) diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h index 12ea3716d4..0cfb83f73e 100644 --- a/ports/esp8266/mpconfigport.h +++ b/ports/esp8266/mpconfigport.h @@ -87,6 +87,7 @@ #define MICROPY_PY_OS_DUPTERM (2) #define MICROPY_PY_UOS_DUPTERM_NOTIFY (1) #define MICROPY_PY_UOS_DUPTERM_STREAM_DETACHED_ATTACHED (1) +#define MICROPY_PY_UOS_SYNC (1) #define MICROPY_PY_UOS_UNAME (1) #define MICROPY_PY_UOS_UNAME_RELEASE_DYNAMIC (1) #define MICROPY_PY_UOS_URANDOM (1) diff --git a/ports/mimxrt/mpconfigport.h b/ports/mimxrt/mpconfigport.h index 4482e54960..52301cf94b 100644 --- a/ports/mimxrt/mpconfigport.h +++ b/ports/mimxrt/mpconfigport.h @@ -76,6 +76,7 @@ uint32_t trng_random_u32(void); #define MICROPY_PY_UOS_INCLUDEFILE "ports/mimxrt/moduos.c" #define MICROPY_PY_OS_DUPTERM (3) #define MICROPY_PY_UOS_DUPTERM_NOTIFY (1) +#define MICROPY_PY_UOS_SYNC (1) #define MICROPY_PY_UOS_UNAME (1) #define MICROPY_PY_UOS_URANDOM (1) #define MICROPY_PY_URANDOM_SEED_INIT_FUNC (trng_random_u32()) diff --git a/ports/rp2/mpconfigport.h b/ports/rp2/mpconfigport.h index b4487a23d7..720e858f19 100644 --- a/ports/rp2/mpconfigport.h +++ b/ports/rp2/mpconfigport.h @@ -99,6 +99,7 @@ #ifndef MICROPY_PY_OS_DUPTERM #define MICROPY_PY_OS_DUPTERM (1) #endif +#define MICROPY_PY_UOS_SYNC (1) #define MICROPY_PY_UOS_UNAME (1) #define MICROPY_PY_UOS_URANDOM (1) #define MICROPY_PY_URE_MATCH_GROUPS (1) diff --git a/ports/samd/mcu/samd51/mpconfigmcu.h b/ports/samd/mcu/samd51/mpconfigmcu.h index 07d4696901..0c2d2370ff 100644 --- a/ports/samd/mcu/samd51/mpconfigmcu.h +++ b/ports/samd/mcu/samd51/mpconfigmcu.h @@ -27,6 +27,7 @@ #define MICROPY_PY_MACHINE_DHT_READINTO (1) #define MICROPY_PY_ONEWIRE (1) +#define MICROPY_PY_UOS_SYNC (1) #define MICROPY_PY_UOS_URANDOM (1) #define MICROPY_PY_URANDOM_SEED_INIT_FUNC (trng_random_u32()) unsigned long trng_random_u32(void);