Improve module selection

pull/42/head
sh123 2021-11-13 11:07:49 +02:00
rodzic 1805d55500
commit a07dbada5a
2 zmienionych plików z 14 dodań i 10 usunięć

Wyświetl plik

@ -214,7 +214,7 @@ void Service::setupLora(long loraFreq, long bw, int sf, int cr, int pwr, int syn
} }
radio_->setCRC(enableCrc); radio_->setCRC(enableCrc);
//radio_->forceLDRO(false); //radio_->forceLDRO(false);
#ifdef USE_SX1268 #ifdef USE_SX126X
#pragma message("Using SX1268") #pragma message("Using SX1268")
radio_->setRfSwitchPins(4, 5); radio_->setRfSwitchPins(4, 5);
radio_->clearDio1Action(); radio_->clearDio1Action();
@ -346,7 +346,7 @@ void Service::loop()
} }
bool Service::isLoraRxBusy() { bool Service::isLoraRxBusy() {
#if defined(USE_RADIOLIB) && !defined(USE_SX1268) #if defined(USE_RADIOLIB) && !defined(USE_SX126X)
return config_.LoraUseCad && (radio_->getModemStatus() & 0x01); // SX1278_STATUS_SIG_DETECT return config_.LoraUseCad && (radio_->getModemStatus() & 0x01); // SX1278_STATUS_SIG_DETECT
#else #else
return false; return false;
@ -539,7 +539,7 @@ void Service::onRigPacket(void *packet, int packetLength)
void Service::performFrequencyCorrection() { void Service::performFrequencyCorrection() {
#ifdef USE_RADIOLIB #ifdef USE_RADIOLIB
#ifdef USE_SX1268 #ifdef USE_SX126X
long frequencyErrorHz = 0; long frequencyErrorHz = 0;
#else #else
long frequencyErrorHz = radio_->getFrequencyError(); long frequencyErrorHz = radio_->getFrequencyError();
@ -653,7 +653,7 @@ bool Service::onRigTxBegin()
void Service::onRigTx(byte b) void Service::onRigTx(byte b)
{ {
LOG_TRACE((char)b); LOG_TRACE((char)b, b);
#ifdef USE_RADIOLIB #ifdef USE_RADIOLIB
txQueue_.push(b); txQueue_.push(b);
#else #else
@ -717,7 +717,7 @@ void Service::attachKissNetworkClient()
void Service::onSerialTx(byte b) void Service::onSerialTx(byte b)
{ {
LOG_TRACE((char)b); LOG_TRACE((char)b, b);
if (config_.UsbSerialEnable) { if (config_.UsbSerialEnable) {
Serial.write(b); Serial.write(b);
} }
@ -772,7 +772,7 @@ bool Service::onSerialRx(byte *b)
return false; return false;
} }
*b = (byte)rxResult; *b = (byte)rxResult;
LOG_TRACE((char)rxResult); LOG_TRACE((char)rxResult, rxResult);
return true; return true;
} }

Wyświetl plik

@ -1,5 +1,9 @@
// Check your module name at https://github.com/jgromes/RadioLib/wiki/Modules // Uncomment for SX126X module usage
//#define USE_SX1268 //#define USE_SX126X
//#define MODULE_NAME SX1268
#define MODULE_NAME SX1278 // Check your module name at https://github.com/jgromes/RadioLib/wiki/Modules
#ifdef USE_SX126X
#define MODULE_NAME SX1268
#else
#define MODULE_NAME SX1278
#endif