summaryrefslogtreecommitdiff
path: root/src/peripherals/avrdx-wdt.ts
diff options
context:
space:
mode:
authorApexo2026-03-28 23:40:53 +0100
committerApexo2026-03-28 23:40:53 +0100
commit1b194ac4578dea8e71b0d61d1cb4d875f435ba71 (patch)
tree786019a0c6f34b458f3272bf2ecbde0de1976e0a /src/peripherals/avrdx-wdt.ts
downloadanduril-sim-1b194ac4578dea8e71b0d61d1cb4d875f435ba71.tar.gz
anduril-sim-1b194ac4578dea8e71b0d61d1cb4d875f435ba71.tar.bz2
anduril-sim-1b194ac4578dea8e71b0d61d1cb4d875f435ba71.zip
D3AA simulator
Diffstat (limited to '')
-rw-r--r--src/peripherals/avrdx-wdt.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/peripherals/avrdx-wdt.ts b/src/peripherals/avrdx-wdt.ts
new file mode 100644
index 0000000..08cd308
--- /dev/null
+++ b/src/peripherals/avrdx-wdt.ts
@@ -0,0 +1,22 @@
+// AVR-Dx SLPCTRL - Sleep Controller
+// Handles the SLEEP instruction by fast-forwarding to the next clock event.
+
+import { type CPU } from 'avr8js/cpu/cpu';
+
+// const CTRLA = 0;
+// const STATUS = 1;
+
+export class AVRDxWDT {
+ constructor(cpu: CPU, base: number) {
+ // firmware writes 0 to disable WDT. We need a write hook so it doesn't crash.
+ // cpu.writeHooks[base + CTRLA] = (value) => {
+ // this.cpu.data[base + CTRLA] = value;
+ // return true;
+ // };
+
+ // cpu.writeHooks[base + STATUS] = (value) => {
+ // this.cpu.data[base + STATUS] = value;
+ // return true;
+ // };
+ }
+}