Skip to content

Commit

Permalink
py/mpconfig: Add MICROPY_PY_PLATFORM, enabled at extra features level.
Browse files Browse the repository at this point in the history
Previously this was explicitly enabled on esp32/stm32/renesas/mimxrt/samd,
but didn't get a default feature level because it wasn't in py/mpconfig.h.

With this commit it's now enabled at the "extra features" level, which adds
rp2, unix-standard, windows, esp8266, webassembly, and some nrf boards.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
  • Loading branch information
jimmo authored and dpgeorge committed Jul 24, 2023
1 parent 1437485 commit 975a687
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion ports/esp32/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@
#define MICROPY_PY_WEBSOCKET (1)
#define MICROPY_PY_WEBREPL (1)
#define MICROPY_PY_ONEWIRE (1)
#define MICROPY_PY_PLATFORM (1)
#define MICROPY_PY_SOCKET_EVENTS (MICROPY_PY_WEBREPL)
#define MICROPY_PY_BLUETOOTH_RANDOM_ADDR (1)
#define MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME ("ESP32")
Expand Down
1 change: 0 additions & 1 deletion ports/mimxrt/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ uint32_t trng_random_u32(void);
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_SOFT_TIMER_TICKS_MS systick_ms
#define MICROPY_PY_ONEWIRE (1)
#define MICROPY_PY_PLATFORM (1)

// fatfs configuration used in ffconf.h
#define MICROPY_FATFS_ENABLE_LFN (1)
Expand Down
3 changes: 0 additions & 3 deletions ports/renesas-ra/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@
#ifndef MICROPY_PY_ONEWIRE
#define MICROPY_PY_ONEWIRE (1)
#endif
#ifndef MICROPY_PY_PLATFORM
#define MICROPY_PY_PLATFORM (1)
#endif

// fatfs configuration used in ffconf.h
#define MICROPY_FATFS_ENABLE_LFN (1)
Expand Down
3 changes: 0 additions & 3 deletions ports/stm32/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@
#ifndef MICROPY_PY_ONEWIRE
#define MICROPY_PY_ONEWIRE (1)
#endif
#ifndef MICROPY_PY_PLATFORM
#define MICROPY_PY_PLATFORM (1)
#endif

// fatfs configuration used in ffconf.h
#define MICROPY_FATFS_ENABLE_LFN (1)
Expand Down
5 changes: 5 additions & 0 deletions py/mpconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,11 @@ typedef double mp_float_t;
#define MICROPY_PY_ONEWIRE (0)
#endif

// Whether to provide the "platform" module
#ifndef MICROPY_PY_PLATFORM
#define MICROPY_PY_PLATFORM (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
#endif

/*****************************************************************************/
/* Hooks for a port to add builtins */

Expand Down
8 changes: 4 additions & 4 deletions tests/unix/extra_coverage.py.exp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ cmath collections cppexample cryptolib
deflate errno example_package
ffi framebuf gc hashlib
heapq io json machine
math os random re
select socket ssl struct
sys termios time uctypes
websocket
math os platform random
re select socket ssl
struct sys termios time
uctypes websocket
me

micropython machine math
Expand Down

0 comments on commit 975a687

Please sign in to comment.