move softdevice (SD) specific code from the main Makefile to their respective board/SD makefiles

This commit is contained in:
Daniel Tralamazza 2016-11-16 23:39:40 +01:00
parent ae99d95c1a
commit 3e31d31f3e
15 changed files with 111 additions and 52 deletions

View File

@ -81,7 +81,7 @@ SRC_LIB = $(addprefix lib/,\
utils/pyhelp.c \
)
SRC_C = \
SRC_C += \
main.c \
device/$(MCU_VARIANT_LOWER)/system_$(MCU_VARIANT_LOWER).c \
modpyb.c \
@ -91,54 +91,6 @@ SRC_C = \
help.c \
gccollect.c \
ifeq ($(NRF_SOFTDEVICE),NRF_S1XX_SOFTDEVICE)
SRC_C += \
hal/hal_uarte.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s1xx/headers
CFLAGS += -I./softdevice/s1xx/headers/nrf52
CFLAGS += -DBLUETOOTH_SD=100
CFLAGS += -DBLUETOOTH_SD_DEBUG=1
else ifeq ($(NRF_SOFTDEVICE),NRF_S132_SOFTDEVICE)
SRC_C += \
hal/hal_uarte.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s132/headers
CFLAGS += -I./softdevice/s132/headers/nrf52
CFLAGS += -DBLUETOOTH_SD=132
CFLAGS += -DBLUETOOTH_SD_DEBUG=1
else ifeq ($(NRF_SOFTDEVICE),NRF_S110_SOFTDEVICE)
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s110/headers
CFLAGS += -DBLUETOOTH_SD=110
CFLAGS += -DBLUETOOTH_SD_DEBUG=1
else ifeq ($(NRF_SOFTDEVICE),NRF_S130_SOFTDEVICE)
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s130/headers
CFLAGS += -DBLUETOOTH_SD=130
CFLAGS += -DBLUETOOTH_SD_DEBUG=1
else
SRC_C += \
hal/hal_uart.c
endif
SRC_S = \
device/$(MCU_VARIANT_LOWER)/startup_$(MCU_VARIANT_LOWER).s \
@ -146,7 +98,6 @@ OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_LIB:.c=.o))
.phony: all flash
all: $(BUILD)/firmware.elf binary hex

View File

@ -1,3 +1,6 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_aa.ld
SRC_C += \
hal/hal_uart.c

View File

@ -2,3 +2,13 @@ MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_aa_s110.ld
NRF_SOFTDEVICE = NRF_S110_SOFTDEVICE
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s110/headers
CFLAGS += -DBLUETOOTH_SD=110
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

View File

@ -1,3 +1,6 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_aa.ld
SRC_C += \
hal/hal_uart.c

View File

@ -1,3 +1,6 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_ac.ld
SRC_C += \
hal/hal_uart.c

View File

@ -2,3 +2,14 @@ MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_ac_s110.ld
NRF_SOFTDEVICE = NRF_S110_SOFTDEVICE
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s110/headers
CFLAGS += -DBLUETOOTH_SD=110
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

View File

@ -2,3 +2,13 @@ MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_ac_s120.ld
NRF_SOFTDEVICE = NRF_S120_SOFTDEVICE
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s120/headers
CFLAGS += -DBLUETOOTH_SD=120
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

View File

@ -2,3 +2,13 @@ MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_ac_s130.ld
NRF_SOFTDEVICE = NRF_S130_SOFTDEVICE
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s130/headers
CFLAGS += -DBLUETOOTH_SD=130
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

View File

@ -1,3 +1,6 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_ac.ld
SRC_C += \
hal/hal_uart.c

View File

@ -2,3 +2,13 @@ MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_ac_s110.ld
NRF_SOFTDEVICE = NRF_S110_SOFTDEVICE
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s110/headers
CFLAGS += -DBLUETOOTH_SD=110
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

View File

@ -2,3 +2,13 @@ MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_ac_s120.ld
NRF_SOFTDEVICE = NRF_S120_SOFTDEVICE
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s120/headers
CFLAGS += -DBLUETOOTH_SD=120
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

View File

@ -2,3 +2,13 @@ MCU_SERIES = m0
MCU_VARIANT = NRF51
LD_FILE = boards/nrf51822_ac_s130.ld
NRF_SOFTDEVICE = NRF_S130_SOFTDEVICE
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s130/headers
CFLAGS += -DBLUETOOTH_SD=130
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

View File

@ -1,3 +1,6 @@
MCU_SERIES = m4
MCU_VARIANT = NRF52
LD_FILE = boards/nrf52832_aa.ld
SRC_C += \
hal/hal_uart.c

View File

@ -2,3 +2,14 @@ MCU_SERIES = m4
MCU_VARIANT = NRF52
LD_FILE = boards/nrf52832_aa_s132.ld
NRF_SOFTDEVICE = NRF_S132_SOFTDEVICE
SRC_C += \
hal/hal_uarte.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s132/headers
CFLAGS += -I./softdevice/s132/headers/nrf52
CFLAGS += -DBLUETOOTH_SD=132
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

View File

@ -2,3 +2,14 @@ MCU_SERIES = m4
MCU_VARIANT = NRF52
LD_FILE = boards/nrf52832_aa_s1xx.ld
NRF_SOFTDEVICE = NRF_S1XX_SOFTDEVICE
SRC_C += \
hal/hal_uarte.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s1xx/headers
CFLAGS += -I./softdevice/s1xx/headers/nrf52
CFLAGS += -DBLUETOOTH_SD=100
CFLAGS += -DBLUETOOTH_SD_DEBUG=1