SX126x support for nodes

untested
This commit is contained in:
Timm Bogner 2023-02-21 12:11:32 -06:00
parent 5b701228ff
commit a57e921e45
2 changed files with 11 additions and 6 deletions

View File

@ -16,6 +16,7 @@
// LoRa Configuration
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
//#define USE_SX126X
#define LORA_SS 18
#define LORA_RST 14
#define LORA_DIO 26

View File

@ -158,7 +158,11 @@ void begin_lora()
;
}
DBG("LoRa Initialized. Frequency: " + String(FDRS_LORA_FREQUENCY) + " Bandwidth: " + String(FDRS_LORA_BANDWIDTH) + " SF: " + String(FDRS_LORA_SF) + " CR: " + String(FDRS_LORA_CR) + " SyncWord: " + String(FDRS_LORA_SYNCWORD) + " Tx Power: " + String(FDRS_LORA_TXPWR) + "dBm");
#ifdef USE_SX126X
radio.setDio1Action(setFlag);
#else
radio.setDio0Action(setFlag);
#endif
radio.setCRC(false);
LoRaAddress = ((radio.randomByte() << 8) | radio.randomByte());
state = radio.startReceive(); // start listening for LoRa packets
@ -433,8 +437,8 @@ crcResult getLoRa()
}
else
{
//DBG("Incoming LoRa packet of " + String(packetSize) + " bytes received from address 0x" + String(sourceMAC, HEX) + " destined for node address 0x" + String(destMAC, HEX));
// printLoraPacket(packet,sizeof(packet));
// DBG("Incoming LoRa packet of " + String(packetSize) + " bytes received from address 0x" + String(sourceMAC, HEX) + " destined for node address 0x" + String(destMAC, HEX));
// printLoraPacket(packet,sizeof(packet));
return CRC_NULL;
}
}
@ -442,10 +446,10 @@ crcResult getLoRa()
{
if (packetSize != 0)
{
//DBG("Incoming LoRa packet of " + String(packetSize) + "bytes not processed.");
// uint8_t packet[packetSize];
// radio.readData((uint8_t *)&packet, packetSize);
// printLoraPacket(packet,sizeof(packet));
// DBG("Incoming LoRa packet of " + String(packetSize) + "bytes not processed.");
// uint8_t packet[packetSize];
// radio.readData((uint8_t *)&packet, packetSize);
// printLoraPacket(packet,sizeof(packet));
return CRC_NULL;
}
}