ether2ser 0.1.0
Ethernet <-> synchronous V.24 bridge firmware for RP2040 + W5500
Loading...
Searching...
No Matches
watchdog.c
Go to the documentation of this file.
1/*
2 * ether2ser — Ethernet <-> synchronous V.24 (RS-232/V.28) bridge
3 *
4 * File: src/platform/watchdog.c
5 * Purpose: ALl watchdog interactions
6 *
7 * SPDX-License-Identifier: Apache-2.0
8 *
9 * Copyright (c) 2026 Florian <f.leuze@outlook.de>
10 */
11
12// Related headers
13#include "watchdog.h"
14
15// Standard library headers
16#include <stdbool.h>
17#include <stddef.h>
18#include <stdint.h>
19
20// Library Headers
21#include "hardware/watchdog.h"
22#include "wizchip_conf.h"
23#include "wizchip_qspi_pio.h"
24
25// Project Headers
26#include "system/common.h"
27// Generated headers
28void reboot(void)
29{
30 LOG_PLAIN("Rebooting...\r\n");
31 watchdog_reboot(0, 0, FLUSH_LOG_BEFORE_REBOOT_MS); // small delay to let LOG_PLAIN flush
32 // Do not return to the main loop; it calls watchdog_update() and would
33 // keep postponing the reboot forever.
34 while (true)
35 {
36 // wait for watchdog reset
37 }
38}
#define LOG_PLAIN(...)
Definition common.h:162
#define FLUSH_LOG_BEFORE_REBOOT_MS
Time to wait before rebooting to allow the logs to flush.
Definition common.h:57
void reboot(void)
Reboots by resetting the watchdog.
Definition watchdog.c:28