diff --git a/src/startup.cpp b/src/startup.cpp index 73a5b21..8556665 100644 --- a/src/startup.cpp +++ b/src/startup.cpp @@ -28,6 +28,7 @@ // Tacos-specific includes. #include #include +#include // The UART mutex defined in freertos.c @@ -72,8 +73,6 @@ namespace sta UARTSettings settings = { .mode = UARTMode::RX_TX }; STM32UART * intf_ptr = new STM32UART(getUARThandle(), settings, mutex); Debug = new PrintableUART(intf_ptr); - - STA_DEBUG_PRINTLN("UART SUCCESSFULLY INITIALIZED"); } } #endif // STA_DEBUGGING_ENABLED @@ -113,6 +112,19 @@ namespace sta Manager::instance()->start(); } + +#ifdef STA_TACOS_WATCHDOG_ENABLED + STA_WEAK + void onWatchdogInit() + {} + + void initWatchdog() + { + onWatchdogInit(); + + Watchdog::instance()->start(); + } +#endif // STA_TACOS_WATCHDOG_ENABLED } // namespace tacos @@ -128,6 +140,10 @@ namespace sta tacos::initStatemachine(); tacos::initManager(); + +#ifdef STA_TACOS_WATCHDOG_ENABLED + tacos::initWatchdog(); +#endif // STA_TACOS_WATCHDOG_ENABLED } } // namespace rtos } // namespace sta diff --git a/src/watchdog.cpp b/src/watchdog.cpp index 63ff4fe..f82fa89 100644 --- a/src/watchdog.cpp +++ b/src/watchdog.cpp @@ -32,9 +32,7 @@ namespace sta Watchdog::Watchdog() : TacosThread{"Watchdog", STA_TACOS_WATCHDOG_PRIORITY} - { - - } + {} Watchdog* Watchdog::_instance = nullptr; } // namespace tacos