Skip to content

Commit 5600b63

Browse files
committed
Improve version printing, distinguish betwen debug compilation & CATS_DEBUG flag
1 parent 282515f commit 5600b63

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

flight_computer/src/config/globals.hpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,23 @@ extern volatile recorder_status_e global_recorder_status;
5858

5959
extern event_action_map_elem_t* event_action_map;
6060

61-
#ifdef CATS_DEBUG
62-
inline constexpr const char* code_version = FIRMWARE_VERSION "-dev";
61+
// clang-format off
62+
// __PLATFORMIO_BUILD_DEBUG__ adds '-dbg', CATS_DEBUG adds '-dev'
63+
#ifdef __PLATFORMIO_BUILD_DEBUG__
64+
#ifdef CATS_DEBUG
65+
inline constexpr const char* code_version = FIRMWARE_VERSION "-dbg-dev";
66+
#else
67+
inline constexpr const char* code_version = FIRMWARE_VERSION "-dbg";
68+
#endif
6369
#else
64-
inline constexpr const char* code_version = FIRMWARE_VERSION;
70+
#ifdef CATS_DEBUG
71+
inline constexpr const char* code_version = FIRMWARE_VERSION "-dev";
72+
#else
73+
inline constexpr const char* code_version = FIRMWARE_VERSION;
74+
#endif
6575
#endif
76+
// clang-format on
77+
6678
inline constexpr const char* board_name = "CATS Vega";
6779
extern char telemetry_code_version[20];
6880

0 commit comments

Comments
 (0)