Fix #ifdefs in port.c to call xxx_reset() rroutines properly. Remove most uses of EXPRESS_BOARD.
This commit is contained in:
parent
ef802c91e7
commit
9c24c804fb
@ -577,7 +577,7 @@ int8_t parseDHCPMSG(void)
|
|||||||
|
|
||||||
uint8_t * p;
|
uint8_t * p;
|
||||||
uint8_t * e;
|
uint8_t * e;
|
||||||
uint8_t type;
|
uint8_t type = 0;
|
||||||
uint8_t opt_len;
|
uint8_t opt_len;
|
||||||
|
|
||||||
if((len = getSn_RX_RSR(DHCP_SOCKET)) > 0)
|
if((len = getSn_RX_RSR(DHCP_SOCKET)) > 0)
|
||||||
@ -973,7 +973,3 @@ uint32_t getDHCPLeasetime(void)
|
|||||||
{
|
{
|
||||||
return dhcp_lease_time;
|
return dhcp_lease_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,9 +102,9 @@ ifeq ($(DEBUG), 1)
|
|||||||
# Turn on Python modules useful for debugging (e.g. uheap, ustack).
|
# Turn on Python modules useful for debugging (e.g. uheap, ustack).
|
||||||
CFLAGS += -ggdb
|
CFLAGS += -ggdb
|
||||||
# You may want to disable -flto if it interferes with debugging.
|
# You may want to disable -flto if it interferes with debugging.
|
||||||
# CFLAGS += -flto
|
CFLAGS += -flto
|
||||||
# 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)
|
||||||
CFLAGS += -DENABLE_MICRO_TRACE_BUFFER
|
CFLAGS += -DENABLE_MICRO_TRACE_BUFFER
|
||||||
endif
|
endif
|
||||||
@ -112,7 +112,7 @@ else
|
|||||||
# -finline-limit can shrink the image size.
|
# -finline-limit can shrink the image size.
|
||||||
# -finline-limit=80 or so is similar to not having it on.
|
# -finline-limit=80 or so is similar to not having it on.
|
||||||
# There is no simple default value, though.
|
# There is no simple default value, though.
|
||||||
ifdef INTERNAL_FLASH_FILESYSTEM
|
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
|
||||||
CFLAGS += -finline-limit=50
|
CFLAGS += -finline-limit=50
|
||||||
endif
|
endif
|
||||||
ifdef CFLAGS_INLINE_LIMIT
|
ifdef CFLAGS_INLINE_LIMIT
|
||||||
|
@ -4,7 +4,6 @@ USB_PID = 0xEDBE
|
|||||||
USB_PRODUCT = "SAM32"
|
USB_PRODUCT = "SAM32"
|
||||||
USB_MANUFACTURER = "maholli"
|
USB_MANUFACTURER = "maholli"
|
||||||
|
|
||||||
QSPI_FLASH_FILESYSTEM = 0
|
|
||||||
INTERNAL_FLASH_FILESYSTEM = 1
|
INTERNAL_FLASH_FILESYSTEM = 1
|
||||||
LONGINT_IMPL = MPZ
|
LONGINT_IMPL = MPZ
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
|
||||||
#include "shared-bindings/analogio/AnalogOut.h"
|
#include "shared-bindings/analogio/AnalogOut.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.h"
|
||||||
|
|
||||||
@ -138,5 +139,17 @@ void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void analogout_reset(void) {
|
void analogout_reset(void) {
|
||||||
// AudioOut resets the DAC in case its been used for audio which requires special handling.
|
// audioout_reset also resets the DAC, and does a smooth ramp down to avoid clicks
|
||||||
|
// if it was enabled, so do that instead if AudioOut is enabled.
|
||||||
|
#if CIRCUITPY_AUDIOIO
|
||||||
|
audioout_reset();
|
||||||
|
#else
|
||||||
|
#ifdef SAMD21
|
||||||
|
while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {}
|
||||||
|
#endif
|
||||||
|
#ifdef SAMD51
|
||||||
|
while (DAC->SYNCBUSY.reg & DAC_SYNCBUSY_SWRST) {}
|
||||||
|
#endif
|
||||||
|
DAC->CTRLA.reg |= DAC_CTRLA_SWRST;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -194,20 +194,23 @@ safe_mode_t port_init(void) {
|
|||||||
void reset_port(void) {
|
void reset_port(void) {
|
||||||
reset_sercoms();
|
reset_sercoms();
|
||||||
|
|
||||||
#if defined(EXPRESS_BOARD) && !defined(__SAMR21G18A__)
|
#if CIRCUITPY_AUDIOIO
|
||||||
audio_dma_reset();
|
audio_dma_reset();
|
||||||
audioout_reset();
|
audioout_reset();
|
||||||
#if !defined(__SAMD51G19A__) && !defined(__SAMD51G18A__)
|
#endif
|
||||||
|
#if CIRCUITPY_AUDIOBUSIO
|
||||||
i2sout_reset();
|
i2sout_reset();
|
||||||
#endif
|
|
||||||
//pdmin_reset();
|
//pdmin_reset();
|
||||||
#endif
|
#endif
|
||||||
#ifdef SAMD21
|
|
||||||
|
#if CIRCUITPY_TOUCHIO
|
||||||
touchin_reset();
|
touchin_reset();
|
||||||
#endif
|
#endif
|
||||||
eic_reset();
|
eic_reset();
|
||||||
|
#if CIRCUITPY_PULSEIO
|
||||||
pulseout_reset();
|
pulseout_reset();
|
||||||
pwmout_reset();
|
pwmout_reset();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CIRCUITPY_ANALOGIO
|
#if CIRCUITPY_ANALOGIO
|
||||||
analogin_reset();
|
analogin_reset();
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#define MICROPY_HW_LED_STATUS (&pin_P1_15)
|
#define MICROPY_HW_LED_STATUS (&pin_P1_15)
|
||||||
|
|
||||||
#ifdef QSPI_FLASH_FILESYSTEM
|
#if QSPI_FLASH_FILESYSTEM
|
||||||
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17)
|
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17)
|
||||||
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22)
|
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22)
|
||||||
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23)
|
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23)
|
||||||
@ -46,7 +46,7 @@
|
|||||||
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20)
|
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SPI_FLASH_FILESYSTEM
|
#if SPI_FLASH_FILESYSTEM
|
||||||
#define SPI_FLASH_MOSI_PIN &pin_P0_17
|
#define SPI_FLASH_MOSI_PIN &pin_P0_17
|
||||||
#define SPI_FLASH_MISO_PIN &pin_P0_22
|
#define SPI_FLASH_MISO_PIN &pin_P0_22
|
||||||
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#define MICROPY_HW_RGB_LED_GREEN (&pin_P0_14)
|
#define MICROPY_HW_RGB_LED_GREEN (&pin_P0_14)
|
||||||
#define MICROPY_HW_RGB_LED_BLUE (&pin_P0_15)
|
#define MICROPY_HW_RGB_LED_BLUE (&pin_P0_15)
|
||||||
|
|
||||||
#ifdef QSPI_FLASH_FILESYSTEM
|
#if QSPI_FLASH_FILESYSTEM
|
||||||
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
||||||
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
||||||
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
||||||
@ -48,7 +48,7 @@
|
|||||||
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SPI_FLASH_FILESYSTEM
|
#if SPI_FLASH_FILESYSTEM
|
||||||
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
||||||
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
||||||
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#define MICROPY_HW_RGB_LED_GREEN (&pin_P0_14)
|
#define MICROPY_HW_RGB_LED_GREEN (&pin_P0_14)
|
||||||
#define MICROPY_HW_RGB_LED_BLUE (&pin_P0_15)
|
#define MICROPY_HW_RGB_LED_BLUE (&pin_P0_15)
|
||||||
|
|
||||||
#ifdef QSPI_FLASH_FILESYSTEM
|
#if QSPI_FLASH_FILESYSTEM
|
||||||
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
||||||
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
||||||
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
||||||
@ -48,7 +48,7 @@
|
|||||||
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SPI_FLASH_FILESYSTEM
|
#if SPI_FLASH_FILESYSTEM
|
||||||
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
||||||
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
||||||
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#define MICROPY_HW_RGB_LED_GREEN (&pin_P0_14)
|
#define MICROPY_HW_RGB_LED_GREEN (&pin_P0_14)
|
||||||
#define MICROPY_HW_RGB_LED_BLUE (&pin_P0_15)
|
#define MICROPY_HW_RGB_LED_BLUE (&pin_P0_15)
|
||||||
|
|
||||||
#ifdef QSPI_FLASH_FILESYSTEM
|
#if QSPI_FLASH_FILESYSTEM
|
||||||
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
||||||
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
||||||
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
||||||
@ -48,7 +48,7 @@
|
|||||||
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SPI_FLASH_FILESYSTEM
|
#if SPI_FLASH_FILESYSTEM
|
||||||
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
||||||
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
||||||
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
// Quad mode: If all DATA0 --> DATA3 are valid
|
// Quad mode: If all DATA0 --> DATA3 are valid
|
||||||
// Dual mode: If DATA0 and DATA1 are valid while either DATA2 and/or DATA3 are invalid
|
// Dual mode: If DATA0 and DATA1 are valid while either DATA2 and/or DATA3 are invalid
|
||||||
// Single mode: If only DATA0 is valid
|
// Single mode: If only DATA0 is valid
|
||||||
#ifdef QSPI_FLASH_FILESYSTEM
|
#if QSPI_FLASH_FILESYSTEM
|
||||||
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
||||||
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
||||||
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
||||||
@ -58,7 +58,7 @@
|
|||||||
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SPI_FLASH_FILESYSTEM
|
#if SPI_FLASH_FILESYSTEM
|
||||||
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
||||||
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
||||||
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
// Quad mode: If all DATA0 --> DATA3 are valid
|
// Quad mode: If all DATA0 --> DATA3 are valid
|
||||||
// Dual mode: If DATA0 and DATA1 are valid while either DATA2 and/or DATA3 are invalid
|
// Dual mode: If DATA0 and DATA1 are valid while either DATA2 and/or DATA3 are invalid
|
||||||
// Single mode: If only DATA0 is valid
|
// Single mode: If only DATA0 is valid
|
||||||
/*#ifdef QSPI_FLASH_FILESYSTEM
|
/*#if QSPI_FLASH_FILESYSTEM
|
||||||
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
|
||||||
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
|
||||||
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
|
||||||
@ -58,7 +58,7 @@
|
|||||||
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SPI_FLASH_FILESYSTEM
|
#if SPI_FLASH_FILESYSTEM
|
||||||
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
#define SPI_FLASH_MOSI_PIN &pin_P0_20
|
||||||
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
#define SPI_FLASH_MISO_PIN &pin_P0_21
|
||||||
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
#define SPI_FLASH_SCK_PIN &pin_P0_19
|
||||||
|
@ -21,6 +21,4 @@ endif
|
|||||||
|
|
||||||
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
|
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
|
||||||
|
|
||||||
QSPI_FLASH_FILESYSTEM = 0
|
INTERNAL_FLASH_FILESYSTEM = 1
|
||||||
EXTERNAL_FLASH_DEVICE_COUNT = 0
|
|
||||||
EXTERNAL_FLASH_DEVICES =
|
|
||||||
|
@ -17,6 +17,17 @@ ifndef $(NO_USB)
|
|||||||
NO_USB = $(wildcard supervisor/usb.c)
|
NO_USB = $(wildcard supervisor/usb.c)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(INTERNAL_FLASH_FILESYSTEM),)
|
||||||
|
CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM)
|
||||||
|
endif
|
||||||
|
ifneq ($(QSPI_FLASH_FILESYSTEM),)
|
||||||
|
# EXPRESS_BOARD is obsolete and should be removed when samd-peripherals is updated.
|
||||||
|
CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM) -DEXPRESS_BOARD
|
||||||
|
endif
|
||||||
|
ifneq ($(SPI_FLASH_FILESYSTEM),)
|
||||||
|
# EXPRESS_BOARD is obsolete and should be removed when samd-peripherals is updated.
|
||||||
|
CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM) -DEXPRESS_BOARD
|
||||||
|
endif
|
||||||
|
|
||||||
# Choose which flash filesystem impl to use.
|
# Choose which flash filesystem impl to use.
|
||||||
# (Right now INTERNAL_FLASH_FILESYSTEM and SPI_FLASH_FILESYSTEM are mutually exclusive.
|
# (Right now INTERNAL_FLASH_FILESYSTEM and SPI_FLASH_FILESYSTEM are mutually exclusive.
|
||||||
@ -27,11 +38,10 @@ ifdef EXTERNAL_FLASH_DEVICES
|
|||||||
|
|
||||||
SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c
|
SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c
|
||||||
ifeq ($(SPI_FLASH_FILESYSTEM),1)
|
ifeq ($(SPI_FLASH_FILESYSTEM),1)
|
||||||
CFLAGS += -DSPI_FLASH_FILESYSTEM
|
|
||||||
SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c
|
SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c
|
||||||
|
else
|
||||||
endif
|
endif
|
||||||
ifeq ($(QSPI_FLASH_FILESYSTEM),1)
|
ifeq ($(QSPI_FLASH_FILESYSTEM),1)
|
||||||
CFLAGS += -DQSPI_FLASH_FILESYSTEM
|
|
||||||
SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c
|
SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user