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.ts9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/peripherals/timer.ts b/src/peripherals/timer.ts
index b1a64d9..e620459 100644
--- a/src/peripherals/timer.ts
+++ b/src/peripherals/timer.ts
@@ -481,20 +481,13 @@ export class AVRTimer {
// OCRUpdateMode.Bottom only occurs in Phase Correct modes, handled by phasePwmCount().
// Thus we only handle TOVUpdateMode.Top or TOVUpdateMode.Max here.
- if (
- (newVal === TOP || (overflow && val < TOP)) &&
- (this.tovUpdateMode == TOVUpdateMode.Top || TOP === this.MAX)
- ) {
+ if (overflow && (this.tovUpdateMode == TOVUpdateMode.Top || TOP === this.MAX)) {
cpu.setInterruptFlag(this.OVF);
}
}
}
if (this.tcntUpdated) {
- const { TOP } = this;
this.tcnt = this.tcntNext;
- if (this.tcnt === TOP && (this.tovUpdateMode == TOVUpdateMode.Top || TOP === this.MAX)) {
- cpu.setInterruptFlag(this.OVF);
- }
this.tcntUpdated = false;
}
if (this.updateDivider) {