From 78377f7ce59ffc2d1be9870909033cf6df15421d Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 1 Aug 2020 16:45:42 +0300 Subject: fix(timer): keeps counting even when stopped #41 --- src/peripherals/timer.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/peripherals/timer.ts') diff --git a/src/peripherals/timer.ts b/src/peripherals/timer.ts index c6bf742..315d725 100644 --- a/src/peripherals/timer.ts +++ b/src/peripherals/timer.ts @@ -247,6 +247,7 @@ export class AVRTimer { this.cpu.writeHooks[config.TCNT] = (value: u8) => { this.tcnt = (this.highByteTemp << 8) | value; + this.countingUp = true; this.tcntUpdated = true; this.timerUpdated(); }; @@ -281,6 +282,7 @@ export class AVRTimer { }; cpu.writeHooks[config.TCCRB] = (value) => { this.cpu.data[config.TCCRB] = value; + this.tcntUpdated = true; this.updateWGMConfig(); return true; }; -- cgit v1.2.3