From 8c15d5d1a3bdeb1f4c95248fc35b9ebe0a6aa235 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Fri, 22 Oct 2021 04:44:33 +0300 Subject: fix(spi): setting SPIE doesn't fire pending interrupt --- src/peripherals/spi.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/peripherals/spi.ts') diff --git a/src/peripherals/spi.ts b/src/peripherals/spi.ts index 9707307..7b753ab 100644 --- a/src/peripherals/spi.ts +++ b/src/peripherals/spi.ts @@ -78,6 +78,9 @@ export class AVRSPI { }, cyclesToComplete); return true; }; + cpu.writeHooks[SPCR] = (value: u8) => { + this.cpu.updateInterruptEnable(this.SPI, value); + }; cpu.writeHooks[SPSR] = (value: u8) => { this.cpu.data[SPSR] = value; this.cpu.clearInterruptByFlag(this.SPI, value); -- cgit v1.2.3