Skip to content

Commit

Permalink
NULL callback for main MCU watchdog
Browse files Browse the repository at this point in the history
Remove application watchdog stubs and pass in NULL CB
  • Loading branch information
sri9311 committed Oct 21, 2024
1 parent 22301c0 commit 465bc17
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 41 deletions.
9 changes: 3 additions & 6 deletions lib/watchdog/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ static void
watchdog_thread()
{
while (wdt_channel_id >= 0) {
// Allow null callback
if (watchdog_callback == NULL) {
// Allow null callback,
// Don't rearrange due to short circuit rules, NULL check must be first
if ((watchdog_callback == NULL) || (watchdog_callback() == true)) {
wdt_feed(watchdog_dev, wdt_channel_id);
} else {
if (watchdog_callback() == true) {
wdt_feed(watchdog_dev, wdt_channel_id);
}
}
k_sleep(K_MSEC(WATCHDOG_RELOAD_MS));
}
Expand Down
1 change: 0 additions & 1 deletion main_board/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ list(APPEND SOURCES_FILES
src/system/logs.c
src/system/version/version.c
src/system/stm32_timer_utils/stm32_timer_utils.c
src/system/app_watchdog.c

src/temperature/sensors/temperature.c
src/temperature/fan/fan.c
Expand Down
3 changes: 1 addition & 2 deletions main_board/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "power/boot/boot.h"
#include "pubsub/pubsub.h"
#include "runner/runner.h"
#include "system/app_watchdog.h"
#include "system/diag.h"
#include "system/version/version.h"
#include "temperature/fan/fan.h"
Expand Down Expand Up @@ -203,7 +202,7 @@ initialize(void)
app_assert_init(app_assert_cb);

#if CONFIG_ORB_LIB_WATCHDOG
err_code = watchdog_init(app_watchdog_callback);
err_code = watchdog_init(NULL);
ASSERT_SOFT(err_code);
#endif

Expand Down
23 changes: 0 additions & 23 deletions main_board/src/system/app_watchdog.c

This file was deleted.

9 changes: 0 additions & 9 deletions main_board/src/system/app_watchdog.h

This file was deleted.

0 comments on commit 465bc17

Please sign in to comment.