aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/peripherals/timer.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/peripherals/timer.ts b/src/peripherals/timer.ts
index c79cc7c..cd55f12 100644
--- a/src/peripherals/timer.ts
+++ b/src/peripherals/timer.ts
@@ -320,10 +320,10 @@ export class AVRTimer {
this.ocrB = this.nextOcrB;
}
};
- this.cpu.writeHooks[config.ICR] = (value: u8) => {
- this.icr = (this.highByteTemp << 8) | value;
- };
if (this.config.bits === 16) {
+ this.cpu.writeHooks[config.ICR] = (value: u8) => {
+ this.icr = (this.highByteTemp << 8) | value;
+ };
const updateTempRegister = (value: u8) => {
this.highByteTemp = value;
};