File tree Expand file tree Collapse file tree 20 files changed +63
-142
lines changed
Expand file tree Collapse file tree 20 files changed +63
-142
lines changed Original file line number Diff line number Diff line change 7070[submodule "ports/atmel-samd/peripherals "]
7171 path = ports/atmel-samd/peripherals
7272 url = https://github.com/adafruit/samd-peripherals.git
73+ [submodule "ports/nrf/nrfx "]
74+ path = ports/nrf/nrfx
75+ url = https://github.com/NordicSemiconductor/nrfx.git
Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ FATFS_DIR = lib/oofatfs
4242
4343CROSS_COMPILE = arm-none-eabi-
4444
45- MCU_VARIANT_UPPER = $(shell echo $(MCU_VARIANT ) | tr '[:lower:]' '[:upper:]')
46-
4745INC += -I.
4846INC += -I../..
4947INC += -I$(BUILD )
@@ -63,7 +61,6 @@ INC += -I../../lib/mp-readline
6361INC += -I./drivers/bluetooth
6462INC += -I./drivers
6563
66- NRF_DEFINES += -D$(MCU_VARIANT_UPPER )
6764NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET
6865
6966CFLAGS += -mthumb -mabi=aapcs -fsingle-precision-constant -Wdouble-promotion
@@ -73,6 +70,7 @@ CFLAGS += -fno-strict-aliasing
7370CFLAGS += -fstack-usage
7471CFLAGS += -fdata-sections -ffunction-sections
7572CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT ) _hal.h>'
73+ CFLAGS += -D__START=main
7674
7775LDFLAGS = $(CFLAGS )
7876LDFLAGS += -Xlinker -Map=$(@:.elf=.map )
@@ -125,7 +123,7 @@ SRC_C += \
125123 drivers/bluetooth/ble_drv.c \
126124 drivers/bluetooth/ble_uart.c \
127125 boards/$(BOARD ) /board.c \
128- device/ $( MCU_VARIANT ) /system_$(MCU_SUB_VARIANT ) .c \
126+ nrfx/mdk /system_$(MCU_SUB_VARIANT ) .c \
129127 device/$(MCU_VARIANT ) /startup_$(MCU_SUB_VARIANT ) .c \
130128 lib/oofatfs/ff.c \
131129 lib/oofatfs/option/ccsbcs.c \
Original file line number Diff line number Diff line change 11MCU_SERIES = m4
22MCU_VARIANT = nrf52
3- MCU_SUB_VARIANT = nrf52832
3+ MCU_SUB_VARIANT = nrf52
44SOFTDEV_VERSION ?= 2.0.1
55
66LD_FILE = boards/feather52832/custom_nrf52832_dfu_app_$(SOFTDEV_VERSION ) .ld
Original file line number Diff line number Diff line change 11MCU_SERIES = m4
22MCU_VARIANT = nrf52
3- MCU_SUB_VARIANT = nrf52832
3+ MCU_SUB_VARIANT = nrf52
44LD_FILE = boards/nrf52832_512k_64k.ld
55
66NRF_DEFINES += -DNRF52832_XXAA
Original file line number Diff line number Diff line change 11MCU_SERIES = m4
22MCU_VARIANT = nrf52
3- MCU_SUB_VARIANT = nrf52832
3+ MCU_SUB_VARIANT = nrf52
44SOFTDEV_VERSION = 5.0.0
55
66LD_FILE = boards/nrf52832_512k_64k_s132_$(SOFTDEV_VERSION ) .ld
File renamed without changes.
Original file line number Diff line number Diff line change 3030#include <string.h>
3131#include <stdbool.h>
3232
33+ #define NRF52 // Needed for SD132 v2
34+
3335#include "py/runtime.h"
3436#include "ble_drv.h"
3537#include "mpconfigport.h"
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ void GPIOTE_IRQHandler(void) {
9494 GPIOTE_BASE -> EVENTS_IN [3 ] = 0 ;
9595 m_callback (HAL_GPIO_EVENT_CHANNEL_3 );
9696 }
97- #if NRF52
97+
9898 if (GPIOTE_BASE -> EVENTS_IN [4 ]) {
9999 GPIOTE_BASE -> EVENTS_IN [4 ] = 0 ;
100100 m_callback (HAL_GPIO_EVENT_CHANNEL_4 );
@@ -111,7 +111,6 @@ void GPIOTE_IRQHandler(void) {
111111 GPIOTE_BASE -> EVENTS_IN [7 ] = 0 ;
112112 m_callback (HAL_GPIO_EVENT_CHANNEL_7 );
113113 }
114- #endif
115114}
116115
117116#endif // if 0
Original file line number Diff line number Diff line change 2929
3030#include "nrf.h"
3131
32- #if NRF51
33- #define POINTERS (const uint32_t[]){NRF_GPIO_BASE }
32+ #ifdef NRF52832_XXAA
33+ #define POINTERS (const uint32_t[]){NRF_P0_BASE }
3434#endif
3535
36- #if NRF52
37- #ifdef NRF52832_XXAA
38- #define POINTERS (const uint32_t[]){NRF_P0_BASE}
39- #endif
40-
41- #ifdef NRF52840_XXAA
42- #define POINTERS (const uint32_t[]){NRF_P0_BASE, NRF_P1_BASE}
43- #endif
36+ #ifdef NRF52840_XXAA
37+ #define POINTERS (const uint32_t[]){NRF_P0_BASE, NRF_P1_BASE}
4438#endif
4539
4640#define GPIO_BASE (x ) ((NRF_GPIO_Type *)POINTERS[x])
@@ -133,12 +127,10 @@ typedef enum {
133127 HAL_GPIO_EVENT_CHANNEL_1 ,
134128 HAL_GPIO_EVENT_CHANNEL_2 ,
135129 HAL_GPIO_EVENT_CHANNEL_3 ,
136- #if NRF52
137130 HAL_GPIO_EVENT_CHANNEL_4 ,
138131 HAL_GPIO_EVENT_CHANNEL_5 ,
139132 HAL_GPIO_EVENT_CHANNEL_6 ,
140133 HAL_GPIO_EVENT_CHANNEL_7
141- #endif
142134} hal_gpio_event_channel_t ;
143135
144136typedef struct {
Original file line number Diff line number Diff line change 3737
3838#define BLUETOOTH_STACK_ENABLED () (ble_drv_stack_enabled())
3939
40- #ifdef NRF51
41- #include "nrf_soc.h"
42- #elif defined(NRF52 )
43- #include "nrf_nvic.h"
44- #endif
40+ #define NRF52
41+ #include "nrf_nvic.h"
4542#endif // BLUETOOTH_SD
4643
4744static inline void hal_irq_clear (uint32_t irq_num ) {
You can’t perform that action at this time.
0 commit comments