aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals/timer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/peripherals/timer.ts')
-rw-r--r--src/peripherals/timer.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/peripherals/timer.ts b/src/peripherals/timer.ts
index 04c09aa..7cae2ac 100644
--- a/src/peripherals/timer.ts
+++ b/src/peripherals/timer.ts
@@ -197,6 +197,7 @@ export class AVRTimer {
constructor(private cpu: CPU, private config: AVRTimerConfig) {
this.updateWGMConfig();
this.cpu.readHooks[config.TCNT] = (addr: u8) => {
+ this.tick();
if (this.config.bits === 16) {
this.cpu.data[addr + 1] = this.tcnt >> 8;
}