From 28c12f45769f85c5f658cc56f1b20e5f85806819 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 22 Mar 2020 08:10:49 +0100 Subject: [PATCH] [CC1101] Fixed typos --- .../CC1101_Transmit_Address.ino | 4 ++-- .../CC1101_Transmit_Interrupt.ino | 4 ++-- src/modules/CC1101/CC1101.cpp | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino b/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino index 7e130920..94905bad 100644 --- a/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino +++ b/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino @@ -91,11 +91,11 @@ void loop() { if (state == ERR_NONE) { // the packet was successfully transmitted - Serial.println(F(" success!")); + Serial.println(F("success!")); } else if (state == ERR_PACKET_TOO_LONG) { // the supplied packet was longer than 255 bytes - Serial.println(F(" too long!")); + Serial.println(F("too long!")); } else { // some other error occurred diff --git a/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino b/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino index dde5d54d..a89cf0ca 100644 --- a/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino +++ b/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino @@ -123,8 +123,8 @@ void loop() { // you can also transmit byte array up to 256 bytes long /* - byte byteArr[] = {0x01, 0x23, 0x45, 0x56, - 0x78, 0xAB, 0xCD, 0xEF}; + byte byteArr[] = {0x01, 0x23, 0x45, 0x67, + 0x89, 0xAB, 0xCD, 0xEF}; int state = cc.startTransmit(byteArr, 8); */ diff --git a/src/modules/CC1101/CC1101.cpp b/src/modules/CC1101/CC1101.cpp index a207bafb..f8e2aa1e 100644 --- a/src/modules/CC1101/CC1101.cpp +++ b/src/modules/CC1101/CC1101.cpp @@ -76,7 +76,7 @@ int16_t CC1101::begin(float freq, float br, float freqDev, float rxBw, int8_t po state = variablePacketLengthMode(); RADIOLIB_ASSERT(state); - // configure default preamble lenght + // configure default preamble length state = setPreambleLength(preambleLength); RADIOLIB_ASSERT(state); @@ -330,7 +330,7 @@ int16_t CC1101::setBitRate(float br) { // set mode to standby SPIsendCommand(CC1101_CMD_IDLE); - // calculate exponent and mantisa values + // calculate exponent and mantissa values uint8_t e = 0; uint8_t m = 0; getExpMant(br * 1000.0, 256, 28, 14, e, m); @@ -350,7 +350,7 @@ int16_t CC1101::setRxBandwidth(float rxBw) { // set mode to standby SPIsendCommand(CC1101_CMD_IDLE); - // calculate exponent and mantisa values + // calculate exponent and mantissa values for(int8_t e = 3; e >= 0; e--) { for(int8_t m = 3; m >= 0; m --) { float point = (CC1101_CRYSTAL_FREQ * 1000000.0)/(8 * (m + 4) * ((uint32_t)1 << e)); @@ -380,7 +380,7 @@ int16_t CC1101::setFrequencyDeviation(float freqDev) { // set mode to standby SPIsendCommand(CC1101_CMD_IDLE); - // calculate exponent and mantisa values + // calculate exponent and mantissa values uint8_t e = 0; uint8_t m = 0; getExpMant(freqDev * 1000.0, 8, 17, 7, e, m); @@ -563,8 +563,8 @@ int16_t CC1101::setOOK(bool enableOOK) { int16_t state = SPIsetRegValue(CC1101_REG_MDMCFG2, CC1101_MOD_FORMAT_ASK_OOK, 6, 4); RADIOLIB_ASSERT(state); - // PA_TABLE[0] is (by default) the power value used when transmitting a "0L". - // Set PA_TABLE[1] to be used when transmitting a "1L". + // PA_TABLE[0] is (by default) the power value used when transmitting a "0". + // Set PA_TABLE[1] to be used when transmitting a "1". state = SPIsetRegValue(CC1101_REG_FREND0, 1, 2, 0); RADIOLIB_ASSERT(state); @@ -627,11 +627,11 @@ int16_t CC1101::variablePacketLengthMode(uint8_t maxLen) { int16_t CC1101::enableSyncWordFiltering(uint8_t maxErrBits, bool requireCarrierSense) { switch (maxErrBits){ case 0: - // in 16 bit sync word, expect all 16 bits. + // in 16 bit sync word, expect all 16 bits return (SPIsetRegValue(CC1101_REG_MDMCFG2, requireCarrierSense ? CC1101_SYNC_MODE_16_16_THR : CC1101_SYNC_MODE_16_16, 2, 0)); case 1: - // in 16 bit sync word, expect at least 15 bits. + // in 16 bit sync word, expect at least 15 bits return (SPIsetRegValue(CC1101_REG_MDMCFG2, requireCarrierSense ? CC1101_SYNC_MODE_15_16_THR : CC1101_SYNC_MODE_15_16, 2, 0)); default: