1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

Merge pull request #13593 from aabadie/pr/boards/pyocd_export_remove

boards/pyocd: cleanup use of `export` keyword
This commit is contained in:
Francisco 2020-03-10 15:19:34 +01:00 committed by GitHub
commit 6ba665858b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 6 deletions

View File

@ -10,7 +10,7 @@ ifeq (openocd,$(PROGRAMMER))
else ifeq (pyocd,$(PROGRAMMER))
# PyOCD doesn't recognize automatically the board ID, so target type has to
# be passed explicitly
export FLASH_TARGET_TYPE ?= -t nrf51
FLASH_TARGET_TYPE ?= -t nrf51
include $(RIOTMAKE)/tools/pyocd.inc.mk
endif

View File

@ -17,7 +17,7 @@ PROGRAMMER ?= pyocd
ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly
export FLASH_TARGET_TYPE ?= -t nrf52840
FLASH_TARGET_TYPE ?= -t nrf52840
include $(RIOTMAKE)/tools/pyocd.inc.mk
else ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER ?= dap

View File

@ -6,7 +6,7 @@ PROGRAMMER ?= pyocd
ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly
export FLASH_TARGET_TYPE ?= -t $(CPU)
FLASH_TARGET_TYPE ?= -t $(CPU)
include $(RIOTMAKE)/tools/pyocd.inc.mk
else ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER = dap

View File

@ -6,7 +6,7 @@ PROGRAMMER ?= pyocd
ifeq (pyocd,$(PROGRAMMER))
# The board is not recognized automatically by pyocd, so the CPU target
# option is passed explicitly
export FLASH_TARGET_TYPE ?= -t nrf52840
FLASH_TARGET_TYPE ?= -t nrf52840
include $(RIOTMAKE)/tools/pyocd.inc.mk
else ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER = dap

View File

@ -4,7 +4,7 @@ include $(RIOTMAKE)/tools/serial.inc.mk
# define pyocd as programmer to program with stlink
ifeq (pyocd,$(PROGRAMMER))
export FLASH_TARGET_TYPE ?= -t $(CPU)
FLASH_TARGET_TYPE ?= -t $(CPU)
include $(RIOTMAKE)/tools/pyocd.inc.mk
endif

View File

@ -84,6 +84,8 @@ UNEXPORTED_VARIABLES+=('USEMODULE_INCLUDES')
UNEXPORTED_VARIABLES+=('OPENOCD_ADAPTER_INIT')
UNEXPORTED_VARIABLES+=('OPENOCD_CONFIG')
UNEXPORTED_VARIABLES+=('OPENOCD_RESET_USE_CONNECT_ASSERT_SRST')
UNEXPORTED_VARIABLES+=('FLASH_TARGET_TYPE')
UNEXPORTED_VARIABLES+=('PYOCD_ADAPTER_INIT')
EXPORTED_VARIABLES_ONLY_IN_VARS=()
EXPORTED_VARIABLES_ONLY_IN_VARS+=('APPDEPS')

View File

@ -3,13 +3,22 @@ DEBUGGER = $(RIOTBASE)/dist/tools/pyocd/pyocd.sh
DEBUGSERVER = $(RIOTBASE)/dist/tools/pyocd/pyocd.sh
RESET ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh
FLASH_TARGET_TYPE ?=
FLASHFILE ?= $(HEXFILE)
FFLAGS ?= flash $(FLASHFILE)
DEBUGGER_FLAGS ?= debug $(ELFFILE)
DEBUGSERVER_FLAGS ?= debug-server
RESET_FLAGS ?= reset
PYOCD_TARGETS = debug% flash% reset
# Export FLASH_TARGET_TYPE to required targets only if not empty
ifneq (,$(FLASH_TARGET_TYPE))
$(call target-export-variables,$(PYOCD_TARGETS),FLASH_TARGET_TYPE)
endif
# Add serial matching command, only if DEBUG_ADAPTER_ID was specified
ifneq (,$(DEBUG_ADAPTER_ID))
export PYOCD_ADAPTER_INIT += -u $(DEBUG_ADAPTER_ID)
PYOCD_ADAPTER_INIT += -u $(DEBUG_ADAPTER_ID)
$(call target-export-variables,$(PYOCD_TARGETS),PYOCD_ADAPTER_INIT)
endif