[SX123x] Chore: uncrustify formatting

pull/1532/head
jgromes 2025-07-19 19:25:24 +02:00
rodzic 3f3f794027
commit dbe87cca23
4 zmienionych plików z 75 dodań i 79 usunięć

Wyświetl plik

@ -1,9 +1,7 @@
#include "SX1231.h"
#if !RADIOLIB_EXCLUDE_SX1231
SX1231::SX1231(Module* mod) : RF69(mod) {
}
SX1231::SX1231(Module* mod) : RF69(mod) {}
int16_t SX1231::begin(float freq, float br, float freqDev, float rxBw, int8_t power, uint8_t preambleLen) {
// set module properties
@ -74,7 +72,7 @@ int16_t SX1231::begin(float freq, float br, float freqDev, float rxBw, int8_t po
// set default packet length mode
state = variablePacketLengthMode();
if (state != RADIOLIB_ERR_NONE) {
if(state != RADIOLIB_ERR_NONE) {
return(state);
}

Wyświetl plik

@ -20,78 +20,78 @@
#define RADIOLIB_SX1231_OOK_DELTA_THRESHOLD 0x0C
// RADIOLIB_SX1231_REG_DIO_MAPPING_1
#define RADIOLIB_SX1231_DIO0_CONT_LOW_BAT 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_MODE_READY 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_PLL_LOCK 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_SYNC_ADDRESS 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_TIMEOUT 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_RSSI 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_MODE_READY 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_TX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_LOW_BAT 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_PLL_LOCK 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_CRC_OK 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_PAYLOAD_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_SYNC_ADDRESS 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_RSSI 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_PACKET_SENT 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_TX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO1_CONT_LOW_BAT 0b00100000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_PLL_LOCK 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_DCLK 0b00000000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_RX_READY 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_SYNC_ADDRESS 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_TX_READY 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_FIFO_LEVEL 0b00000000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_FIFO_FULL 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_FIFO_NOT_EMPTY 0b00100000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_PLL_LOCK 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_TIMEOUT 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO2_CONT_DATA 0b00000000 // 3 2
#define RADIOLIB_SX1231_DIO2_PACK_FIFO_NOT_EMPTY 0b00000000 // 3 2
#define RADIOLIB_SX1231_DIO2_PACK_LOW_BAT 0b00001000 // 3 2
#define RADIOLIB_SX1231_DIO2_PACK_AUTO_MODE 0b00001100 // 3 2
#define RADIOLIB_SX1231_DIO2_PACK_DATA 0b00000100 // 3 2
#define RADIOLIB_SX1231_DIO3_CONT_AUTO_MODE 0b00000010 // 0 1
#define RADIOLIB_SX1231_DIO3_CONT_RSSI 0b00000000 // 0 1
#define RADIOLIB_SX1231_DIO3_CONT_RX_READY 0b00000001 // 0 1
#define RADIOLIB_SX1231_DIO3_CONT_TIMEOUT 0b00000011 // 0 1
#define RADIOLIB_SX1231_DIO3_CONT_TX_READY 0b00000001 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_FIFO_FULL 0b00000000 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_LOW_BAT 0b00000010 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_PLL_LOCK 0b00000011 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_RSSI 0b00000001 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_SYNC_ADDRESSS 0b00000010 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_TX_READY 0b00000001 // 0 1
#define RADIOLIB_SX1231_DIO0_CONT_LOW_BAT 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_MODE_READY 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_PLL_LOCK 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_SYNC_ADDRESS 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_TIMEOUT 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_RSSI 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_MODE_READY 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO0_CONT_TX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_LOW_BAT 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_PLL_LOCK 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_CRC_OK 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_PAYLOAD_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_SYNC_ADDRESS 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_RSSI 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_PACKET_SENT 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO0_PACK_TX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO1_CONT_LOW_BAT 0b00100000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_PLL_LOCK 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_DCLK 0b00000000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_RX_READY 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_SYNC_ADDRESS 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO1_CONT_TX_READY 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_FIFO_LEVEL 0b00000000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_FIFO_FULL 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_FIFO_NOT_EMPTY 0b00100000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_PLL_LOCK 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO1_PACK_TIMEOUT 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO2_CONT_DATA 0b00000000 // 3 2
#define RADIOLIB_SX1231_DIO2_PACK_FIFO_NOT_EMPTY 0b00000000 // 3 2
#define RADIOLIB_SX1231_DIO2_PACK_LOW_BAT 0b00001000 // 3 2
#define RADIOLIB_SX1231_DIO2_PACK_AUTO_MODE 0b00001100 // 3 2
#define RADIOLIB_SX1231_DIO2_PACK_DATA 0b00000100 // 3 2
#define RADIOLIB_SX1231_DIO3_CONT_AUTO_MODE 0b00000010 // 0 1
#define RADIOLIB_SX1231_DIO3_CONT_RSSI 0b00000000 // 0 1
#define RADIOLIB_SX1231_DIO3_CONT_RX_READY 0b00000001 // 0 1
#define RADIOLIB_SX1231_DIO3_CONT_TIMEOUT 0b00000011 // 0 1
#define RADIOLIB_SX1231_DIO3_CONT_TX_READY 0b00000001 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_FIFO_FULL 0b00000000 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_LOW_BAT 0b00000010 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_PLL_LOCK 0b00000011 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_RSSI 0b00000001 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_SYNC_ADDRESSS 0b00000010 // 0 1
#define RADIOLIB_SX1231_DIO3_PACK_TX_READY 0b00000001 // 0 1
// RADIOLIB_SX1231_REG_DIO_MAPPING_2
#define RADIOLIB_SX1231_DIO4_CONT_LOW_BAT 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_PLL_LOCK 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_TIMEOUT 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_RX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_SYNC_ADDRESS 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_TX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_LOW_BAT 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_PLL_LOCK 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_TIMEOUT 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_RSSI 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_RX_READY 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_MODE_READY 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_TX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO5_CONT_LOW_BAT 0b00100000 // 5 4
#define RADIOLIB_SX1231_DIO5_CONT_MODE_READY 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO5_CONT_CLK_OUT 0b00000000 // 5 4
#define RADIOLIB_SX1231_DIO5_CONT_RSSI 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO5_PACK_LOW_BAT 0b00100000 // 5 4
#define RADIOLIB_SX1231_DIO5_PACK_MODE_READY 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO5_PACK_CLK_OUT 0b00000000 // 5 4
#define RADIOLIB_SX1231_DIO5_PACK_DATA 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO4_CONT_LOW_BAT 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_PLL_LOCK 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_TIMEOUT 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_RX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_SYNC_ADDRESS 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO4_CONT_TX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_LOW_BAT 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_PLL_LOCK 0b11000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_TIMEOUT 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_RSSI 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_RX_READY 0b10000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_MODE_READY 0b00000000 // 7 6
#define RADIOLIB_SX1231_DIO4_PACK_TX_READY 0b01000000 // 7 6
#define RADIOLIB_SX1231_DIO5_CONT_LOW_BAT 0b00100000 // 5 4
#define RADIOLIB_SX1231_DIO5_CONT_MODE_READY 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO5_CONT_CLK_OUT 0b00000000 // 5 4
#define RADIOLIB_SX1231_DIO5_CONT_RSSI 0b00010000 // 5 4
#define RADIOLIB_SX1231_DIO5_PACK_LOW_BAT 0b00100000 // 5 4
#define RADIOLIB_SX1231_DIO5_PACK_MODE_READY 0b00110000 // 5 4
#define RADIOLIB_SX1231_DIO5_PACK_CLK_OUT 0b00000000 // 5 4
#define RADIOLIB_SX1231_DIO5_PACK_DATA 0b00010000 // 5 4
/*!
\class SX1231
\brief Control class for %SX1231 module. Overrides some methods from RF69 due to different register values.
*/
class SX1231: public RF69 {
class SX1231 : public RF69 {
public:
/*!
\brief Default constructor.
@ -111,9 +111,9 @@ class SX1231: public RF69 {
*/
virtual int16_t begin(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 125.0, int8_t power = 10, uint8_t preambleLen = 16);
#if !RADIOLIB_GODMODE
#if !RADIOLIB_GODMODE
protected:
#endif
#endif
uint8_t chipRevision = 0;
};

Wyświetl plik

@ -2,9 +2,7 @@
#include <math.h>
#if !RADIOLIB_EXCLUDE_SX1231
SX1233::SX1233(Module* mod) : SX1231(mod) {
}
SX1233::SX1233(Module* mod) : SX1231(mod) {}
int16_t SX1233::begin(float freq, float br, float freqDev, float rxBw, int8_t power, uint8_t preambleLen) {
// set module properties
@ -75,7 +73,7 @@ int16_t SX1233::begin(float freq, float br, float freqDev, float rxBw, int8_t po
// set default packet length mode
state = variablePacketLengthMode();
if (state != RADIOLIB_ERR_NONE) {
if(state != RADIOLIB_ERR_NONE) {
return(state);
}
@ -102,7 +100,7 @@ int16_t SX1233::setBitRate(float br) {
// datasheet says 1.2 kbps should be the smallest possible, but 0.512 works fine
RADIOLIB_CHECK_RANGE(br, 0.5f, 300.0f, RADIOLIB_ERR_INVALID_BIT_RATE);
}
// check bitrate-bandwidth ratio
if(!(br < 2000 * this->rxBandwidth)) {

Wyświetl plik

@ -20,7 +20,7 @@
\class SX1233
\brief Control class for %SX1233 module. Overrides some methods from SX1231/RF69 due to different register values.
*/
class SX1233: public SX1231 {
class SX1233 : public SX1231 {
public:
/*!
\brief Default constructor.
@ -50,9 +50,9 @@ class SX1233: public SX1231 {
*/
int16_t setBitRate(float br) override;
#if !RADIOLIB_GODMODE
#if !RADIOLIB_GODMODE
private:
#endif
#endif
};