Skip to content

Commit f2ac84d

Browse files
authored
Rename CATS_DEBUG to CATS_DEV to avoid confusion with debug build (#373)
Closes #361
1 parent 06753d0 commit f2ac84d

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

flight_computer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
8080
else ()
8181
message(STATUS "Minimal optimization, debug info included")
8282
add_compile_options(-Og -g)
83-
#add_definitions(-DCATS_DEBUG)
83+
#add_definitions(-DCATS_DEV)
8484
endif ()
8585

8686
include_directories(

flight_computer/platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ build_flags =
6969
[env:release]
7070
build_flags =
7171
${env.build_flags}
72-
#-D CATS_DEBUG
72+
#-D CATS_DEV
7373

7474
[env:debug]
7575
build_type=debug
7676
debug_build_flags =
7777
-O0
7878
-ggdb3
7979
-g3
80-
-D CATS_DEBUG
80+
-D CATS_DEV

flight_computer/src/FreeRTOSConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ extern uint32_t SystemCoreClock;
7474
#define configGENERATE_RUN_TIME_STATS 0
7575
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
7676

77-
#ifdef CATS_DEBUG
77+
#ifdef CATS_DEV
7878
#define configCHECK_FOR_STACK_OVERFLOW 2
7979
#else
8080
#define configCHECK_FOR_STACK_OVERFLOW 0

flight_computer/src/cli/cli_commands.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "cli/cli_commands.hpp"
1010

11-
#ifdef CATS_DEBUG
11+
#ifdef CATS_DEV
1212
#include "tasks/task_simulator.hpp"
1313
#endif
1414

@@ -64,7 +64,7 @@ static void cli_cmd_flash_write(const char *cmd_name, char *args);
6464
static void cli_cmd_flash_stop(const char *cmd_name, char *args);
6565
static void cli_cmd_flash_test(const char *cmd_name, char *args);
6666

67-
#ifdef CATS_DEBUG
67+
#ifdef CATS_DEV
6868
static void cli_cmd_start_simulation(const char *cmd_name, char *args);
6969
#endif
7070

@@ -91,7 +91,7 @@ const clicmd_t cmd_table[] = {
9191
CLI_COMMAND_DEF("rm", "remove a file", "<file_name>", cli_cmd_rm),
9292
CLI_COMMAND_DEF("save", "save configuration", nullptr, cli_cmd_save),
9393
CLI_COMMAND_DEF("set", "change setting", "[<cmd_name>=<value>]", cli_cmd_set),
94-
#ifdef CATS_DEBUG
94+
#ifdef CATS_DEV
9595
CLI_COMMAND_DEF("sim", "start a simulation flight", "<sim_tag>", cli_cmd_start_simulation),
9696
#endif
9797
CLI_COMMAND_DEF("stats", "print flight stats", "<flight_number>", cli_cmd_print_stats),
@@ -412,7 +412,7 @@ static void cli_cmd_status(const char *cmd_name [[maybe_unused]], char *args [[m
412412
static_cast<double>(task::global_state_estimation->GetEstimationOutput().velocity),
413413
static_cast<double>(task::global_state_estimation->GetEstimationOutput().acceleration));
414414

415-
#ifdef CATS_DEBUG
415+
#ifdef CATS_DEV
416416
if (strcmp(args, "--heap") == 0) {
417417
HeapStats_t heap_stats = {};
418418
vPortGetHeapStats(&heap_stats);
@@ -851,7 +851,7 @@ static void cli_cmd_flash_test(const char *cmd_name [[maybe_unused]], char *args
851851
cli_print_line("Test complete!");
852852
}
853853

854-
#ifdef CATS_DEBUG
854+
#ifdef CATS_DEV
855855
static void cli_cmd_start_simulation(const char *cmd_name [[maybe_unused]], char *args) { start_simulation(args); }
856856
#endif
857857

flight_computer/src/config/globals.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ extern volatile recorder_status_e global_recorder_status;
4545
extern event_action_map_elem_t* event_action_map;
4646

4747
// clang-format off
48-
// __PLATFORMIO_BUILD_DEBUG__ adds '-dbg', CATS_DEBUG adds '-dev'
48+
// __PLATFORMIO_BUILD_DEBUG__ adds '-dbg', CATS_DEV adds '-dev'
4949
#ifdef __PLATFORMIO_BUILD_DEBUG__
50-
#ifdef CATS_DEBUG
50+
#ifdef CATS_DEV
5151
inline constexpr const char* code_version = FIRMWARE_VERSION "-dbg-dev";
5252
#else
5353
inline constexpr const char* code_version = FIRMWARE_VERSION "-dbg";
5454
#endif
5555
#else
56-
#ifdef CATS_DEBUG
56+
#ifdef CATS_DEV
5757
inline constexpr const char* code_version = FIRMWARE_VERSION "-dev";
5858
#else
5959
inline constexpr const char* code_version = FIRMWARE_VERSION;

flight_computer/src/util/debug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
constexpr uint16_t STACK_OVERFLOW_PRINT_BUF_SZ = 100;
1212

13-
#ifdef CATS_DEBUG
13+
#ifdef CATS_DEV
1414
/**
1515
* This function is called when a stack overflow is detected by FreeRTOS. The CATS implementation of this function just
1616
* prints the name of the task which generated the overflow via USB (if available) and blinks the red LED.

flight_computer/src/util/log.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "comm/stream_group.hpp"
99
#include "util/log.h"
1010

11-
#ifdef CATS_DEBUG
11+
#ifdef CATS_DEV
1212
#include "cmsis_os.h"
1313

1414
#define CATS_RAINBOW_LOG
@@ -30,12 +30,12 @@ static char print_buffer[PRINT_BUFFER_LEN];
3030
// NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables)
3131

3232
void log_set_mode(log_mode_e mode) {
33-
#ifdef CATS_DEBUG
33+
#ifdef CATS_DEV
3434
L.log_mode = mode;
3535
#endif
3636
}
3737
log_mode_e log_get_mode() {
38-
#ifdef CATS_DEBUG
38+
#ifdef CATS_DEV
3939
return L.log_mode;
4040
#else
4141
return LOG_MODE_NONE;
@@ -44,33 +44,33 @@ log_mode_e log_get_mode() {
4444

4545
// Only has impact on LOG_MODE_DEFAULT
4646
void log_set_level(int level) {
47-
#ifdef CATS_DEBUG
47+
#ifdef CATS_DEV
4848
L.level = level;
4949
#endif
5050
}
5151

5252
void log_enable() {
53-
#ifdef CATS_DEBUG
53+
#ifdef CATS_DEV
5454
L.log_mode = LOG_MODE_DEFAULT;
5555
#endif
5656
}
5757

5858
void log_disable() {
59-
#ifdef CATS_DEBUG
59+
#ifdef CATS_DEV
6060
L.log_mode = LOG_MODE_NONE;
6161
#endif
6262
}
6363

6464
bool log_is_enabled() {
65-
#ifdef CATS_DEBUG
65+
#ifdef CATS_DEV
6666
return L.log_mode == LOG_MODE_DEFAULT;
6767
#else
6868
return false;
6969
#endif
7070
}
7171

7272
void log_log(int level, const char *file, int line, const char *format, ...) {
73-
#ifdef CATS_DEBUG
73+
#ifdef CATS_DEV
7474
if ((L.log_mode == LOG_MODE_DEFAULT) && level >= L.level) {
7575
/* fill buffer with metadata */
7676
static char buf_ts[16];
@@ -96,7 +96,7 @@ void log_log(int level, const char *file, int line, const char *format, ...) {
9696
}
9797

9898
void log_raw(const char *format, ...) {
99-
#ifdef CATS_DEBUG
99+
#ifdef CATS_DEV
100100
va_list argptr;
101101
va_start(argptr, format);
102102
int len = vsnprintf(print_buffer, PRINT_BUFFER_LEN, format, argptr);
@@ -108,7 +108,7 @@ void log_raw(const char *format, ...) {
108108
}
109109

110110
void log_sim(const char *format, ...) {
111-
#ifdef CATS_DEBUG
111+
#ifdef CATS_DEV
112112
if (L.log_mode == LOG_MODE_SIM) {
113113
va_list argptr;
114114
va_start(argptr, format);
@@ -122,7 +122,7 @@ void log_sim(const char *format, ...) {
122122
}
123123

124124
void log_rawr(const char *format, ...) {
125-
#ifdef CATS_DEBUG
125+
#ifdef CATS_DEV
126126
va_list argptr;
127127
va_start(argptr, format);
128128
const int len = vsnprintf(print_buffer, PRINT_BUFFER_LEN, format, argptr);

flight_computer/src/util/log.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void log_rawr(const char *format, ...) __attribute__((format(printf, 1, 2)));
3838
}
3939
#endif
4040

41-
#ifdef CATS_DEBUG
41+
#ifdef CATS_DEV
4242

4343
#if defined(_WIN32)
4444
#define PATH_SEPARATOR '\\'

0 commit comments

Comments
 (0)