summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
Diffstat (limited to 'ports')
-rw-r--r--ports/atmel-samd/mpconfigport.mk3
-rwxr-xr-xports/nrf/Makefile17
-rw-r--r--ports/nrf/common-hal/busio/SPI.c16
-rw-r--r--ports/nrf/common-hal/microcontroller/Pin.c1
-rw-r--r--ports/nrf/supervisor/qspi_flash.c2
5 files changed, 31 insertions, 8 deletions
diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk
index e4cf9ca83..5788a160b 100644
--- a/ports/atmel-samd/mpconfigport.mk
+++ b/ports/atmel-samd/mpconfigport.mk
@@ -39,6 +39,9 @@ endif
CIRCUITPY_SDCARDIO ?= 0
+# Not enough RAM for framebuffers
+CIRCUITPY_FRAMEBUFFERIO ?= 0
+
# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic.
USB_MSC_EP_NUM_OUT = 1
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index 13a148df3..3fef68e88 100755
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -73,11 +73,11 @@ INC += -I$(BUILD)
INC += -I$(BUILD)/genhdr
INC += -I./../../lib/cmsis/inc
INC += -I./boards/$(BOARD)
-INC += -I./nrfx
-INC += -I./nrfx/hal
-INC += -I./nrfx/mdk
-INC += -I./nrfx/drivers/include
-INC += -I./nrfx/drivers/src
+INC += -isystem ./nrfx
+INC += -isystem ./nrfx/hal
+INC += -isystem ./nrfx/mdk
+INC += -isystem ./nrfx/drivers/include
+INC += -isystem ./nrfx/drivers/src
INC += -I./bluetooth
INC += -I./peripherals
INC += -I../../lib/mp-readline
@@ -100,8 +100,6 @@ CFLAGS += $(OPTIMIZATION_FLAGS)
CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)
# Undo some warnings.
-# nrfx uses undefined preprocessor variables quite casually, so we can't do warning checks for these.
-CFLAGS += -Wno-undef
# nrfx does casts that increase alignment requirements.
CFLAGS += -Wno-cast-align
@@ -240,6 +238,11 @@ endif
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
+# nrfx uses undefined preprocessor variables quite casually, so we can't do
+# warning checks for these. Happily, we've confined the offenders to the NRFX
+# source files themselves.
+$(addprefix $(BUILD)/, $(SRC_NRFX:.c=.o)): CFLAGS += -Wno-undef
+
$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os
$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os
diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c
index f27f0e267..fdfe61811 100644
--- a/ports/nrf/common-hal/busio/SPI.c
+++ b/ports/nrf/common-hal/busio/SPI.c
@@ -34,6 +34,22 @@
#include "nrfx_spim.h"
#include "nrf_gpio.h"
+#ifndef NRFX_SPIM3_ENABLED
+#define NRFX_SPIM3_ENABLED (0)
+#endif
+
+#ifndef NRFX_SPIM2_ENABLED
+#define NRFX_SPIM2_ENABLED (0)
+#endif
+
+#ifndef NRFX_SPIM1_ENABLED
+#define NRFX_SPIM1_ENABLED (0)
+#endif
+
+#ifndef NRFX_SPIM0_ENABLED
+#define NRFX_SPIM0_ENABLED (0)
+#endif
+
// These are in order from highest available frequency to lowest (32MHz first, then 8MHz).
STATIC spim_peripheral_t spim_peripherals[] = {
#if NRFX_CHECK(NRFX_SPIM3_ENABLED)
diff --git a/ports/nrf/common-hal/microcontroller/Pin.c b/ports/nrf/common-hal/microcontroller/Pin.c
index 3132c7631..d294c1dd5 100644
--- a/ports/nrf/common-hal/microcontroller/Pin.c
+++ b/ports/nrf/common-hal/microcontroller/Pin.c
@@ -93,6 +93,7 @@ void reset_pin_number(uint8_t pin_number) {
// Clear claimed bit.
claimed_pins[nrf_pin_port(pin_number)] &= ~(1 << nrf_relative_pin_number(pin_number));
+ never_reset_pins[nrf_pin_port(pin_number)] &= ~(1 << nrf_relative_pin_number(pin_number));
#ifdef MICROPY_HW_NEOPIXEL
if (pin_number == MICROPY_HW_NEOPIXEL->number) {
diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c
index 5ab56c6bc..7ca27d56c 100644
--- a/ports/nrf/supervisor/qspi_flash.c
+++ b/ports/nrf/supervisor/qspi_flash.c
@@ -201,7 +201,7 @@ void spi_flash_init(void) {
.irq_priority = 7,
};
-#if EXTERNAL_FLASH_QSPI_DUAL
+#if defined(EXTERNAL_FLASH_QSPI_DUAL)
qspi_cfg.pins.io1_pin = MICROPY_QSPI_DATA1;
qspi_cfg.prot_if.readoc = NRF_QSPI_READOC_READ2O;
qspi_cfg.prot_if.writeoc = NRF_QSPI_WRITEOC_PP2O;