Merge pull request #6440 from tannewt/translate_header
Switch translate() to the header file
This commit is contained in:
commit
ac282b2a73
|
@ -44,6 +44,7 @@
|
||||||
#include "shared-bindings/_bleio/Service.h"
|
#include "shared-bindings/_bleio/Service.h"
|
||||||
#include "shared-bindings/_bleio/UUID.h"
|
#include "shared-bindings/_bleio/UUID.h"
|
||||||
#include "supervisor/shared/tick.h"
|
#include "supervisor/shared/tick.h"
|
||||||
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23
|
STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23
|
||||||
STATIC unsigned long timeout = 5000;
|
STATIC unsigned long timeout = 5000;
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include "shared-bindings/supervisor/__init__.h"
|
#include "shared-bindings/supervisor/__init__.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if MICROPY_PY_UASYNCIO
|
#if MICROPY_PY_UASYNCIO
|
||||||
|
|
||||||
// Used when task cannot be guaranteed to be non-NULL.
|
// Used when task cannot be guaranteed to be non-NULL.
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/binary.h"
|
#include "py/binary.h"
|
||||||
|
|
||||||
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
static void check_not_unicode(const mp_obj_t arg) {
|
static void check_not_unicode(const mp_obj_t arg) {
|
||||||
#if MICROPY_CPYTHON_COMPAT
|
#if MICROPY_CPYTHON_COMPAT
|
||||||
if (mp_obj_is_str(arg)) {
|
if (mp_obj_is_str(arg)) {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "py/objtuple.h"
|
#include "py/objtuple.h"
|
||||||
#include "py/binary.h"
|
#include "py/binary.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if MICROPY_PY_UCTYPES
|
#if MICROPY_PY_UCTYPES
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if MICROPY_PY_UHASHLIB
|
#if MICROPY_PY_UHASHLIB
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "py/objlist.h"
|
#include "py/objlist.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if MICROPY_PY_UHEAPQ
|
#if MICROPY_PY_UHEAPQ
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if MICROPY_PY_UJSON
|
#if MICROPY_PY_UJSON
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/smallint.h"
|
#include "py/smallint.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if MICROPY_PY_UTIMEQ
|
#if MICROPY_PY_UTIMEQ
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if MICROPY_PY_UZLIB
|
#if MICROPY_PY_UZLIB
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "extmod/vfs_fat.h"
|
#include "extmod/vfs_fat.h"
|
||||||
#include "shared/timeutils/timeutils.h"
|
#include "shared/timeutils/timeutils.h"
|
||||||
#include "supervisor/filesystem.h"
|
#include "supervisor/filesystem.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if FF_MAX_SS == FF_MIN_SS
|
#if FF_MAX_SS == FF_MIN_SS
|
||||||
#define SECSIZE(fs) (FF_MIN_SS)
|
#define SECSIZE(fs) (FF_MIN_SS)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
#include "extmod/vfs_posix.h"
|
#include "extmod/vfs_posix.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#if (defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX) || (defined(MICROPY_VFS_POSIX_FILE) && MICROPY_VFS_POSIX_FILE)
|
#if (defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX) || (defined(MICROPY_VFS_POSIX_FILE) && MICROPY_VFS_POSIX_FILE)
|
||||||
|
|
||||||
|
|
2
main.c
2
main.c
|
@ -58,7 +58,7 @@
|
||||||
#include "supervisor/shared/status_leds.h"
|
#include "supervisor/shared/status_leds.h"
|
||||||
#include "supervisor/shared/tick.h"
|
#include "supervisor/shared/tick.h"
|
||||||
#include "supervisor/shared/traceback.h"
|
#include "supervisor/shared/traceback.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "supervisor/shared/workflow.h"
|
#include "supervisor/shared/workflow.h"
|
||||||
#include "supervisor/usb.h"
|
#include "supervisor/usb.h"
|
||||||
#include "supervisor/workflow.h"
|
#include "supervisor/workflow.h"
|
||||||
|
|
|
@ -67,7 +67,7 @@ SRC_C += \
|
||||||
shared/runtime/gchelper_generic.c \
|
shared/runtime/gchelper_generic.c \
|
||||||
supervisor/stub/safe_mode.c \
|
supervisor/stub/safe_mode.c \
|
||||||
supervisor/stub/stack.c \
|
supervisor/stub/stack.c \
|
||||||
supervisor/shared/translate.c
|
supervisor/shared/translate/translate.c
|
||||||
|
|
||||||
# Add fmode when compiling with mingw gcc
|
# Add fmode when compiling with mingw gcc
|
||||||
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
|
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
|
||||||
|
@ -78,6 +78,6 @@ endif
|
||||||
OBJ = $(PY_CORE_O)
|
OBJ = $(PY_CORE_O)
|
||||||
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
||||||
|
|
||||||
$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h
|
$(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h
|
||||||
|
|
||||||
include $(TOP)/py/mkrules.mk
|
include $(TOP)/py/mkrules.mk
|
||||||
|
|
|
@ -123,8 +123,6 @@ $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY))
|
||||||
#Debugging/Optimization
|
#Debugging/Optimization
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -ggdb3 -Og -Os
|
CFLAGS += -ggdb3 -Og -Os
|
||||||
# You may want to disable -flto if it interferes with debugging.
|
|
||||||
CFLAGS += -flto -flto-partition=one
|
|
||||||
# You may want to enable these flags to make setting breakpoints easier.
|
# You may want to enable these flags to make setting breakpoints easier.
|
||||||
# CFLAGS += -fno-inline -fno-ipa-sra
|
# CFLAGS += -fno-inline -fno-ipa-sra
|
||||||
ifeq ($(CHIP_FAMILY), samd21)
|
ifeq ($(CHIP_FAMILY), samd21)
|
||||||
|
@ -147,11 +145,8 @@ else
|
||||||
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
|
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += -flto
|
|
||||||
|
|
||||||
ifeq ($(CIRCUITPY_FULL_BUILD),0)
|
ifeq ($(CIRCUITPY_FULL_BUILD),0)
|
||||||
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20
|
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20
|
||||||
CFLAGS += -flto-partition=one
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CFLAGS_BOARD
|
ifdef CFLAGS_BOARD
|
||||||
|
@ -168,8 +163,7 @@ CFLAGS += \
|
||||||
-mcpu=cortex-m0plus \
|
-mcpu=cortex-m0plus \
|
||||||
-msoft-float \
|
-msoft-float \
|
||||||
-mfloat-abi=soft \
|
-mfloat-abi=soft \
|
||||||
-DSAMD21 \
|
-DSAMD21
|
||||||
-flto-partition=one
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(CHIP_FAMILY), samd51)
|
ifeq ($(CHIP_FAMILY), samd51)
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
|
@ -206,7 +200,6 @@ endif
|
||||||
CFLAGS += -Wno-stringop-overread -Wno-stringop-overflow
|
CFLAGS += -Wno-stringop-overread -Wno-stringop-overflow
|
||||||
|
|
||||||
LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
|
LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
|
||||||
LDFLAGS += -flto=$(shell $(NPROC))
|
|
||||||
LIBS := -lgcc -lc
|
LIBS := -lgcc -lc
|
||||||
|
|
||||||
# Use toolchain libm if we're not using our own.
|
# Use toolchain libm if we're not using our own.
|
||||||
|
@ -277,6 +270,9 @@ SRC_ASF += \
|
||||||
hpl/oscctrl/hpl_oscctrl.c \
|
hpl/oscctrl/hpl_oscctrl.c \
|
||||||
hpl/trng/hpl_trng.c \
|
hpl/trng/hpl_trng.c \
|
||||||
|
|
||||||
|
# Ignore these errors
|
||||||
|
$(BUILD)/asf4/same54/hpl/sercom/hpl_sercom.o: CFLAGS += -Wno-maybe-uninitialized
|
||||||
|
|
||||||
else ifeq ($(CHIP_FAMILY), same51)
|
else ifeq ($(CHIP_FAMILY), same51)
|
||||||
SRC_ASF += \
|
SRC_ASF += \
|
||||||
hal/src/hal_rand_sync.c \
|
hal/src/hal_rand_sync.c \
|
||||||
|
|
|
@ -12,3 +12,5 @@ LONGINT_IMPL = MPZ
|
||||||
|
|
||||||
CIRCUITPY__EVE = 1
|
CIRCUITPY__EVE = 1
|
||||||
CIRCUITPY_CANIO = 1
|
CIRCUITPY_CANIO = 1
|
||||||
|
|
||||||
|
CIRCUITPY_LTO_PARTITION = one
|
||||||
|
|
|
@ -10,6 +10,8 @@ QSPI_FLASH_FILESYSTEM = 1
|
||||||
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
|
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
|
||||||
LONGINT_IMPL = MPZ
|
LONGINT_IMPL = MPZ
|
||||||
|
|
||||||
|
CIRCUITPY_LTO_PARTITION = one
|
||||||
|
|
||||||
CIRCUITPY_AESIO = 0
|
CIRCUITPY_AESIO = 0
|
||||||
CIRCUITPY_ONEWIREIO = 0
|
CIRCUITPY_ONEWIREIO = 0
|
||||||
CIRCUITPY_PARALLELDISPLAY = 0
|
CIRCUITPY_PARALLELDISPLAY = 0
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "shared-bindings/util.h"
|
#include "shared-bindings/util.h"
|
||||||
#include "samd/timers.h"
|
#include "samd/timers.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "timer_handler.h"
|
#include "timer_handler.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "samd/adc.h"
|
#include "samd/adc.h"
|
||||||
#include "shared-bindings/analogio/AnalogIn.h"
|
#include "shared-bindings/analogio/AnalogIn.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "atmel_start_pins.h"
|
#include "atmel_start_pins.h"
|
||||||
#include "hal/include/hal_adc_sync.h"
|
#include "hal/include/hal_adc_sync.h"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "shared-bindings/analogio/AnalogOut.h"
|
#include "shared-bindings/analogio/AnalogOut.h"
|
||||||
#include "shared-bindings/audioio/AudioOut.h"
|
#include "shared-bindings/audioio/AudioOut.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "atmel_start_pins.h"
|
#include "atmel_start_pins.h"
|
||||||
#include "hal/include/hal_dac_sync.h"
|
#include "hal/include/hal_dac_sync.h"
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "shared-bindings/audiobusio/I2SOut.h"
|
#include "shared-bindings/audiobusio/I2SOut.h"
|
||||||
#include "shared-bindings/audiocore/RawSample.h"
|
#include "shared-bindings/audiocore/RawSample.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "atmel_start_pins.h"
|
#include "atmel_start_pins.h"
|
||||||
#include "hal/include/hal_gpio.h"
|
#include "hal/include/hal_gpio.h"
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "shared-bindings/audiobusio/PDMIn.h"
|
#include "shared-bindings/audiobusio/PDMIn.h"
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "atmel_start_pins.h"
|
#include "atmel_start_pins.h"
|
||||||
#include "hal/include/hal_gpio.h"
|
#include "hal/include/hal_gpio.h"
|
||||||
|
@ -80,11 +80,13 @@ void pdmin_reset(void) {
|
||||||
pdmin_dma_block_done = false;
|
pdmin_dma_block_done = false;
|
||||||
pdmin_event_channel = EVSYS_SYNCH_NUM;
|
pdmin_event_channel = EVSYS_SYNCH_NUM;
|
||||||
|
|
||||||
while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) {}
|
while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) {
|
||||||
|
}
|
||||||
I2S->INTENCLR.reg = I2S_INTENCLR_MASK;
|
I2S->INTENCLR.reg = I2S_INTENCLR_MASK;
|
||||||
I2S->INTFLAG.reg = I2S_INTFLAG_MASK;
|
I2S->INTFLAG.reg = I2S_INTFLAG_MASK;
|
||||||
I2S->CTRLA.reg &= ~I2S_SYNCBUSY_ENABLE;
|
I2S->CTRLA.reg &= ~I2S_SYNCBUSY_ENABLE;
|
||||||
while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) {}
|
while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) {
|
||||||
|
}
|
||||||
I2S->CTRLA.reg = I2S_CTRLA_SWRST;
|
I2S->CTRLA.reg = I2S_CTRLA_SWRST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,18 +110,18 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self,
|
||||||
} else if (clock_pin == &pin_PB11) {
|
} else if (clock_pin == &pin_PB11) {
|
||||||
self->clock_unit = 1;
|
self->clock_unit = 1;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#else
|
||||||
#ifdef SAM_D5X_E5X
|
#ifdef SAM_D5X_E5X
|
||||||
if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) {
|
if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) {
|
||||||
self->clock_unit = 0;
|
self->clock_unit = 0;
|
||||||
} else if (clock_pin == &pin_PB12
|
} else if (clock_pin == &pin_PB12
|
||||||
#if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28)
|
#if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28)
|
||||||
|| data_pin == &pin_PB28) {
|
|| data_pin == &pin_PB28
|
||||||
#else
|
|
||||||
) {
|
|
||||||
#endif
|
#endif
|
||||||
|
) {
|
||||||
self->clock_unit = 1;
|
self->clock_unit = 1;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
raise_ValueError_invalid_pin_name(MP_QSTR_clock);
|
raise_ValueError_invalid_pin_name(MP_QSTR_clock);
|
||||||
}
|
}
|
||||||
|
@ -136,8 +138,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self,
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
self->serializer = 0;
|
self->serializer = 0;
|
||||||
}
|
} else if (false
|
||||||
else if (false
|
|
||||||
#if defined(PIN_PA08) && !defined(IGNORE_PIN_PA08)
|
#if defined(PIN_PA08) && !defined(IGNORE_PIN_PA08)
|
||||||
|| data_pin == &pin_PA08
|
|| data_pin == &pin_PA08
|
||||||
#endif
|
#endif
|
||||||
|
@ -146,11 +147,12 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self,
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
self->serializer = 1;
|
self->serializer = 1;
|
||||||
#endif
|
#else
|
||||||
#ifdef SAM_D5X_E5X
|
#ifdef SAM_D5X_E5X
|
||||||
if (data_pin == &pin_PB10 || data_pin == &pin_PA22) {
|
if (data_pin == &pin_PB10 || data_pin == &pin_PA22) {
|
||||||
self->serializer = 1;
|
self->serializer = 1;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
raise_ValueError_invalid_pin_name(MP_QSTR_data);
|
raise_ValueError_invalid_pin_name(MP_QSTR_data);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +165,8 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self,
|
||||||
|
|
||||||
if (I2S->CTRLA.bit.ENABLE == 0) {
|
if (I2S->CTRLA.bit.ENABLE == 0) {
|
||||||
I2S->CTRLA.bit.SWRST = 1;
|
I2S->CTRLA.bit.SWRST = 1;
|
||||||
while (I2S->CTRLA.bit.SWRST == 1) {}
|
while (I2S->CTRLA.bit.SWRST == 1) {
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef SAMD21
|
#ifdef SAMD21
|
||||||
if ((I2S->CTRLA.vec.SEREN & (1 << self->serializer)) != 0) {
|
if ((I2S->CTRLA.vec.SEREN & (1 << self->serializer)) != 0) {
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "shared-bindings/audioio/AudioOut.h"
|
#include "shared-bindings/audioio/AudioOut.h"
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "atmel_start_pins.h"
|
#include "atmel_start_pins.h"
|
||||||
#include "hal/include/hal_gpio.h"
|
#include "hal/include/hal_gpio.h"
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "samd/sercom.h"
|
#include "samd/sercom.h"
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "common-hal/busio/__init__.h"
|
#include "common-hal/busio/__init__.h"
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "peripheral_clk_config.h"
|
#include "peripheral_clk_config.h"
|
||||||
|
|
||||||
#include "supervisor/board.h"
|
#include "supervisor/board.h"
|
||||||
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "common-hal/busio/__init__.h"
|
#include "common-hal/busio/__init__.h"
|
||||||
|
|
||||||
#include "hal/include/hal_gpio.h"
|
#include "hal/include/hal_gpio.h"
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "supervisor/shared/tick.h"
|
#include "supervisor/shared/tick.h"
|
||||||
|
|
||||||
#include "hpl_sercom_config.h"
|
#include "hpl_sercom_config.h"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include "eic_handler.h"
|
#include "eic_handler.h"
|
||||||
#include "samd/external_interrupts.h"
|
#include "samd/external_interrupts.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
void common_hal_countio_counter_construct(countio_counter_obj_t *self,
|
void common_hal_countio_counter_construct(countio_counter_obj_t *self,
|
||||||
const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) {
|
const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
#include "common-hal/microcontroller/Pin.h"
|
#include "common-hal/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
digitalinout_result_t common_hal_digitalio_digitalinout_construct(
|
digitalinout_result_t common_hal_digitalio_digitalinout_construct(
|
||||||
digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) {
|
digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) {
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/time/__init__.h"
|
#include "shared-bindings/time/__init__.h"
|
||||||
#include "supervisor/shared/tick.h"
|
#include "supervisor/shared/tick.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#ifdef SAMD21
|
#ifdef SAMD21
|
||||||
#include "hpl/gclk/hpl_gclk_base.h"
|
#include "hpl/gclk/hpl_gclk_base.h"
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "atmel_start_pins.h"
|
#include "atmel_start_pins.h"
|
||||||
#include "hal/include/hal_gpio.h"
|
#include "hal/include/hal_gpio.h"
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/microcontroller/Processor.h"
|
#include "shared-bindings/microcontroller/Processor.h"
|
||||||
#include "supervisor/shared/safe_mode.h"
|
#include "supervisor/shared/safe_mode.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
void common_hal_mcu_delay_us(uint32_t delay) {
|
void common_hal_mcu_delay_us(uint32_t delay) {
|
||||||
mp_hal_delay_us(delay);
|
mp_hal_delay_us(delay);
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/ps2io/Ps2.h"
|
#include "shared-bindings/ps2io/Ps2.h"
|
||||||
#include "supervisor/port.h"
|
#include "supervisor/port.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#define STATE_IDLE 0
|
#define STATE_IDLE 0
|
||||||
#define STATE_RECV 1
|
#define STATE_RECV 1
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/pulseio/PulseIn.h"
|
#include "shared-bindings/pulseio/PulseIn.h"
|
||||||
#include "supervisor/shared/tick.h"
|
#include "supervisor/shared/tick.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "supervisor/port.h"
|
#include "supervisor/port.h"
|
||||||
|
|
||||||
// This timer is shared amongst all PulseIn objects as a higher resolution clock.
|
// This timer is shared amongst all PulseIn objects as a higher resolution clock.
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "py/gc.h"
|
#include "py/gc.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "shared-bindings/pulseio/PulseOut.h"
|
#include "shared-bindings/pulseio/PulseOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "timer_handler.h"
|
#include "timer_handler.h"
|
||||||
|
|
||||||
// This timer is shared amongst all PulseOut objects under the assumption that
|
// This timer is shared amongst all PulseOut objects under the assumption that
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "hal/utils/include/utils_repeat_macro.h"
|
#include "hal/utils/include/utils_repeat_macro.h"
|
||||||
#include "samd/pins.h"
|
#include "samd/pins.h"
|
||||||
#include "samd/timers.h"
|
#include "samd/timers.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#undef ENABLE
|
#undef ENABLE
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "eic_handler.h"
|
#include "eic_handler.h"
|
||||||
#include "samd/external_interrupts.h"
|
#include "samd/external_interrupts.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t *self,
|
void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t *self,
|
||||||
const mcu_pin_obj_t *pin_a, const mcu_pin_obj_t *pin_b) {
|
const mcu_pin_obj_t *pin_a, const mcu_pin_obj_t *pin_b) {
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "shared-bindings/rtc/__init__.h"
|
#include "shared-bindings/rtc/__init__.h"
|
||||||
#include "shared-bindings/rtc/RTC.h"
|
#include "shared-bindings/rtc/RTC.h"
|
||||||
#include "supervisor/port.h"
|
#include "supervisor/port.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
// This is the time in seconds since 2000 that the RTC was started.
|
// This is the time in seconds since 2000 that the RTC was started.
|
||||||
// TODO: Change the offset to ticks so that it can be a subsecond adjustment.
|
// TODO: Change the offset to ticks so that it can be a subsecond adjustment.
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "shared-bindings/sdioio/SDCard.h"
|
#include "shared-bindings/sdioio/SDCard.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "genhdr/sdiodata.h"
|
#include "genhdr/sdiodata.h"
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "py/mphal.h"
|
#include "py/mphal.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/touchio/TouchIn.h"
|
#include "shared-bindings/touchio/TouchIn.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
// Native touchio only exists for SAMD21
|
// Native touchio only exists for SAMD21
|
||||||
#ifdef SAMD21
|
#ifdef SAMD21
|
||||||
|
|
|
@ -9,6 +9,7 @@ USB_NUM_ENDPOINT_PAIRS = 8
|
||||||
|
|
||||||
CIRCUITPY_ROTARYIO_SOFTENCODER = 1
|
CIRCUITPY_ROTARYIO_SOFTENCODER = 1
|
||||||
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1
|
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1
|
||||||
|
CIRCUITPY_LTO = 1
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Put samd21-only choices here.
|
# Put samd21-only choices here.
|
||||||
|
@ -78,6 +79,8 @@ endif
|
||||||
SUPEROPT_GC = 0
|
SUPEROPT_GC = 0
|
||||||
SUPEROPT_VM = 0
|
SUPEROPT_VM = 0
|
||||||
|
|
||||||
|
CIRCUITPY_LTO_PARTITION = one
|
||||||
|
|
||||||
ifeq ($(CIRCUITPY_FULL_BUILD),0)
|
ifeq ($(CIRCUITPY_FULL_BUILD),0)
|
||||||
# On the smallest boards, this saves about 180 bytes. On other boards, it may -increase- space used.
|
# On the smallest boards, this saves about 180 bytes. On other boards, it may -increase- space used.
|
||||||
CFLAGS_BOARD = -fweb -frename-registers
|
CFLAGS_BOARD = -fweb -frename-registers
|
||||||
|
@ -94,6 +97,10 @@ ifeq ($(CHIP_FAMILY),samd51)
|
||||||
# No native touchio on SAMD51.
|
# No native touchio on SAMD51.
|
||||||
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
|
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
|
||||||
|
|
||||||
|
ifeq ($(CIRCUITPY_FULL_BUILD),0)
|
||||||
|
CIRCUITPY_LTO_PARTITION ?= one
|
||||||
|
endif
|
||||||
|
|
||||||
# The ?='s allow overriding in mpconfigboard.mk.
|
# The ?='s allow overriding in mpconfigboard.mk.
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,6 +123,10 @@ ifeq ($(CHIP_FAMILY),same51)
|
||||||
# No native touchio on SAME51.
|
# No native touchio on SAME51.
|
||||||
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
|
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
|
||||||
|
|
||||||
|
ifeq ($(CIRCUITPY_FULL_BUILD),0)
|
||||||
|
CIRCUITPY_LTO_PARTITION ?= one
|
||||||
|
endif
|
||||||
|
|
||||||
# The ?='s allow overriding in mpconfigboard.mk.
|
# The ?='s allow overriding in mpconfigboard.mk.
|
||||||
|
|
||||||
CIRCUITPY_ALARM ?= 1
|
CIRCUITPY_ALARM ?= 1
|
||||||
|
|
|
@ -107,7 +107,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
|
||||||
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
|
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
|
||||||
|
|
||||||
# BCM CLFAGS
|
# BCM CLFAGS
|
||||||
CFLAGS += -ffreestanding -nostartfiles -DMICROPY_HW_MCU_NAME="\"$(CHIP_VARIANT)\""
|
CFLAGS += -nostartfiles -DMICROPY_HW_MCU_NAME="\"$(CHIP_VARIANT)\""
|
||||||
|
|
||||||
|
|
||||||
OPTIMIZATION_FLAGS ?= -O3
|
OPTIMIZATION_FLAGS ?= -O3
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
#include "common-hal/microcontroller/Pin.h"
|
#include "common-hal/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "peripherals/broadcom/gpio.h"
|
#include "peripherals/broadcom/gpio.h"
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "supervisor/port.h"
|
#include "supervisor/port.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "peripherals/broadcom/cpu.h"
|
#include "peripherals/broadcom/cpu.h"
|
||||||
#include "peripherals/broadcom/defines.h"
|
#include "peripherals/broadcom/defines.h"
|
||||||
|
|
|
@ -3,6 +3,8 @@ USB_HIGHSPEED = 1
|
||||||
# Number of USB endpoint pairs.
|
# Number of USB endpoint pairs.
|
||||||
USB_NUM_ENDPOINT_PAIRS = 6
|
USB_NUM_ENDPOINT_PAIRS = 6
|
||||||
|
|
||||||
|
CIRCUITPY_TRANSLATE_OBJECT = 1
|
||||||
|
|
||||||
# Longints can be implemented as mpz, as longlong, or not
|
# Longints can be implemented as mpz, as longlong, or not
|
||||||
LONGINT_IMPL = MPZ
|
LONGINT_IMPL = MPZ
|
||||||
|
|
||||||
|
|
|
@ -165,8 +165,6 @@ else
|
||||||
# RISC-V is larger than xtensa so do -Os for it
|
# RISC-V is larger than xtensa so do -Os for it
|
||||||
OPTIMIZATION_FLAGS ?= -Os
|
OPTIMIZATION_FLAGS ?= -Os
|
||||||
endif
|
endif
|
||||||
# TODO: Test with -flto
|
|
||||||
### CFLAGS += -flto
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
|
# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
|
||||||
|
|
|
@ -6,9 +6,6 @@ USB_MANUFACTURER = "Adafruit"
|
||||||
|
|
||||||
IDF_TARGET = esp32s3
|
IDF_TARGET = esp32s3
|
||||||
|
|
||||||
# Make room for build
|
|
||||||
CIRCUITPY_ULAB = 0
|
|
||||||
|
|
||||||
INTERNAL_FLASH_FILESYSTEM = 1
|
INTERNAL_FLASH_FILESYSTEM = 1
|
||||||
LONGINT_IMPL = MPZ
|
LONGINT_IMPL = MPZ
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "shared-bindings/analogio/AnalogIn.h"
|
#include "shared-bindings/analogio/AnalogIn.h"
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "components/driver/include/driver/adc_common.h"
|
#include "components/driver/include/driver/adc_common.h"
|
||||||
#include "components/esp_adc_cal/include/esp_adc_cal.h"
|
#include "components/esp_adc_cal/include/esp_adc_cal.h"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/analogio/AnalogOut.h"
|
#include "shared-bindings/analogio/AnalogOut.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32S2
|
#ifdef CONFIG_IDF_TARGET_ESP32S2
|
||||||
#include "components/driver/include/driver/dac_common.h"
|
#include "components/driver/include/driver/dac_common.h"
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include "shared-bindings/audiobusio/I2SOut.h"
|
#include "shared-bindings/audiobusio/I2SOut.h"
|
||||||
#include "shared-bindings/audiocore/RawSample.h"
|
#include "shared-bindings/audiocore/RawSample.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "driver/i2s.h"
|
#include "driver/i2s.h"
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
|
void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
|
||||||
const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint32_t frequency, uint32_t timeout) {
|
const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint32_t frequency, uint32_t timeout) {
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
#include "supervisor/port.h"
|
#include "supervisor/port.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "supervisor/shared/tick.h"
|
#include "supervisor/shared/tick.h"
|
||||||
|
|
||||||
uint8_t never_reset_uart_mask = 0;
|
uint8_t never_reset_uart_mask = 0;
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "common-hal/microcontroller/Pin.h"
|
#include "common-hal/microcontroller/Pin.h"
|
||||||
|
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
void common_hal_countio_counter_construct(countio_counter_obj_t *self,
|
void common_hal_countio_counter_construct(countio_counter_obj_t *self,
|
||||||
const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) {
|
const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "components/driver/include/driver/gpio.h"
|
#include "components/driver/include/driver/gpio.h"
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "common-hal/microcontroller/Processor.h"
|
#include "common-hal/microcontroller/Processor.h"
|
||||||
#include "shared-bindings/microcontroller/Processor.h"
|
#include "shared-bindings/microcontroller/Processor.h"
|
||||||
#include "shared-bindings/microcontroller/ResetReason.h"
|
#include "shared-bindings/microcontroller/ResetReason.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "esp_sleep.h"
|
#include "esp_sleep.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
|
|
|
@ -81,8 +81,6 @@ ifeq ($(DEBUG), 1)
|
||||||
else
|
else
|
||||||
CFLAGS += -DNDEBUG -ggdb3
|
CFLAGS += -DNDEBUG -ggdb3
|
||||||
OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions
|
OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions
|
||||||
# TODO: Test with -flto
|
|
||||||
### CFLAGS += -flto
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
|
# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
|
||||||
|
@ -99,7 +97,7 @@ LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -W
|
||||||
LIBS := -lgcc -lc
|
LIBS := -lgcc -lc
|
||||||
|
|
||||||
|
|
||||||
LDFLAGS += -flto -ffreestanding -nostartfiles -Wl,--gc-section -Wl,-Bstatic -Wl,-melf32lriscv -nostartfiles \
|
LDFLAGS += -ffreestanding -nostartfiles -Wl,--gc-section -Wl,-Bstatic -Wl,-melf32lriscv -nostartfiles \
|
||||||
-Wl,--no-warn-mismatch \
|
-Wl,--no-warn-mismatch \
|
||||||
-Wl,--build-id=none
|
-Wl,--build-id=none
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "csr.h"
|
#include "csr.h"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include "common-hal/microcontroller/Processor.h"
|
#include "common-hal/microcontroller/Processor.h"
|
||||||
#include "shared-bindings/microcontroller/Processor.h"
|
#include "shared-bindings/microcontroller/Processor.h"
|
||||||
#include "shared-bindings/microcontroller/ResetReason.h"
|
#include "shared-bindings/microcontroller/ResetReason.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "csr.h"
|
#include "csr.h"
|
||||||
#include "generated/soc.h"
|
#include "generated/soc.h"
|
||||||
|
|
|
@ -75,7 +75,7 @@ INC += \
|
||||||
|
|
||||||
# NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt.
|
# NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt.
|
||||||
|
|
||||||
CFLAGS += -Os -ftree-vrp -DNDEBUG -ffreestanding
|
CFLAGS += -ftree-vrp -DNDEBUG
|
||||||
|
|
||||||
# TinyUSB defines
|
# TinyUSB defines
|
||||||
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=512 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=512 -DCFG_TUD_MSC_BUFSIZE=1024
|
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=512 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=512 -DCFG_TUD_MSC_BUFSIZE=1024
|
||||||
|
@ -84,12 +84,8 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_
|
||||||
# Never set -fno-inline because we use inline to move small functions into routines that must be
|
# Never set -fno-inline because we use inline to move small functions into routines that must be
|
||||||
# in RAM. If inlining is disallowed, then we may end up calling a function in flash when we cannot.
|
# in RAM. If inlining is disallowed, then we may end up calling a function in flash when we cannot.
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
# You may want to disable -flto if it interferes with debugging.
|
|
||||||
# CFLAGS += -flto -flto-partition=none
|
|
||||||
# You may want to enable these flags to make setting breakpoints easier.
|
# You may want to enable these flags to make setting breakpoints easier.
|
||||||
CFLAGS += -fno-ipa-sra
|
CFLAGS += -fno-ipa-sra
|
||||||
else
|
|
||||||
#CFLAGS += -flto -flto-partition=none
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += $(INC) -ggdb -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes
|
CFLAGS += $(INC) -ggdb -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes
|
||||||
|
@ -105,7 +101,6 @@ CFLAGS += \
|
||||||
-mfloat-abi=hard \
|
-mfloat-abi=hard \
|
||||||
-mfpu=fpv5-sp-d16 \
|
-mfpu=fpv5-sp-d16 \
|
||||||
-DCPU_$(CHIP_VARIANT) \
|
-DCPU_$(CHIP_VARIANT) \
|
||||||
-DDEBUG \
|
|
||||||
-DIMXRT10XX \
|
-DIMXRT10XX \
|
||||||
-g3 -Wno-unused-parameter \
|
-g3 -Wno-unused-parameter \
|
||||||
-ffunction-sections -fdata-sections -fstack-usage
|
-ffunction-sections -fdata-sections -fstack-usage
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/analogio/AnalogOut.h"
|
#include "shared-bindings/analogio/AnalogOut.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) {
|
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) {
|
||||||
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut);
|
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut);
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U
|
#define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/microcontroller/Processor.h"
|
#include "shared-bindings/microcontroller/Processor.h"
|
||||||
#include "supervisor/shared/safe_mode.h"
|
#include "supervisor/shared/safe_mode.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#define DBL_TAP_REG SNVS->LPGPR[3]
|
#define DBL_TAP_REG SNVS->LPGPR[3]
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
#include "fsl_pwm.h"
|
#include "fsl_pwm.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "periph.h"
|
#include "periph.h"
|
||||||
|
|
||||||
// Debug print support set to zero to enable debug printing
|
// Debug print support set to zero to enable debug printing
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "shared-bindings/rtc/__init__.h"
|
#include "shared-bindings/rtc/__init__.h"
|
||||||
#include "shared-bindings/rtc/RTC.h"
|
#include "shared-bindings/rtc/RTC.h"
|
||||||
#include "common-hal/rtc/RTC.h"
|
#include "common-hal/rtc/RTC.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "fsl_snvs_hp.h"
|
#include "fsl_snvs_hp.h"
|
||||||
|
|
||||||
|
|
|
@ -84,14 +84,6 @@ INC += -I../../lib/mp-readline
|
||||||
INC += -I../../lib/tinyusb/src
|
INC += -I../../lib/tinyusb/src
|
||||||
INC += -I../../supervisor/shared/usb
|
INC += -I../../supervisor/shared/usb
|
||||||
|
|
||||||
ifeq ($(MCU_CHIP),nrf52833)
|
|
||||||
OPTIMIZATION_FLAGS ?= -Os -flto -flto-partition=one
|
|
||||||
else
|
|
||||||
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
|
|
||||||
OPTIMIZATION_FLAGS ?= -Os -flto
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
#Debugging/Optimization
|
#Debugging/Optimization
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -ggdb3
|
CFLAGS += -ggdb3
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "shared-bindings/analogio/AnalogIn.h"
|
#include "shared-bindings/analogio/AnalogIn.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "nrf_saadc.h"
|
#include "nrf_saadc.h"
|
||||||
#include "nrf_gpio.h"
|
#include "nrf_gpio.h"
|
||||||
|
@ -77,7 +77,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
|
||||||
// Something else might have used the ADC in a different way,
|
// Something else might have used the ADC in a different way,
|
||||||
// so we completely re-initialize it.
|
// so we completely re-initialize it.
|
||||||
|
|
||||||
nrf_saadc_value_t value;
|
nrf_saadc_value_t value = -1;
|
||||||
|
|
||||||
const nrf_saadc_channel_config_t config = {
|
const nrf_saadc_channel_config_t config = {
|
||||||
.resistor_p = NRF_SAADC_RESISTOR_DISABLED,
|
.resistor_p = NRF_SAADC_RESISTOR_DISABLED,
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) {
|
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) {
|
||||||
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut);
|
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut);
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/tick.h"
|
#include "supervisor/shared/tick.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
// TODO: This should be the same size as PWMOut.c:pwms[], but there's no trivial way to accomplish that
|
// TODO: This should be the same size as PWMOut.c:pwms[], but there's no trivial way to accomplish that
|
||||||
STATIC audiopwmio_pwmaudioout_obj_t *active_audio[4];
|
STATIC audiopwmio_pwmaudioout_obj_t *active_audio[4];
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "nrfx_twim.h"
|
#include "nrfx_twim.h"
|
||||||
#include "nrfx_spim.h"
|
#include "nrfx_spim.h"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "nrfx_uarte.h"
|
#include "nrfx_uarte.h"
|
||||||
#include "nrf_gpio.h"
|
#include "nrf_gpio.h"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "nrf_gpio.h"
|
#include "nrf_gpio.h"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
#include "common-hal/alarm/__init__.h"
|
#include "common-hal/alarm/__init__.h"
|
||||||
#include "shared-bindings/microcontroller/ResetReason.h"
|
#include "shared-bindings/microcontroller/ResetReason.h"
|
||||||
#include "supervisor/shared/translate.h"
|
|
||||||
|
|
||||||
#include "nrfx_saadc.h"
|
#include "nrfx_saadc.h"
|
||||||
#ifdef BLUETOOTH_SD
|
#ifdef BLUETOOTH_SD
|
||||||
|
@ -72,7 +71,7 @@ uint32_t common_hal_mcu_processor_get_frequency(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float common_hal_mcu_processor_get_voltage(void) {
|
float common_hal_mcu_processor_get_voltage(void) {
|
||||||
nrf_saadc_value_t value;
|
nrf_saadc_value_t value = -1;
|
||||||
|
|
||||||
const nrf_saadc_channel_config_t config = {
|
const nrf_saadc_channel_config_t config = {
|
||||||
.resistor_p = NRF_SAADC_RESISTOR_DISABLED,
|
.resistor_p = NRF_SAADC_RESISTOR_DISABLED,
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "shared-bindings/pulseio/PulseOut.h"
|
#include "shared-bindings/pulseio/PulseOut.h"
|
||||||
#include "shared-bindings/pwmio/PWMOut.h"
|
#include "shared-bindings/pwmio/PWMOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
// A single timer is shared amongst all PulseOut objects under the assumption that
|
// A single timer is shared amongst all PulseOut objects under the assumption that
|
||||||
// the code is single threaded.
|
// the code is single threaded.
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "common-hal/pwmio/PWMOut.h"
|
#include "common-hal/pwmio/PWMOut.h"
|
||||||
#include "shared-bindings/pwmio/PWMOut.h"
|
#include "shared-bindings/pwmio/PWMOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "nrf_gpio.h"
|
#include "nrf_gpio.h"
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "common-hal/rtc/RTC.h"
|
#include "common-hal/rtc/RTC.h"
|
||||||
#include "shared-bindings/rtc/RTC.h"
|
#include "shared-bindings/rtc/RTC.h"
|
||||||
#include "supervisor/port.h"
|
#include "supervisor/port.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
// This is the time in seconds since 2000 that the RTC was started.
|
// This is the time in seconds since 2000 that the RTC was started.
|
||||||
__attribute__((section(".uninitialized"))) static uint32_t rtc_offset[3];
|
__attribute__((section(".uninitialized"))) static uint32_t rtc_offset[3];
|
||||||
|
|
|
@ -71,6 +71,12 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
|
||||||
# Defined here because system_nrf52840.c doesn't #include any of our own include files.
|
# Defined here because system_nrf52840.c doesn't #include any of our own include files.
|
||||||
CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS
|
CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS
|
||||||
|
|
||||||
|
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
|
||||||
|
OPTIMIZATION_FLAGS ?= -Os
|
||||||
|
CIRCUITPY_LTO = 1
|
||||||
|
CIRCUITPY_LTO_PARTITION = balanced
|
||||||
|
endif
|
||||||
|
|
||||||
else
|
else
|
||||||
ifeq ($(MCU_CHIP),nrf52833)
|
ifeq ($(MCU_CHIP),nrf52833)
|
||||||
MCU_SERIES = m4
|
MCU_SERIES = m4
|
||||||
|
@ -87,5 +93,9 @@ SOFTDEV_VERSION ?= 7.0.1
|
||||||
BOOT_SETTING_ADDR = 0x7F000
|
BOOT_SETTING_ADDR = 0x7F000
|
||||||
NRF_DEFINES += -DNRF52833_XXAA -DNRF52833
|
NRF_DEFINES += -DNRF52833_XXAA -DNRF52833
|
||||||
|
|
||||||
|
OPTIMIZATION_FLAGS ?= -Os
|
||||||
|
|
||||||
|
CIRCUITPY_LTO = 1
|
||||||
|
CIRCUITPY_LTO_PARTITION = one
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/objproperty.h"
|
#include "py/objproperty.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
|
|
||||||
//| class StateMachine:
|
//| class StateMachine:
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "shared-bindings/analogio/AnalogIn.h"
|
#include "shared-bindings/analogio/AnalogIn.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "src/rp2_common/hardware_adc/include/hardware/adc.h"
|
#include "src/rp2_common/hardware_adc/include/hardware/adc.h"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) {
|
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) {
|
||||||
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut);
|
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut);
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-module/audiocore/__init__.h"
|
#include "shared-module/audiocore/__init__.h"
|
||||||
#include "bindings/rp2pio/StateMachine.h"
|
#include "bindings/rp2pio/StateMachine.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
const uint16_t i2s_program[] = {
|
const uint16_t i2s_program[] = {
|
||||||
// ; Load the next set of samples
|
// ; Load the next set of samples
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "shared-bindings/audiobusio/PDMIn.h"
|
#include "shared-bindings/audiobusio/PDMIn.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "audio_dma.h"
|
#include "audio_dma.h"
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/microcontroller/Processor.h"
|
#include "shared-bindings/microcontroller/Processor.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "src/rp2040/hardware_structs/include/hardware/structs/dma.h"
|
#include "src/rp2040/hardware_structs/include/hardware/structs/dma.h"
|
||||||
#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
|
#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/mpstate.h"
|
#include "py/mpstate.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "shared-bindings/countio/Edge.h"
|
#include "shared-bindings/countio/Edge.h"
|
||||||
#include "shared-bindings/digitalio/Pull.h"
|
#include "shared-bindings/digitalio/Pull.h"
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
#include "common-hal/microcontroller/Pin.h"
|
#include "common-hal/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
|
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "supervisor/filesystem.h"
|
#include "supervisor/filesystem.h"
|
||||||
#include "supervisor/port.h"
|
#include "supervisor/port.h"
|
||||||
#include "supervisor/shared/safe_mode.h"
|
#include "supervisor/shared/safe_mode.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "src/rp2040/hardware_structs/include/hardware/structs/sio.h"
|
#include "src/rp2040/hardware_structs/include/hardware/structs/sio.h"
|
||||||
#include "src/rp2_common/hardware_sync/include/hardware/sync.h"
|
#include "src/rp2_common/hardware_sync/include/hardware/sync.h"
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/pulseio/PulseIn.h"
|
#include "shared-bindings/pulseio/PulseIn.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "bindings/rp2pio/StateMachine.h"
|
#include "bindings/rp2pio/StateMachine.h"
|
||||||
#include "common-hal/pulseio/PulseIn.h"
|
#include "common-hal/pulseio/PulseIn.h"
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "shared-bindings/pwmio/PWMOut.h"
|
#include "shared-bindings/pwmio/PWMOut.h"
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "common-hal/pwmio/PWMOut.h"
|
#include "common-hal/pwmio/PWMOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "src/rp2040/hardware_structs/include/hardware/structs/pwm.h"
|
#include "src/rp2040/hardware_structs/include/hardware/structs/pwm.h"
|
||||||
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
|
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
|
||||||
#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
|
#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "shared-bindings/pwmio/PWMOut.h"
|
#include "shared-bindings/pwmio/PWMOut.h"
|
||||||
#include "shared-bindings/microcontroller/Processor.h"
|
#include "shared-bindings/microcontroller/Processor.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "src/rp2040/hardware_regs/include/hardware/platform_defs.h"
|
#include "src/rp2040/hardware_regs/include/hardware/platform_defs.h"
|
||||||
#include "src/rp2_common/hardware_clocks/include/hardware/clocks.h"
|
#include "src/rp2_common/hardware_clocks/include/hardware/clocks.h"
|
||||||
|
|
|
@ -88,8 +88,6 @@ else
|
||||||
CFLAGS += -DNDEBUG
|
CFLAGS += -DNDEBUG
|
||||||
OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions
|
OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions
|
||||||
CFLAGS += -ggdb3
|
CFLAGS += -ggdb3
|
||||||
# TODO: Test with -flto
|
|
||||||
# CFLAGS += -flto
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
|
# to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#include "common-hal/analogio/AnalogIn.h"
|
#include "common-hal/analogio/AnalogIn.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/analogio/AnalogOut.h"
|
#include "shared-bindings/analogio/AnalogOut.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "common-hal/microcontroller/Pin.h"
|
#include "common-hal/microcontroller/Pin.h"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
|
|
||||||
// I2C timing specs for the H7 and F7
|
// I2C timing specs for the H7 and F7
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "supervisor/board.h"
|
#include "supervisor/board.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
|
|
||||||
// Note that any bugs introduced in this file can cause crashes at startup
|
// Note that any bugs introduced in this file can cause crashes at startup
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#define ALL_UARTS 0xFFFF
|
#define ALL_UARTS 0xFFFF
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
// The HAL is sparse on obtaining register information, so we use the LLs here.
|
// The HAL is sparse on obtaining register information, so we use the LLs here.
|
||||||
#if (CPY_STM32H7)
|
#if (CPY_STM32H7)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include "common-hal/microcontroller/Processor.h"
|
#include "common-hal/microcontroller/Processor.h"
|
||||||
#include "shared-bindings/microcontroller/ResetReason.h"
|
#include "shared-bindings/microcontroller/ResetReason.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include STM32_HAL_H
|
#include STM32_HAL_H
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "shared-bindings/pulseio/PulseOut.h"
|
#include "shared-bindings/pulseio/PulseOut.h"
|
||||||
#include "shared-bindings/pwmio/PWMOut.h"
|
#include "shared-bindings/pwmio/PWMOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include STM32_HAL_H
|
#include STM32_HAL_H
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "common-hal/pwmio/PWMOut.h"
|
#include "common-hal/pwmio/PWMOut.h"
|
||||||
#include "shared-bindings/pwmio/PWMOut.h"
|
#include "shared-bindings/pwmio/PWMOut.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include STM32_HAL_H
|
#include STM32_HAL_H
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/util.h"
|
#include "shared-bindings/util.h"
|
||||||
#include "supervisor/board.h"
|
#include "supervisor/board.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
#include "common-hal/microcontroller/Pin.h"
|
#include "common-hal/microcontroller/Pin.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "py/gc.h"
|
#include "py/gc.h"
|
||||||
#include "py/obj.h"
|
#include "py/obj.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
#include "shared-bindings/microcontroller/__init__.h"
|
#include "shared-bindings/microcontroller/__init__.h"
|
||||||
#include "shared-bindings/microcontroller/Pin.h"
|
#include "shared-bindings/microcontroller/Pin.h"
|
||||||
|
|
|
@ -233,7 +233,7 @@ SRC_C += \
|
||||||
supervisor/stub/filesystem.c \
|
supervisor/stub/filesystem.c \
|
||||||
supervisor/stub/safe_mode.c \
|
supervisor/stub/safe_mode.c \
|
||||||
supervisor/stub/stack.c \
|
supervisor/stub/stack.c \
|
||||||
supervisor/shared/translate.c \
|
supervisor/shared/translate/translate.c \
|
||||||
$(SRC_MOD) \
|
$(SRC_MOD) \
|
||||||
$(wildcard $(VARIANT_DIR)/*.c)
|
$(wildcard $(VARIANT_DIR)/*.c)
|
||||||
|
|
||||||
|
@ -363,4 +363,4 @@ install: $(PROG)
|
||||||
uninstall:
|
uninstall:
|
||||||
-rm $(BINDIR)/$(PROG)
|
-rm $(BINDIR)/$(PROG)
|
||||||
|
|
||||||
$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h
|
$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "py/objint.h"
|
#include "py/objint.h"
|
||||||
#include "py/gc.h"
|
#include "py/gc.h"
|
||||||
|
|
||||||
#include "supervisor/shared/translate.h"
|
#include "supervisor/shared/translate/translate.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* modffi uses character codes to encode a value type, based on "struct"
|
* modffi uses character codes to encode a value type, based on "struct"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue