kopia lustrzana https://github.com/sh123/esp32_loraprs
Improve logic
rodzic
589d4d4103
commit
fb541e2a48
4
config.h
4
config.h
|
@ -46,8 +46,8 @@
|
|||
|
||||
// CAD and ISR usage selection
|
||||
#ifdef USE_SX126X
|
||||
#define CFG_LORA_USE_ISR false // true - read incoming data in ISR, false - do not read in ISR
|
||||
#define CFG_LORA_USE_CAD false // set to true to utilize carrier detection
|
||||
#define CFG_LORA_USE_ISR false // reading in ISR does not work on sx126x
|
||||
#define CFG_LORA_USE_CAD true // do not transmit if channel is busy
|
||||
#else
|
||||
#define CFG_LORA_USE_ISR true // true - read incoming data in ISR, false - do not read in ISR
|
||||
#define CFG_LORA_USE_CAD true // set to true to utilize carrier detection
|
||||
|
|
|
@ -348,10 +348,14 @@ void Service::loop()
|
|||
}
|
||||
|
||||
bool Service::isLoraRxBusy() {
|
||||
#if defined(USE_RADIOLIB) && !defined(USE_SX126X)
|
||||
#ifdef USE_RADIOLIB
|
||||
#ifdef USE_SX126X
|
||||
return config_.LoraUseCad && loraDataAvailable_;
|
||||
#else
|
||||
return config_.LoraUseCad && (radio_->getModemStatus() & 0x01); // SX1278_STATUS_SIG_DETECT
|
||||
#endif
|
||||
#else
|
||||
return loraDataAvailable_;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue