aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals/timer.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/peripherals/timer.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/peripherals/timer.ts b/src/peripherals/timer.ts
index 4293a49..c6bf742 100644
--- a/src/peripherals/timer.ts
+++ b/src/peripherals/timer.ts
@@ -363,15 +363,16 @@ export class AVRTimer {
}
this.tcntUpdated = false;
if (this.cpu.interruptsEnabled) {
- if (this.TIFR & TOV && this.TIMSK & TOIE) {
+ const { TIFR, TIMSK } = this;
+ if (TIFR & TOV && TIMSK & TOIE) {
avrInterrupt(this.cpu, this.config.ovfInterrupt);
this.TIFR &= ~TOV;
}
- if (this.TIFR & OCFA && this.TIMSK & OCIEA) {
+ if (TIFR & OCFA && TIMSK & OCIEA) {
avrInterrupt(this.cpu, this.config.compAInterrupt);
this.TIFR &= ~OCFA;
}
- if (this.TIFR & OCFB && this.TIMSK & OCIEB) {
+ if (TIFR & OCFB && TIMSK & OCIEB) {
avrInterrupt(this.cpu, this.config.compBInterrupt);
this.TIFR &= ~OCFB;
}