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_->forceLDRO(false);
#ifdef USE_SX1268
#ifdef USE_SX126X
#pragma message("Using SX1268")
radio_->setRfSwitchPins(4, 5);
radio_->clearDio1Action();
@ -346,7 +346,7 @@ void Service::loop()
}
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
#else
return false;
@ -539,7 +539,7 @@ void Service::onRigPacket(void *packet, int packetLength)
void Service::performFrequencyCorrection() {
#ifdef USE_RADIOLIB
#ifdef USE_SX1268
#ifdef USE_SX126X
long frequencyErrorHz = 0;
#else
long frequencyErrorHz = radio_->getFrequencyError();
@ -653,7 +653,7 @@ bool Service::onRigTxBegin()
void Service::onRigTx(byte b)
{
LOG_TRACE((char)b);
LOG_TRACE((char)b, b);
#ifdef USE_RADIOLIB
txQueue_.push(b);
#else
@ -717,7 +717,7 @@ void Service::attachKissNetworkClient()
void Service::onSerialTx(byte b)
{
LOG_TRACE((char)b);
LOG_TRACE((char)b, b);
if (config_.UsbSerialEnable) {
Serial.write(b);
}
@ -772,7 +772,7 @@ bool Service::onSerialRx(byte *b)
return false;
}
*b = (byte)rxResult;
LOG_TRACE((char)rxResult);
LOG_TRACE((char)rxResult, rxResult);
return true;
}

Wyświetl plik

@ -1,5 +1,9 @@
// Check your module name at https://github.com/jgromes/RadioLib/wiki/Modules
//#define USE_SX1268
//#define MODULE_NAME SX1268
// Uncomment for SX126X module usage
//#define USE_SX126X
#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