Skip to content

File syn_hwwdt.h

FileList > src > syntropic > system > syn_hwwdt.h

Go to the source code of this file

Hardware Watchdog Timer driver. More...

  • #include "../common/syn_defs.h"
  • #include <stdint.h>

Public Functions

Type Name
void syn_hwwdt_feed (void)
Feed (reload) the hardware watchdog counter.
SYN_Status syn_hwwdt_init (uint32_t timeout_ms)
Start the hardware watchdog with the given timeout.

Detailed Description

Wraps syn_port_wdt.h with a minimal driver interface. The hardware watchdog runs independently of the CPU and will reset the system if syn_hwwdt_feed() is not called within the configured timeout — even if the CPU is hard-locked.

Complementary to syn_watchdog.h (software task-stall detector).

Usage:

syn_hwwdt_init(2000);     // 2-second hardware timeout
// In main loop or scheduler tick:
syn_hwwdt_feed();

Public Functions Documentation

function syn_hwwdt_feed

Feed (reload) the hardware watchdog counter.

void syn_hwwdt_feed (
    void
) 

Call this function from your main loop or scheduler idle hook to prevent the hardware from resetting the system.


function syn_hwwdt_init

Start the hardware watchdog with the given timeout.

SYN_Status syn_hwwdt_init (
    uint32_t timeout_ms
) 

On most MCUs the watchdog cannot be disabled once started. syn_hwwdt_feed() must be called more frequently than timeout_ms.

Parameters:

  • timeout_ms Desired timeout in milliseconds.

Returns:

SYN_OK on success, SYN_ERROR if the hardware WDT cannot be started.



The documentation for this class was generated from the following file src/syntropic/system/syn_hwwdt.h