kopia lustrzana https://github.com/sh123/esp32_loraprs
Fix wrong define usage
rodzic
7b90dcc589
commit
59b94b4be8
|
@ -212,21 +212,23 @@ 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);
|
||||||
#if (MODULE_NAME == SX1268)
|
#ifdef USE_SX1268
|
||||||
radio_->setRfSwitchPins(4, 5);
|
#pragma message("Using SX1268")
|
||||||
radio_->clearDio1Action();
|
radio_->setRfSwitchPins(4, 5);
|
||||||
if (config_.LoraUseIsr) {
|
radio_->clearDio1Action();
|
||||||
radio_->setDio1Action(onLoraDataAvailableIsr);
|
if (config_.LoraUseIsr) {
|
||||||
} else {
|
radio_->setDio1Action(onLoraDataAvailableIsr);
|
||||||
radio_->setDio1Action(onLoraDataAvailableIsrNoRead);
|
} else {
|
||||||
}
|
radio_->setDio1Action(onLoraDataAvailableIsrNoRead);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
radio_->clearDio0Action();
|
#pragma message("Using SX1278")
|
||||||
if (config_.LoraUseIsr) {
|
radio_->clearDio0Action();
|
||||||
radio_->setDio0Action(onLoraDataAvailableIsr);
|
if (config_.LoraUseIsr) {
|
||||||
} else {
|
radio_->setDio0Action(onLoraDataAvailableIsr);
|
||||||
radio_->setDio0Action(onLoraDataAvailableIsrNoRead);
|
} else {
|
||||||
}
|
radio_->setDio0Action(onLoraDataAvailableIsrNoRead);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
state = radio_->startReceive();
|
state = radio_->startReceive();
|
||||||
|
@ -342,7 +344,7 @@ void Service::loop()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Service::isLoraRxBusy() {
|
bool Service::isLoraRxBusy() {
|
||||||
#if defined(USE_RADIOLIB) && !(MODULE_NAME == SX1268)
|
#if defined(USE_RADIOLIB) && !defined(USE_SX1268)
|
||||||
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;
|
||||||
|
@ -535,7 +537,7 @@ void Service::onRigPacket(void *packet, int packetLength)
|
||||||
|
|
||||||
void Service::performFrequencyCorrection() {
|
void Service::performFrequencyCorrection() {
|
||||||
#ifdef USE_RADIOLIB
|
#ifdef USE_RADIOLIB
|
||||||
#if (MODULE_NAME == SX1268)
|
#ifdef USE_SX1268
|
||||||
long frequencyErrorHz = 0;
|
long frequencyErrorHz = 0;
|
||||||
#else
|
#else
|
||||||
long frequencyErrorHz = radio_->getFrequencyError();
|
long frequencyErrorHz = radio_->getFrequencyError();
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
// Check your module name at https://github.com/jgromes/RadioLib/wiki/Modules
|
// Check your module name at https://github.com/jgromes/RadioLib/wiki/Modules
|
||||||
|
//#define USE_SX1268
|
||||||
//#define MODULE_NAME SX1268
|
//#define MODULE_NAME SX1268
|
||||||
#define MODULE_NAME SX1278
|
|
||||||
|
#define MODULE_NAME SX1278
|
||||||
|
|
Ładowanie…
Reference in New Issue