Skip to content

Commit e019ee8

Browse files
committed
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.
1 parent bfc8ed9 commit e019ee8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/peripherals/usart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export class AVRUSART {
210210

211211
private get cyclesPerChar() {
212212
const symbolsPerChar = 1 + this.bitsPerChar + this.stopBits + (this.parityEnabled ? 1 : 0);
213-
return (this.UBRR * this.multiplier + 1) * symbolsPerChar;
213+
return (this.UBRR + 1) * this.multiplier * symbolsPerChar;
214214
}
215215

216216
private get UBRR() {

0 commit comments

Comments
 (0)