diff --git a/Makefile b/Makefile index a6b6377c43..6aaaaaa1f0 100644 --- a/Makefile +++ b/Makefile @@ -144,7 +144,7 @@ ifeq ($(DEBUG),GDB) OPTIMISE_DEFAULT := -Og LTO_FLAGS := $(OPTIMISE_DEFAULT) -DEBUG_FLAGS = -ggdb3 -DDEBUG +DEBUG_FLAGS = -ggdb3 -DDEBUG_BUILD else ifeq ($(DEBUG),INFO) DEBUG_FLAGS = -ggdb3 diff --git a/src/main/cli/cli.c b/src/main/cli/cli.c index 77a74cd578..01678eb22d 100644 --- a/src/main/cli/cli.c +++ b/src/main/cli/cli.c @@ -842,7 +842,7 @@ STATIC_UNIT_TESTED void *cliGetValuePointer(const clivalue_t *value) static const char *dumpPgValue(const char *cmdName, const clivalue_t *value, dumpFlags_t dumpMask, const char *headingStr) { const pgRegistry_t *pg = pgFind(value->pgn); -#ifdef DEBUG +#ifdef DEBUG_BUILD if (!pg) { cliPrintLinef("VALUE %s ERROR", value->name); return headingStr; // if it's not found, the pgn shouldn't be in the value table! diff --git a/src/main/drivers/barometer/barometer_bmp388.c b/src/main/drivers/barometer/barometer_bmp388.c index df2ffb91f2..d18d57e32a 100644 --- a/src/main/drivers/barometer/barometer_bmp388.c +++ b/src/main/drivers/barometer/barometer_bmp388.c @@ -180,7 +180,7 @@ STATIC_UNIT_TESTED void bmp388Calculate(int32_t *pressure, int32_t *temperature) void bmp388_extiHandler(extiCallbackRec_t* cb) { -#ifdef DEBUG +#ifdef DEBUG_BUILD static uint32_t bmp388ExtiCallbackCounter = 0; bmp388ExtiCallbackCounter++; diff --git a/src/main/drivers/system.c b/src/main/drivers/system.c index 7703116a3e..5572f8a215 100644 --- a/src/main/drivers/system.c +++ b/src/main/drivers/system.c @@ -256,7 +256,7 @@ void failureMode(failureMode_e mode) { indicateFailure(mode, 10); -#ifdef DEBUG +#ifdef DEBUG_BUILD systemResetHard(); #else systemReset(RESET_BOOTLOADER_REQUEST_ROM); diff --git a/src/main/fc/init.c b/src/main/fc/init.c index 94313573e4..c13a3e1711 100644 --- a/src/main/fc/init.c +++ b/src/main/fc/init.c @@ -422,7 +422,7 @@ void init(void) delayMicroseconds(10); // allow configuration to settle // XXX Could be removed, too? // Allow EEPROM reset with two-button-press without power cycling in DEBUG build -#ifdef DEBUG +#ifdef DEBUG_BUILD #define EEPROM_RESET_PRECONDITION true #else #define EEPROM_RESET_PRECONDITION (!isMPUSoftReset()) diff --git a/src/main/target/common_pre.h b/src/main/target/common_pre.h index bc76ec1622..0c3679df1f 100644 --- a/src/main/target/common_pre.h +++ b/src/main/target/common_pre.h @@ -146,7 +146,7 @@ #define INIT_CODE __attribute__((optimize("-Os"))) #ifdef USE_ITCM_RAM -#if defined(ITCM_RAM_OPTIMISATION) && !defined(DEBUG) +#if defined(ITCM_RAM_OPTIMISATION) && !defined(DEBUG_BUILD) #define FAST_CODE __attribute__((section(".tcm_code"))) __attribute__((optimize(ITCM_RAM_OPTIMISATION))) #else #define FAST_CODE __attribute__((section(".tcm_code")))