samd/mpconfigport: Restructure to use ROM feature levels.
Changes are: - Set the feature level for each MCU: CORE features for SAMD21, and EXTRA features for SAMD51. - Remove all definitions that are included in the core feature level. - Keep the default settings for feature level and float, to make the choice obvious.
This commit is contained in:
parent
a415752173
commit
929dfc66a3
|
@ -161,6 +161,7 @@ SRC_QSTR += \
|
|||
shared/readline/readline.c \
|
||||
extmod/uos_dupterm.c \
|
||||
shared/runtime/mpirq.c \
|
||||
shared/runtime/sys_stdio_mphal.c \
|
||||
|
||||
SRC_QSTR += $(SRC_MOD) $(SRC_CXX)
|
||||
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
// Deinitions common to all SAMD21 boards
|
||||
#include "samd21.h"
|
||||
|
||||
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES)
|
||||
|
||||
// MicroPython emitters
|
||||
#define MICROPY_EMIT_THUMB (0)
|
||||
#define MICROPY_EMIT_INLINE_THUMB (0)
|
||||
|
||||
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
|
||||
|
||||
#define MICROPY_HW_FLASH_STORAGE_BASE (0x30000)
|
||||
#define MICROPY_HW_FLASH_STORAGE_BYTES (0xFFFF)
|
||||
#define VFS_BLOCK_SIZE_BYTES (1536) // 24x 64B flash pages;
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
// Deinitions common to all SAMD51 boards
|
||||
#include "samd51.h"
|
||||
|
||||
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_FULL_FEATURES)
|
||||
|
||||
// MicroPython emitters
|
||||
#define MICROPY_EMIT_THUMB (1)
|
||||
#define MICROPY_EMIT_INLINE_THUMB (1)
|
||||
|
||||
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
|
||||
#define MICROPY_PY_BUILTINS_COMPLEX (0)
|
||||
#define MICROPY_PY_MATH (0)
|
||||
#define MICROPY_PY_CMATH (0)
|
||||
|
||||
#define MICROPY_PY_UOS_URANDOM (1)
|
||||
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (trng_random_u32())
|
||||
unsigned long trng_random_u32(void);
|
||||
|
|
|
@ -40,8 +40,6 @@
|
|||
|
||||
// MicroPython emitters
|
||||
#define MICROPY_PERSISTENT_CODE_LOAD (1)
|
||||
#define MICROPY_EMIT_THUMB (0)
|
||||
#define MICROPY_EMIT_INLINE_THUMB (0)
|
||||
|
||||
// Compiler configuration
|
||||
#define MICROPY_COMP_CONST (1)
|
||||
|
@ -56,33 +54,18 @@
|
|||
#define MICROPY_ENABLE_SOURCE_LINE (1)
|
||||
#define MICROPY_STREAMS_NON_BLOCK (1)
|
||||
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
|
||||
#define MICROPY_CPYTHON_COMPAT (0)
|
||||
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
|
||||
#define MICROPY_PY_BUILTINS_HELP (1)
|
||||
#define MICROPY_PY_BUILTINS_HELP_TEXT samd_help_text
|
||||
#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
|
||||
#define MICROPY_ENABLE_SCHEDULER (1)
|
||||
// fixes sys/usys import issue
|
||||
#define MICROPY_MODULE_WEAK_LINKS (1)
|
||||
|
||||
// Control over Python builtins
|
||||
#define MICROPY_PY_ASYNC_AWAIT (0)
|
||||
#define MICROPY_PY_BUILTINS_BYTES_HEX (1)
|
||||
#define MICROPY_PY_BUILTINS_STR_COUNT (0)
|
||||
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
|
||||
#define MICROPY_PY_BUILTINS_SET (0)
|
||||
#define MICROPY_PY_BUILTINS_FROZENSET (0)
|
||||
#define MICROPY_PY_BUILTINS_PROPERTY (0)
|
||||
#define MICROPY_PY_BUILTINS_ENUMERATE (1)
|
||||
#define MICROPY_PY_BUILTINS_FILTER (0)
|
||||
#define MICROPY_PY_BUILTINS_REVERSED (0)
|
||||
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
|
||||
#define MICROPY_PY_BUILTINS_MIN_MAX (1)
|
||||
#define MICROPY_PY_BUILTINS_INPUT (1)
|
||||
#define MICROPY_PY___FILE__ (0)
|
||||
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
|
||||
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
|
||||
#define MICROPY_PY_ATTRTUPLE (1)
|
||||
#define MICROPY_PY_COLLECTIONS (0)
|
||||
#define MICROPY_PY_SYS (1)
|
||||
#define MICROPY_PY_SYS_PLATFORM "samd"
|
||||
#define MICROPY_PY_SYS_EXIT (1)
|
||||
|
@ -118,10 +101,6 @@
|
|||
#define MICROPY_PY_MACHINE_PWM_DUTY_U16_NS (1)
|
||||
#define MICROPY_PY_MACHINE_PWM_INCLUDEFILE "ports/samd/machine_pwm.c"
|
||||
|
||||
// Use VfsLfs's types for fileio/textio
|
||||
#define mp_type_fileio mp_type_vfs_lfs1_fileio
|
||||
#define mp_type_textio mp_type_vfs_lfs1_textio
|
||||
|
||||
#define MP_STATE_PORT MP_STATE_VM
|
||||
|
||||
// Miscellaneous settings
|
||||
|
|
Loading…
Reference in New Issue