From 00ed08d62fc59722c21ec0e4bdd1a238978176c2 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 2 Jan 2021 01:02:01 +0200 Subject: fix: typo in parameter name freqMHz → freqHz in SPI, TWI, and USART: they all expect the frequency in hertz, not mega-hertz. --- src/peripherals/usart.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/peripherals/usart.ts') diff --git a/src/peripherals/usart.ts b/src/peripherals/usart.ts index c7dcbd4..f9b0f87 100644 --- a/src/peripherals/usart.ts +++ b/src/peripherals/usart.ts @@ -87,7 +87,7 @@ export class AVRUSART { enableMask: UCSRB_TXCIE, }; - constructor(private cpu: CPU, private config: USARTConfig, private freqMHz: number) { + constructor(private cpu: CPU, private config: USARTConfig, private freqHz: number) { this.reset(); this.cpu.writeHooks[config.UCSRA] = (value) => { cpu.data[config.UCSRA] = value; @@ -142,7 +142,7 @@ export class AVRUSART { } get baudRate() { - return Math.floor(this.freqMHz / (this.multiplier * (1 + this.UBRR))); + return Math.floor(this.freqHz / (this.multiplier * (1 + this.UBRR))); } get bitsPerChar() { -- cgit v1.2.3