diff options
| author | Uri Shaked | 2021-07-16 00:39:30 +0300 |
|---|---|---|
| committer | Uri Shaked | 2021-07-16 00:39:30 +0300 |
| commit | e019ee8e002f9ff1cbb93d2673e14df7df416120 (patch) | |
| tree | be7ac9297aeba9df2337215e99d151c587413012 /src/peripherals/usart.ts | |
| parent | 0.16.2 (diff) | |
| download | avr8js-e019ee8e002f9ff1cbb93d2673e14df7df416120.tar.gz avr8js-e019ee8e002f9ff1cbb93d2673e14df7df416120.tar.bz2 avr8js-e019ee8e002f9ff1cbb93d2673e14df7df416120.zip | |
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.
Diffstat (limited to 'src/peripherals/usart.ts')
| -rw-r--r-- | src/peripherals/usart.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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() { |
