From e019ee8e002f9ff1cbb93d2673e14df7df416120 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Fri, 16 Jul 2021 00:39:30 +0300 Subject: fix(usart): tx / rx complete timing fix the calculation of cyclesPerChar, which is used to determine when a USART RX/TX operation is marked complete. --- src/peripherals/usart.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/peripherals') diff --git a/src/peripherals/usart.ts b/src/peripherals/usart.ts index 3ad787d..81451ba 100644 --- a/src/peripherals/usart.ts +++ b/src/peripherals/usart.ts @@ -210,7 +210,7 @@ export class AVRUSART { private get cyclesPerChar() { const symbolsPerChar = 1 + this.bitsPerChar + this.stopBits + (this.parityEnabled ? 1 : 0); - return (this.UBRR * this.multiplier + 1) * symbolsPerChar; + return (this.UBRR + 1) * this.multiplier * symbolsPerChar; } private get UBRR() { -- cgit v1.2.3