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/twi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/peripherals/twi.ts') diff --git a/src/peripherals/twi.ts b/src/peripherals/twi.ts index 000bd2a..f74001c 100644 --- a/src/peripherals/twi.ts +++ b/src/peripherals/twi.ts @@ -104,7 +104,7 @@ export class AVRTWI { enableMask: TWCR_TWIE, }; - constructor(private cpu: CPU, private config: TWIConfig, private freqMHz: number) { + constructor(private cpu: CPU, private config: TWIConfig, private freqHz: number) { this.updateStatus(STATUS_TWI_IDLE); this.cpu.writeHooks[config.TWCR] = (value) => { this.cpu.data[config.TWCR] = value; @@ -149,7 +149,7 @@ export class AVRTWI { } get sclFrequency() { - return this.freqMHz / (16 + 2 * this.cpu.data[this.config.TWBR] * this.prescaler); + return this.freqHz / (16 + 2 * this.cpu.data[this.config.TWBR] * this.prescaler); } completeStart() { -- cgit v1.2.3