Skip to content

Commit e015f1b

Browse files
committed
Fix compilation: move breadcrumb definitions to config.h header
Moved WD_BREADCRUMB_* definitions from pressboi.cpp to config.h so they are visible to all source files including comms_controller.cpp. This fixes compilation errors: - WD_BREADCRUMB_USB_RECONNECT was not declared - WD_BREADCRUMB_USB_SEND was not declared - WD_BREADCRUMB_USB_RECOVERY was not declared
1 parent 09c8936 commit e015f1b

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

inc/config.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,24 @@
175175
#define WATCHDOG_ENABLED true ///< Enable/disable watchdog timer. When enabled, system must call safety check regularly or motors will be disabled.
176176
#define WATCHDOG_TIMEOUT_MS 100 ///< Watchdog timeout period in milliseconds. System will reset if not fed within this time.
177177
#define WATCHDOG_RECOVERY_FLAG 0xDEADBEEF ///< Magic number written to backup register to indicate watchdog recovery.
178+
179+
// Breadcrumb codes to identify where the watchdog timeout occurred
180+
#define WD_BREADCRUMB_SAFETY_CHECK 0x01 ///< Watchdog timeout in safety check
181+
#define WD_BREADCRUMB_COMMS_UPDATE 0x02 ///< Watchdog timeout in communications update
182+
#define WD_BREADCRUMB_RX_DEQUEUE 0x03 ///< Watchdog timeout in RX message dequeue
183+
#define WD_BREADCRUMB_UPDATE_STATE 0x04 ///< Watchdog timeout in state machine update
184+
#define WD_BREADCRUMB_FORCE_UPDATE 0x05 ///< Watchdog timeout in force sensor update
185+
#define WD_BREADCRUMB_MOTOR_UPDATE 0x06 ///< Watchdog timeout in motor update
186+
#define WD_BREADCRUMB_TELEMETRY 0x07 ///< Watchdog timeout in telemetry publishing
187+
#define WD_BREADCRUMB_UDP_PROCESS 0x08 ///< Watchdog timeout in UDP packet processing
188+
#define WD_BREADCRUMB_USB_PROCESS 0x09 ///< Watchdog timeout in USB serial processing
189+
#define WD_BREADCRUMB_TX_QUEUE 0x0A ///< Watchdog timeout in TX queue processing
190+
#define WD_BREADCRUMB_UDP_SEND 0x0B ///< Watchdog timeout in UDP packet send
191+
#define WD_BREADCRUMB_NETWORK_REFRESH 0x0C ///< Watchdog timeout in network packet refresh
192+
#define WD_BREADCRUMB_USB_SEND 0x0D ///< Watchdog timeout in USB send operation
193+
#define WD_BREADCRUMB_USB_RECONNECT 0x0E ///< Watchdog timeout in USB reconnection handling
194+
#define WD_BREADCRUMB_USB_RECOVERY 0x0F ///< Watchdog timeout in USB recovery operation
195+
#define WD_BREADCRUMB_UNKNOWN 0xFF ///< Watchdog timeout in unknown location
178196
/** @} */
179197
/** @} */
180198

src/pressboi.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,7 @@ TelemetryData g_telemetry;
3535
// Place in .noinit section so it survives reset but is cleared on power-up
3636
__attribute__((section(".noinit"))) volatile uint32_t g_watchdogRecoveryFlag;
3737
__attribute__((section(".noinit"))) volatile uint32_t g_watchdogBreadcrumb;
38-
39-
// Breadcrumb codes to identify where the watchdog timeout occurred
40-
#define WD_BREADCRUMB_SAFETY_CHECK 0x01
41-
#define WD_BREADCRUMB_COMMS_UPDATE 0x02
42-
#define WD_BREADCRUMB_RX_DEQUEUE 0x03
43-
#define WD_BREADCRUMB_UPDATE_STATE 0x04
44-
#define WD_BREADCRUMB_FORCE_UPDATE 0x05
45-
#define WD_BREADCRUMB_MOTOR_UPDATE 0x06
46-
#define WD_BREADCRUMB_TELEMETRY 0x07
47-
#define WD_BREADCRUMB_UDP_PROCESS 0x08
48-
#define WD_BREADCRUMB_USB_PROCESS 0x09
49-
#define WD_BREADCRUMB_TX_QUEUE 0x0A
50-
#define WD_BREADCRUMB_UDP_SEND 0x0B
51-
#define WD_BREADCRUMB_NETWORK_REFRESH 0x0C
52-
#define WD_BREADCRUMB_USB_SEND 0x0D
53-
#define WD_BREADCRUMB_USB_RECONNECT 0x0E
54-
#define WD_BREADCRUMB_USB_RECOVERY 0x0F
55-
#define WD_BREADCRUMB_UNKNOWN 0xFF
38+
// Breadcrumb codes are now defined in config.h
5639
#endif
5740

5841
//==================================================================================================

0 commit comments

Comments
 (0)