summaryrefslogtreecommitdiff
path: root/src/peripherals/avrdx-wdt.ts
blob: 08cd308e61ae97c7603203a623d6b37a24c58a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
    // };
  }
}