diff options
| author | Uri Shaked | 2021-08-15 20:27:41 +0300 |
|---|---|---|
| committer | Uri Shaked | 2021-08-15 20:27:41 +0300 |
| commit | eff7111c3b08e8bc9030edc284074dfa2e9b7171 (patch) | |
| tree | 4909fdec5c6602c1da192c0ddd77a801890e941a /src/peripherals/gpio.spec.ts | |
| parent | chore(deps): prettier 2.3.2 (diff) | |
| download | avr8js-eff7111c3b08e8bc9030edc284074dfa2e9b7171.tar.gz avr8js-eff7111c3b08e8bc9030edc284074dfa2e9b7171.tar.bz2 avr8js-eff7111c3b08e8bc9030edc284074dfa2e9b7171.zip | |
feat(timer): external timer support #97
also refactor timer/GPIO interaction to be more generic.
close #97
Diffstat (limited to '')
| -rw-r--r-- | src/peripherals/gpio.spec.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/peripherals/gpio.spec.ts b/src/peripherals/gpio.spec.ts index 31963a9..ed44264 100644 --- a/src/peripherals/gpio.spec.ts +++ b/src/peripherals/gpio.spec.ts @@ -80,10 +80,10 @@ describe('GPIO', () => { const cpu = new CPU(new Uint16Array(1024)); const port = new AVRIOPort(cpu, portBConfig); cpu.writeData(DDRB, 1 << 1); - cpu.gpioTimerHooks[PORTB](1, PinOverrideMode.Set, PORTB); + port.timerOverridePin(1, PinOverrideMode.Set); expect(port.pinState(1)).toBe(PinState.High); expect(cpu.data[PINB]).toBe(1 << 1); - cpu.gpioTimerHooks[PORTB](1, PinOverrideMode.Clear, PORTB); + port.timerOverridePin(1, PinOverrideMode.Clear); expect(port.pinState(1)).toBe(PinState.Low); expect(cpu.data[PINB]).toBe(0); }); |
