PebbleOS
Loading...
Searching...
No Matches
Functions
Watchdog

Hardware watchdog and reset cause. More...

Functions

void watchdog_init (void)
 Configure the watchdog, without starting it.
 
void watchdog_start (void)
 Start the watchdog.
 
void watchdog_stop (void)
 Stop the watchdog.
 
void watchdog_feed (void)
 Restart the watchdog countdown.
 
bool watchdog_check_reset_flag (void)
 Check whether the last reset was caused by the watchdog.
 
McuRebootReason watchdog_clear_reset_flag (void)
 Read and clear the hardware reset cause.
 
McuRebootReason watchdog_get_reset_flag (void)
 Get the reset cause read by the last watchdog_clear_reset_flag().
 

Detailed Description

Hardware watchdog and reset cause.

Without CONFIG_WATCHDOG, all functions are no-ops and no reset cause is reported.

// periodically
void watchdog_start(void)
Start the watchdog.
void watchdog_init(void)
Configure the watchdog, without starting it.
void watchdog_feed(void)
Restart the watchdog countdown.

Function Documentation

◆ watchdog_check_reset_flag()

bool watchdog_check_reset_flag ( void  )

Check whether the last reset was caused by the watchdog.

Returns
true after a watchdog reset.

◆ watchdog_clear_reset_flag()

McuRebootReason watchdog_clear_reset_flag ( void  )

Read and clear the hardware reset cause.

Returns
Reset cause, also cached for watchdog_get_reset_flag().

◆ watchdog_feed()

void watchdog_feed ( void  )

Restart the watchdog countdown.

◆ watchdog_get_reset_flag()

McuRebootReason watchdog_get_reset_flag ( void  )

Get the reset cause read by the last watchdog_clear_reset_flag().

Returns
Cached reset cause.

◆ watchdog_init()

void watchdog_init ( void  )

Configure the watchdog, without starting it.

◆ watchdog_start()

void watchdog_start ( void  )

Start the watchdog.

◆ watchdog_stop()

void watchdog_stop ( void  )

Stop the watchdog.