Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds watchdog support to the RTOS by integrating Zephyr’s watchdog APIs into the core OS and task modules, and updates board configurations to enable watchdog functionality.
- Updated NRtos::StartRtos() to set up the watchdog.
- Modified CTask class within c_task.cpp and c_task.h to install and feed the watchdog timer, as well as included proper watchdog header files.
- Updated defconfig and DTS files for multiple boards to enable and configure the watchdog device.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/f_core/os/n_rtos.cpp | Added watchdog initialization logic in StartRtos. |
| lib/f_core/os/c_task.cpp | Updated CTask constructor and Initialize/Run methods for watchdog integration. |
| include/f_core/os/c_task.h | Modified API and documentation to include watchdog configuration. |
| boards/arm/*/{sensor_module, radio_module, power_module, deployment_module} | Updated board configurations and device trees to enable watchdog support. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| const device* watchdogDev = nullptr; | ||
| #if DT_NODE_EXISTS(DT_ALIAS(watchdog)) | ||
| watchdogDev = DEVICE_DT_GET(DT_ALIAS(watchdog)); | ||
| #endif | ||
|
|
||
| // ReSharper disable once CppDFAConstantConditions | ||
| if (watchdogDev != nullptr) { |
There was a problem hiding this comment.
fix for resharper disable and #if s
rip 2 birds
| LOG_ERR("Watchdog already setup"); | ||
| k_oops(); | ||
| } else if (ret < 0) { | ||
| LOG_ERR("Failed to setup watchdog: %d", ret); |
There was a problem hiding this comment.
should this one be a WRN bc you continue despite it
There was a problem hiding this comment.
or should you k oops here as well
|
|
||
| std::vector<CRunnableTenant*> tenants; | ||
| wdt_timeout_cfg *wdtConfig = nullptr; | ||
| const device *watchdogDev = nullptr; |
There was a problem hiding this comment.
why does a task need to hold onto the watchdog dev, shouldnt it be done using it after Initialize ends
| LOG_INF("RTOS Started!"); | ||
| for (CTask* task : tasks) { | ||
| LOG_INF("Starting task %s", task->GetName()); | ||
| task->Initialize(); |
There was a problem hiding this comment.
so like, if wdg dev isnt passed in here, nothing actually happens. that seems important
Description
Write a summary of what you changed. It is helpful to have context on why you made this change!
Type of change
Checklist: