From 6ee7d2f247afe4ac30c0a42a58806956a0bedc69 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Thu, 9 Jul 2020 16:09:44 +0300 Subject: fix(usart): TXC interrupt triggered incorrectly close #51 --- src/peripherals/usart.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/peripherals/usart.ts') diff --git a/src/peripherals/usart.ts b/src/peripherals/usart.ts index c1d6f13..eb6171e 100644 --- a/src/peripherals/usart.ts +++ b/src/peripherals/usart.ts @@ -100,7 +100,7 @@ export class AVRUSART { avrInterrupt(this.cpu, this.config.dataRegisterEmptyInterrupt); this.cpu.data[this.config.UCSRA] &= ~UCSRA_UDRE; } - if (ucsrb & UCSRA_TXC && ucsrb & UCSRB_TXCIE) { + if (ucsra & UCSRA_TXC && ucsrb & UCSRB_TXCIE) { avrInterrupt(this.cpu, this.config.txCompleteInterrupt); this.cpu.data[this.config.UCSRA] &= ~UCSRA_TXC; } -- cgit v1.2.3