Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/updatehub/include/updatehub.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ enum updatehub_response updatehub_probe(void);
*/
enum updatehub_response updatehub_update(void);

#if defined(CONFIG_WATCHDOG)
/**
* @brief Kick the watchdog
*
* @details This function, if implemented elsewhere in the firmware, is
* called whenever a valid packet has been received and written into flash.
* This can be used to kick a watchdog during firmware download.
*/
__weak void updatehub_watchdog_kick(void);
#endif

/**
* @}
*/
Expand Down
7 changes: 7 additions & 0 deletions lib/updatehub/updatehub.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ static void install_update_cb(void)
}

ctx.code_status = UPDATEHUB_OK;
#if defined(CONFIG_WATCHDOG)
updatehub_watchdog_kick();
#endif

cleanup:
k_free(data);
Expand Down Expand Up @@ -870,3 +873,7 @@ void updatehub_autohandler(void)
k_delayed_work_init(&updatehub_work_handle, autohandler);
k_delayed_work_submit(&updatehub_work_handle, K_NO_WAIT);
}

void updatehub_watchdog_kick(void)
{
}