Watchdog

The hardware independent interface to enable internal hardware watchdogs.

Description

The hal_watchdog_init interface can be used to set a recurring watchdog timer to fire no sooner than in ‘expire_secs’ seconds.

int hal_watchdog_init(uint32_t expire_msecs);

Watchdog needs to be then started with a call to hal_watchdog_enable(). Watchdog should be tickled periodically with a frequency smaller than ‘expire_secs’ using hal_watchdog_tickle().

API

int hal_watchdog_init(uint32_t expire_msecs)

Set a recurring watchdog timer to fire no sooner than in ‘expire_secs’ seconds.

Watchdog should be tickled periodically with a frequency smaller than ‘expire_secs’. Watchdog needs to be then started with a call to :c:func:hal_watchdog_enable().

Return
< 0 on failure; on success return the actual expiration time as positive value
Parameters
  • expire_msecs: Watchdog timer expiration time in msecs

void hal_watchdog_enable(void)

Starts the watchdog.

void hal_watchdog_tickle(void)

Tickles the watchdog.

This needs to be done periodically, before the value configured in :c:func:hal_watchdog_init() expires.