Skip to content

Commit 7e31f6b

Browse files
nzmichaelhkartben
authored andcommitted
samples: watchdog: add the ch32v003evt to the sample
The CH32V003 has a straight-forward watchdog that does not support callbacks. Add an overlay and support. To make the sample fit in flash, remove the unused logging from the project configuration. The sample itself doesn't seem to use logging so this is (mostly) a no-op. Signed-off-by: Michael Hope <michaelh@juju.nz>
1 parent 7f21dc2 commit 7e31f6b

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_LOG_MODE_MINIMAL=y
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2025 Michael Hope <michaelh@juju.nz>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
aliases {
9+
watchdog0 = &iwdg;
10+
};
11+
};
12+
13+
&iwdg {
14+
status = "okay";
15+
};

samples/drivers/watchdog/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
#define WDG_FEED_INTERVAL (WDT_MIN_WINDOW + ((WDT_MAX_WINDOW - WDT_MIN_WINDOW) / 4))
4343
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_ra_wdt)
4444
#define WDT_ALLOW_CALLBACK 0
45+
#elif DT_HAS_COMPAT_STATUS_OKAY(wch_iwdg)
46+
#define WDT_ALLOW_CALLBACK 0
47+
#define WDT_OPT 0
4548
#endif
4649

4750
#ifndef WDT_ALLOW_CALLBACK

0 commit comments

Comments
 (0)