Shrink builds by defining advanced micropython API

Also, ignore more pins on SAMD boards and disable EXFAT on others.
This commit is contained in:
Scott Shawcroft 2021-08-19 16:49:33 -07:00
parent e0ce5ff045
commit 5c6e80a2bb
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
17 changed files with 165 additions and 14 deletions

View File

@ -19,3 +19,11 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// Connected to a crystal
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
// SWD-only
#define IGNORE_PIN_PA30 1
#define IGNORE_PIN_PA31 1

View File

@ -19,3 +19,24 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// Connected to a crystal
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
// Unconnected
// Schematic at: https://jandjstudios.io/assets/pdfs/datum-Distance.pdf
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PA02 1
#define IGNORE_PIN_PB08 1
#define IGNORE_PIN_PB09 1
#define IGNORE_PIN_PA04 1
#define IGNORE_PIN_PA05 1
#define IGNORE_PIN_PB02 1
#define IGNORE_PIN_PA14 1
#define IGNORE_PIN_PA15 1
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PA28 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PA13 1

View File

@ -19,3 +19,22 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// Connected to a crystal
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
// Unconnected
// Schematic at: https://jandjstudios.io/assets/pdfs/datum-IMU.pdf
#define IGNORE_PIN_PB08 1
#define IGNORE_PIN_PB09 1
#define IGNORE_PIN_PA04 1
#define IGNORE_PIN_PA05 1
#define IGNORE_PIN_PB02 1
#define IGNORE_PIN_PA14 1
#define IGNORE_PIN_PA15 1
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PA28 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PA13 1

View File

@ -19,3 +19,24 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// Connected to a crystal
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
// Unconnected
// Schematic at: https://jandjstudios.io/assets/pdfs/datum-Light.pdf
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PA02 1
#define IGNORE_PIN_PB08 1
#define IGNORE_PIN_PB09 1
#define IGNORE_PIN_PA04 1
#define IGNORE_PIN_PA05 1
#define IGNORE_PIN_PB02 1
#define IGNORE_PIN_PA14 1
#define IGNORE_PIN_PA15 1
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PA28 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PA13 1

View File

@ -19,3 +19,24 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// Connected to a crystal
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
// Unconnected
// Schematic at: https://jandjstudios.io/assets/pdfs/datum-Weather.pdf
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PA02 1
#define IGNORE_PIN_PB08 1
#define IGNORE_PIN_PB09 1
#define IGNORE_PIN_PA04 1
#define IGNORE_PIN_PA05 1
#define IGNORE_PIN_PB02 1
#define IGNORE_PIN_PA14 1
#define IGNORE_PIN_PA15 1
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PA28 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PA13 1

View File

@ -17,3 +17,21 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// Connected to a crystal
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
// Unconnected
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PA09 1
#define IGNORE_PIN_PA13 1
#define IGNORE_PIN_PA14 1
#define IGNORE_PIN_PA27 1
#define IGNORE_PIN_PA28 1
// SWD-only
#define IGNORE_PIN_PA30 1
#define IGNORE_PIN_PA31 1

View File

@ -17,3 +17,24 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// Connected to a crystal
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
// Unconnected
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PB22 1
#define IGNORE_PIN_PB23 1
#define IGNORE_PIN_PA06 1
#define IGNORE_PIN_PA08 1
#define IGNORE_PIN_PA09 1
#define IGNORE_PIN_PA13 1
#define IGNORE_PIN_PA14 1
#define IGNORE_PIN_PA21 1
#define IGNORE_PIN_PA27 1
#define IGNORE_PIN_PA28 1
// SWD-only
#define IGNORE_PIN_PA30 1
#define IGNORE_PIN_PA31 1

View File

@ -19,3 +19,5 @@
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
#define MICROPY_FATFS_EXFAT 0

View File

@ -15,6 +15,7 @@ CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_GETPASS = 0
CIRCUITPY_KEYPAD = 0
CIRCUITPY_MSGPACK = 0
CIRCUITPY_PS2IO = 0

View File

@ -18,3 +18,7 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// Connected to a crystal
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1

View File

@ -240,8 +240,13 @@
#include "peripherals/samd/dma.h"
#if CIRCUITPY_AUDIOCORE
#define MICROPY_PORT_ROOT_POINTERS \
CIRCUITPY_COMMON_ROOT_POINTERS \
mp_obj_t playing_audio[AUDIO_DMA_CHANNEL_COUNT];
#else
#define MICROPY_PORT_ROOT_POINTERS \
CIRCUITPY_COMMON_ROOT_POINTERS
#endif
#endif // __INCLUDED_MPCONFIGPORT_H

View File

@ -47,3 +47,5 @@
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000)
#define AUTORESET_DELAY_MS (500)
#define MICROPY_FATFS_EXFAT 0

View File

@ -50,3 +50,5 @@
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000)
#define AUTORESET_DELAY_MS (500)
#define MICROPY_FATFS_EXFAT 0

View File

@ -39,3 +39,5 @@
// The schematic has a 32k crystal that isn't fitted. Uncommented the line below if you add it.
// #define BOARD_HAS_LOW_SPEED_CRYSTAL (1)
// #define LSE_VALUE ((uint32_t)32000U)
#define MICROPY_FATFS_EXFAT 0

View File

@ -51,3 +51,5 @@
#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
#define MICROPY_FATFS_EXFAT 0

View File

@ -211,6 +211,8 @@ typedef long mp_off_t;
#define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_RE)
#define MICROPY_PY_URE_SUB (CIRCUITPY_RE)
#define CIRCUITPY_MICROPYTHON_ADVANCED (CIRCUITPY_FULL_BUILD)
#ifndef MICROPY_FATFS_EXFAT
#define MICROPY_FATFS_EXFAT (CIRCUITPY_FULL_BUILD)
#endif

View File

@ -37,7 +37,7 @@
// Various builtins specific to MicroPython runtime,
// living in micropython module
#if MICROPY_ENABLE_COMPILER
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_COMPILER
STATIC mp_obj_t mp_micropython_opt_level(size_t n_args, const mp_obj_t *args) {
if (n_args == 0) {
return MP_OBJ_NEW_SMALL_INT(MP_STATE_VM(mp_optimise_value));
@ -49,7 +49,7 @@ STATIC mp_obj_t mp_micropython_opt_level(size_t n_args, const mp_obj_t *args) {
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_micropython_opt_level_obj, 0, 1, mp_micropython_opt_level);
#endif
#if MICROPY_PY_MICROPYTHON_MEM_INFO
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_PY_MICROPYTHON_MEM_INFO
#if MICROPY_MEM_STATS
STATIC mp_obj_t mp_micropython_mem_total(void) {
@ -109,21 +109,21 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_micropython_qstr_info_obj, 0, 1, m
#endif // MICROPY_PY_MICROPYTHON_MEM_INFO
#if MICROPY_PY_MICROPYTHON_STACK_USE
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_PY_MICROPYTHON_STACK_USE
STATIC mp_obj_t mp_micropython_stack_use(void) {
return MP_OBJ_NEW_SMALL_INT(mp_stack_usage());
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_stack_use_obj, mp_micropython_stack_use);
#endif
#if MICROPY_ENABLE_PYSTACK
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_PYSTACK
STATIC mp_obj_t mp_micropython_pystack_use(void) {
return MP_OBJ_NEW_SMALL_INT(mp_pystack_usage());
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_pystack_use_obj, mp_micropython_pystack_use);
#endif
#if MICROPY_ENABLE_GC
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_GC
STATIC mp_obj_t mp_micropython_heap_lock(void) {
gc_lock();
return mp_const_none;
@ -144,11 +144,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_heap_locked_obj, mp_micropython_
#endif
#endif
#if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0)
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0)
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_alloc_emergency_exception_buf_obj, mp_alloc_emergency_exception_buf);
#endif
#if MICROPY_KBD_EXCEPTION
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_KBD_EXCEPTION
STATIC mp_obj_t mp_micropython_kbd_intr(mp_obj_t int_chr_in) {
mp_hal_set_interrupt_char(mp_obj_get_int(int_chr_in));
return mp_const_none;
@ -169,10 +169,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mp_micropython_schedule_obj, mp_micropython_sch
STATIC const mp_rom_map_elem_t mp_module_micropython_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_micropython) },
{ MP_ROM_QSTR(MP_QSTR_const), MP_ROM_PTR(&mp_identity_obj) },
#if MICROPY_ENABLE_COMPILER
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_COMPILER
{ MP_ROM_QSTR(MP_QSTR_opt_level), MP_ROM_PTR(&mp_micropython_opt_level_obj) },
#endif
#if MICROPY_PY_MICROPYTHON_MEM_INFO
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_PY_MICROPYTHON_MEM_INFO
#if MICROPY_MEM_STATS
{ MP_ROM_QSTR(MP_QSTR_mem_total), MP_ROM_PTR(&mp_micropython_mem_total_obj) },
{ MP_ROM_QSTR(MP_QSTR_mem_current), MP_ROM_PTR(&mp_micropython_mem_current_obj) },
@ -181,23 +181,23 @@ STATIC const mp_rom_map_elem_t mp_module_micropython_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_mem_info), MP_ROM_PTR(&mp_micropython_mem_info_obj) },
{ MP_ROM_QSTR(MP_QSTR_qstr_info), MP_ROM_PTR(&mp_micropython_qstr_info_obj) },
#endif
#if MICROPY_PY_MICROPYTHON_STACK_USE
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_PY_MICROPYTHON_STACK_USE
{ MP_ROM_QSTR(MP_QSTR_stack_use), MP_ROM_PTR(&mp_micropython_stack_use_obj) },
#endif
#if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0)
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0)
{ MP_ROM_QSTR(MP_QSTR_alloc_emergency_exception_buf), MP_ROM_PTR(&mp_alloc_emergency_exception_buf_obj) },
#endif
#if MICROPY_ENABLE_PYSTACK
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_PYSTACK
{ MP_ROM_QSTR(MP_QSTR_pystack_use), MP_ROM_PTR(&mp_micropython_pystack_use_obj) },
#endif
#if MICROPY_ENABLE_GC
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_GC
{ MP_ROM_QSTR(MP_QSTR_heap_lock), MP_ROM_PTR(&mp_micropython_heap_lock_obj) },
{ MP_ROM_QSTR(MP_QSTR_heap_unlock), MP_ROM_PTR(&mp_micropython_heap_unlock_obj) },
#if MICROPY_PY_MICROPYTHON_HEAP_LOCKED
{ MP_ROM_QSTR(MP_QSTR_heap_locked), MP_ROM_PTR(&mp_micropython_heap_locked_obj) },
#endif
#endif
#if MICROPY_KBD_EXCEPTION
#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_KBD_EXCEPTION
{ MP_ROM_QSTR(MP_QSTR_kbd_intr), MP_ROM_PTR(&mp_micropython_kbd_intr_obj) },
#endif
#if MICROPY_ENABLE_SCHEDULER