aboutsummaryrefslogtreecommitdiff
path: root/demo/src/execute.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--demo/src/execute.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/demo/src/execute.ts b/demo/src/execute.ts
index ee5278e..2ba9ee0 100644
--- a/demo/src/execute.ts
+++ b/demo/src/execute.ts
@@ -3,6 +3,7 @@ import {
AVRTimer,
CPU,
timer0Config,
+ timer1Config,
AVRIOPort,
AVRUSART,
portBConfig,
@@ -19,7 +20,8 @@ const FLASH = 0x8000;
export class AVRRunner {
readonly program = new Uint16Array(FLASH);
readonly cpu: CPU;
- readonly timer: AVRTimer;
+ readonly timer0: AVRTimer;
+ readonly timer1: AVRTimer;
readonly portB: AVRIOPort;
readonly portC: AVRIOPort;
readonly portD: AVRIOPort;
@@ -31,7 +33,8 @@ export class AVRRunner {
constructor(hex: string) {
loadHex(hex, new Uint8Array(this.program.buffer));
this.cpu = new CPU(this.program);
- this.timer = new AVRTimer(this.cpu, timer0Config);
+ this.timer0 = new AVRTimer(this.cpu, timer0Config);
+ this.timer1 = new AVRTimer(this.cpu, timer1Config);
this.portB = new AVRIOPort(this.cpu, portBConfig);
this.portC = new AVRIOPort(this.cpu, portCConfig);
this.portD = new AVRIOPort(this.cpu, portDConfig);
@@ -44,7 +47,8 @@ export class AVRRunner {
const cyclesToRun = this.cpu.cycles + this.workUnitCycles;
while (this.cpu.cycles < cyclesToRun) {
avrInstruction(this.cpu);
- this.timer.tick();
+ this.timer0.tick();
+ this.timer1.tick();
this.usart.tick();
}