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/spi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/peripherals/spi.ts') diff --git a/src/peripherals/spi.ts b/src/peripherals/spi.ts index 7dd5d43..80167b0 100644 --- a/src/peripherals/spi.ts +++ b/src/peripherals/spi.ts @@ -50,7 +50,7 @@ export class AVRSPI { enableMask: SPCR_SPIE, }; - constructor(private cpu: CPU, private config: SPIConfig, private freqMHz: number) { + constructor(private cpu: CPU, private config: SPIConfig, private freqHz: number) { const { SPCR, SPSR, SPDR } = config; cpu.writeHooks[SPDR] = (value: u8) => { if (!(cpu.data[SPCR] & SPCR_SPE)) { @@ -130,6 +130,6 @@ export class AVRSPI { * In slave mode, the frequency can be as high as F(osc) / 4. */ get spiFrequency() { - return this.freqMHz / this.clockDivider; + return this.freqHz / this.clockDivider; } } -- cgit v1.2.3