Skip to content

Commit 791d4e3

Browse files
committed
buildsystem: Always expose CPU_RAM_BASE & SIZE flags
1 parent 1bed7dd commit 791d4e3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

makefiles/cflags.inc.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,7 @@ CFLAGS += $(filter-out $(OPTIONAL_CFLAGS_BLACKLIST),$(OPTIONAL_CFLAGS))
119119
# accept good C practises within `extern "C" { ... }` while enforcing good C++
120120
# practises elsewhere. But in absence of this, we disable the warning for now.
121121
CXXEXFLAGS += -Wno-missing-field-initializers
122+
123+
# Reformat the RAM region for usage within code and expose them
124+
CFLAGS += -DCPU_RAM_BASE=$(RAM_START_ADDR)
125+
CFLAGS += -DCPU_RAM_SIZE=$(shell printf "0x%x" $$(($(RAM_LEN:%K=%*1024))))

sys/Makefile.include

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ ifneq (,$(filter prng,$(USEMODULE)))
163163
include $(RIOTBASE)/sys/random/Makefile.include
164164
endif
165165

166-
ifneq (,$(filter tinyusb_dfu usbus_dfu riotboot_reset,$(USEMODULE)))
167-
CFLAGS += -DCPU_RAM_BASE=$(RAM_START_ADDR)
168-
CFLAGS += -DCPU_RAM_SIZE=$(shell printf "0x%x" $$(($(RAM_LEN:%K=%*1024))))
169-
endif
170-
171166
ifneq (,$(filter test_utils_netdev_eth_minimal,$(USEMODULE)))
172167
CFLAGS += -DCONFIG_NETDEV_REGISTER_SIGNAL
173168
endif

0 commit comments

Comments
 (0)