From caa05f8ad8aa8f0d7e629228732dc3f3514a62b6 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 22 Mar 2020 08:13:27 +0100 Subject: [PATCH] [SX127x] Fixed typos --- .../SX127x_Channel_Activity_Detection.ino | 4 ++-- .../SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino | 6 +++--- .../SX127x_Receive_Interrupt.ino | 2 +- examples/SX127x/SX127x_Settings/SX127x_Settings.ino | 7 ++----- examples/SX127x/SX127x_Transmit/SX127x_Transmit.ino | 8 ++++---- .../SX127x_Transmit_Interrupt.ino | 12 ++++++------ src/modules/SX127x/SX127x.cpp | 2 +- src/modules/SX127x/SX127x.h | 9 ++++----- 8 files changed, 23 insertions(+), 27 deletions(-) diff --git a/examples/SX127x/SX127x_Channel_Activity_Detection/SX127x_Channel_Activity_Detection.ino b/examples/SX127x/SX127x_Channel_Activity_Detection/SX127x_Channel_Activity_Detection.ino index 163f8273..4d946254 100644 --- a/examples/SX127x/SX127x_Channel_Activity_Detection/SX127x_Channel_Activity_Detection.ino +++ b/examples/SX127x/SX127x_Channel_Activity_Detection/SX127x_Channel_Activity_Detection.ino @@ -59,11 +59,11 @@ void loop() { if (state == PREAMBLE_DETECTED) { // LoRa preamble was detected - Serial.println(F(" detected preamble!")); + Serial.println(F("detected preamble!")); } else if (state == CHANNEL_FREE) { // no preamble was detected, channel is free - Serial.println(F(" channel is free!")); + Serial.println(F("channel is free!")); } diff --git a/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino b/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino index f9e2821d..7727bcfe 100644 --- a/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino +++ b/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino @@ -97,8 +97,8 @@ void loop() { // transmit FSK packet int state = fsk.transmit("Hello World!"); /* - byte byteArr[] = {0x01, 0x23, 0x45, 0x56, - 0x78, 0xAB, 0xCD, 0xEF}; + byte byteArr[] = {0x01, 0x23, 0x45, 0x67, + 0x89, 0xAB, 0xCD, 0xEF}; int state = lora.transmit(byteArr, 8); */ if (state == ERR_NONE) { @@ -151,7 +151,7 @@ void loop() { // address filtering can also be disabled // NOTE: calling this method will also erase previously set - // node and broadcast address + // node and broadcast address /* state = fsk.disableAddressFiltering(); if (state != ERR_NONE) { diff --git a/examples/SX127x/SX127x_Receive_Interrupt/SX127x_Receive_Interrupt.ino b/examples/SX127x/SX127x_Receive_Interrupt/SX127x_Receive_Interrupt.ino index fbc20651..7f192757 100644 --- a/examples/SX127x/SX127x_Receive_Interrupt/SX127x_Receive_Interrupt.ino +++ b/examples/SX127x/SX127x_Receive_Interrupt/SX127x_Receive_Interrupt.ino @@ -118,7 +118,7 @@ void loop() { // you can also read received data as byte array /* byte byteArr[8]; - int state = lora.receive(byteArr, 8); + int state = lora.readData(byteArr, 8); */ if (state == ERR_NONE) { diff --git a/examples/SX127x/SX127x_Settings/SX127x_Settings.ino b/examples/SX127x/SX127x_Settings/SX127x_Settings.ino index 681c76d2..76b26b10 100644 --- a/examples/SX127x/SX127x_Settings/SX127x_Settings.ino +++ b/examples/SX127x/SX127x_Settings/SX127x_Settings.ino @@ -91,9 +91,6 @@ void setup() { // you can also change the settings at runtime // and check if the configuration was changed successfully - // different modules accept different parameters - // see https://github.com/jgromes/LoRaLib/wiki/Supported-LoRa-modules - // set carrier frequency to 433.5 MHz if (loraSX1278.setFrequency(433.5) == ERR_INVALID_FREQUENCY) { Serial.println(F("Selected frequency is invalid for this module!")); @@ -147,14 +144,14 @@ void setup() { } // set amplifier gain to 1 (accepted range is 1 - 6, where 1 is maximum gain) - // NOTE: set value to 0 to enable autmatic gain control + // NOTE: set value to 0 to enable automatic gain control // leave at 0 unless you know what you're doing if (loraSX1278.setGain(1) == ERR_INVALID_GAIN) { Serial.println(F("Selected gain is invalid for this module!")); while (true); } - Serial.println(F("All settings succesfully changed!")); + Serial.println(F("All settings successfully changed!")); } void loop() { diff --git a/examples/SX127x/SX127x_Transmit/SX127x_Transmit.ino b/examples/SX127x/SX127x_Transmit/SX127x_Transmit.ino index d14e76f7..cd5ad220 100644 --- a/examples/SX127x/SX127x_Transmit/SX127x_Transmit.ino +++ b/examples/SX127x/SX127x_Transmit/SX127x_Transmit.ino @@ -63,7 +63,7 @@ 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 = lora.transmit(byteArr, 8); */ @@ -78,11 +78,11 @@ void loop() { } else if (state == ERR_PACKET_TOO_LONG) { // the supplied packet was longer than 256 bytes - Serial.println(F(" too long!")); + Serial.println(F("too long!")); } else if (state == ERR_TX_TIMEOUT) { - // timeout occured while transmitting packet - Serial.println(F(" timeout!")); + // timeout occurred while transmitting packet + Serial.println(F("timeout!")); } else { // some other error occurred diff --git a/examples/SX127x/SX127x_Transmit_Interrupt/SX127x_Transmit_Interrupt.ino b/examples/SX127x/SX127x_Transmit_Interrupt/SX127x_Transmit_Interrupt.ino index 8368a7d4..0290e54b 100644 --- a/examples/SX127x/SX127x_Transmit_Interrupt/SX127x_Transmit_Interrupt.ino +++ b/examples/SX127x/SX127x_Transmit_Interrupt/SX127x_Transmit_Interrupt.ino @@ -67,9 +67,9 @@ void setup() { // you can also transmit byte array up to 256 bytes long /* - byte byteArr[] = {0x01, 0x23, 0x45, 0x56, - 0x78, 0xAB, 0xCD, 0xEF}; - state = lora.transmit(byteArr, 8); + byte byteArr[] = {0x01, 0x23, 0x45, 0x67, + 0x89, 0xAB, 0xCD, 0xEF}; + state = lora.startTransmit(byteArr, 8); */ } @@ -129,9 +129,9 @@ void loop() { // you can also transmit byte array up to 256 bytes long /* - byte byteArr[] = {0x01, 0x23, 0x45, 0x56, - 0x78, 0xAB, 0xCD, 0xEF}; - int state = lora.transmit(byteArr, 8); + byte byteArr[] = {0x01, 0x23, 0x45, 0x67, + 0x89, 0xAB, 0xCD, 0xEF}; + int state = lora.startTransmit(byteArr, 8); */ // we're ready to send more packets, diff --git a/src/modules/SX127x/SX127x.cpp b/src/modules/SX127x/SX127x.cpp index 1ba7b49e..b8b01dbc 100644 --- a/src/modules/SX127x/SX127x.cpp +++ b/src/modules/SX127x/SX127x.cpp @@ -43,7 +43,7 @@ int16_t SX127x::begin(uint8_t chipVersion, uint8_t syncWord, uint8_t currentLimi state = SX127x::setPreambleLength(preambleLength); RADIOLIB_ASSERT(state); - // initalize internal variables + // initialize internal variables _dataRate = 0.0; return(state); diff --git a/src/modules/SX127x/SX127x.h b/src/modules/SX127x/SX127x.h index aa6bb03b..1edf5917 100644 --- a/src/modules/SX127x/SX127x.h +++ b/src/modules/SX127x/SX127x.h @@ -480,7 +480,7 @@ #define SX127X_FLAG_TX_READY 0b00100000 // 5 5 transmission ready (after PA ramp-up) #define SX127X_FLAG_PLL_LOCK 0b00010000 // 4 4 PLL locked #define SX127X_FLAG_RSSI 0b00001000 // 3 3 RSSI value exceeds RSSI threshold -#define SX127X_FLAG_TIMEOUT 0b00000100 // 2 2 timeout occured +#define SX127X_FLAG_TIMEOUT 0b00000100 // 2 2 timeout occurred #define SX127X_FLAG_PREAMBLE_DETECT 0b00000010 // 1 1 valid preamble was detected #define SX127X_FLAG_SYNC_ADDRESS_MATCH 0b00000001 // 0 0 sync address matched @@ -488,7 +488,7 @@ #define SX127X_FLAG_FIFO_FULL 0b10000000 // 7 7 FIFO is full #define SX127X_FLAG_FIFO_EMPTY 0b01000000 // 6 6 FIFO is empty #define SX127X_FLAG_FIFO_LEVEL 0b00100000 // 5 5 number of bytes in FIFO exceeds FIFO_THRESHOLD -#define SX127X_FLAG_FIFO_OVERRUN 0b00010000 // 4 4 FIFO overrun occured +#define SX127X_FLAG_FIFO_OVERRUN 0b00010000 // 4 4 FIFO overrun occurred #define SX127X_FLAG_PACKET_SENT 0b00001000 // 3 3 packet was successfully sent #define SX127X_FLAG_PAYLOAD_READY 0b00000100 // 2 2 packet was successfully received #define SX127X_FLAG_CRC_OK 0b00000010 // 1 1 CRC check passed @@ -565,7 +565,7 @@ class SX127x: public PhysicalLayer { int16_t begin(uint8_t chipVersion, uint8_t syncWord, uint8_t currentLimit, uint16_t preambleLength); /*! - \brief Reset method. Will reset the chip to the default state using RST pin. Declared pure virtual since SX1272 and SX1278 implmentations differ. + \brief Reset method. Will reset the chip to the default state using RST pin. Declared pure virtual since SX1272 and SX1278 implementations differ. */ virtual void reset() = 0; @@ -663,7 +663,6 @@ class SX127x: public PhysicalLayer { */ int16_t packetMode(); - // interrupt methods /*! @@ -880,7 +879,7 @@ class SX127x: public PhysicalLayer { /*! \brief Sets RSSI measurement configuration in FSK mode. - \param smoothingSamples Number of samples taken to avergae the RSSI result. + \param smoothingSamples Number of samples taken to average the RSSI result. numSamples = 2 ^ (1 + smoothingSamples), allowed values are in range 0 (2 samples) - 7 (256 samples) \param offset Signed RSSI offset that will be automatically compensated. 1 dB per LSB, defaults to 0, allowed values are in range -16 dB to +15 dB.