From 791d4e3a4d14765e7e709032f4690d952ea3be3c Mon Sep 17 00:00:00 2001 From: Teufelchen1 Date: Tue, 20 Jun 2023 12:16:06 +0200 Subject: [PATCH] buildsystem: Always expose CPU_RAM_BASE & SIZE flags --- makefiles/cflags.inc.mk | 4 ++++ sys/Makefile.include | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/makefiles/cflags.inc.mk b/makefiles/cflags.inc.mk index acb53cf5a6..00c5eb0778 100644 --- a/makefiles/cflags.inc.mk +++ b/makefiles/cflags.inc.mk @@ -119,3 +119,7 @@ CFLAGS += $(filter-out $(OPTIONAL_CFLAGS_BLACKLIST),$(OPTIONAL_CFLAGS)) # accept good C practises within `extern "C" { ... }` while enforcing good C++ # practises elsewhere. But in absence of this, we disable the warning for now. CXXEXFLAGS += -Wno-missing-field-initializers + +# Reformat the RAM region for usage within code and expose them +CFLAGS += -DCPU_RAM_BASE=$(RAM_START_ADDR) +CFLAGS += -DCPU_RAM_SIZE=$(shell printf "0x%x" $$(($(RAM_LEN:%K=%*1024)))) diff --git a/sys/Makefile.include b/sys/Makefile.include index 44334591ed..b1ba246995 100644 --- a/sys/Makefile.include +++ b/sys/Makefile.include @@ -163,11 +163,6 @@ ifneq (,$(filter prng,$(USEMODULE))) include $(RIOTBASE)/sys/random/Makefile.include endif -ifneq (,$(filter tinyusb_dfu usbus_dfu riotboot_reset,$(USEMODULE))) - CFLAGS += -DCPU_RAM_BASE=$(RAM_START_ADDR) - CFLAGS += -DCPU_RAM_SIZE=$(shell printf "0x%x" $$(($(RAM_LEN:%K=%*1024)))) -endif - ifneq (,$(filter test_utils_netdev_eth_minimal,$(USEMODULE))) CFLAGS += -DCONFIG_NETDEV_REGISTER_SIGNAL endif