Skip to content

Commit

Permalink
Rename DEBUG flag to DEBUG_BUILD
Browse files Browse the repository at this point in the history
The DEBUG flag is conflicting with the DEBUG() logging macro.
Luckily this has not caused any issues.
  • Loading branch information
pmattila committed Nov 30, 2023
1 parent a3d383e commit 5c9df9f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/cli/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion src/main/drivers/barometer/barometer_bmp388.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
2 changes: 1 addition & 1 deletion src/main/drivers/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void failureMode(failureMode_e mode)
{
indicateFailure(mode, 10);

#ifdef DEBUG
#ifdef DEBUG_BUILD
systemResetHard();
#else
systemReset(RESET_BOOTLOADER_REQUEST_ROM);
Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion src/main/target/common_pre.h
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down

0 comments on commit 5c9df9f

Please sign in to comment.