kopia lustrzana https://github.com/sh123/esp32_loraprs
rodzic
450c5cc299
commit
1224ae9c1b
|
@ -30,3 +30,4 @@
|
||||||
*.exe
|
*.exe
|
||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
*.log
|
||||||
|
|
|
@ -203,10 +203,14 @@ 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);
|
||||||
//radio_->setRfSwitchPins(4, 5);
|
#if (MODULE_NAME == SX1268)
|
||||||
|
radio_->setRfSwitchPins(4, 5);
|
||||||
|
radio_->clearDio1Action();
|
||||||
|
radio_->setDio1Action(onLoraDataAvailableIsr);
|
||||||
|
#else
|
||||||
radio_->clearDio0Action();
|
radio_->clearDio0Action();
|
||||||
radio_->setDio0Action(onLoraDataAvailableIsr);
|
radio_->setDio0Action(onLoraDataAvailableIsr);
|
||||||
|
#endif
|
||||||
|
|
||||||
state = radio_->startReceive();
|
state = radio_->startReceive();
|
||||||
if (state != ERR_NONE) {
|
if (state != ERR_NONE) {
|
||||||
|
@ -321,7 +325,7 @@ void Service::loop()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Service::isLoraRxBusy() {
|
bool Service::isLoraRxBusy() {
|
||||||
#ifdef USE_RADIOLIB
|
#if defined(USE_RADIOLIB) && !(MODULE_NAME == 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;
|
||||||
|
@ -481,7 +485,11 @@ void Service::onRigPacket(void *packet, int packetLength)
|
||||||
|
|
||||||
void Service::performFrequencyCorrection() {
|
void Service::performFrequencyCorrection() {
|
||||||
#ifdef USE_RADIOLIB
|
#ifdef USE_RADIOLIB
|
||||||
|
#if (MODULE_NAME == SX1268)
|
||||||
|
long frequencyErrorHz = 0;
|
||||||
|
#else
|
||||||
long frequencyErrorHz = radio_->getFrequencyError();
|
long frequencyErrorHz = radio_->getFrequencyError();
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
long frequencyErrorHz = LoRa.packetFrequencyError();
|
long frequencyErrorHz = LoRa.packetFrequencyError();
|
||||||
#endif
|
#endif
|
||||||
|
@ -537,7 +545,11 @@ void Service::processIncomingRawPacketAsServer(const byte *packet, int packetLen
|
||||||
#ifdef USE_RADIOLIB
|
#ifdef USE_RADIOLIB
|
||||||
float snr = radio_->getSNR();
|
float snr = radio_->getSNR();
|
||||||
int rssi = radio_->getRSSI();
|
int rssi = radio_->getRSSI();
|
||||||
|
#if (MODULE_NAME == SX1268)
|
||||||
|
long frequencyError = 0;
|
||||||
|
#else
|
||||||
long frequencyError = radio_->getFrequencyError();
|
long frequencyError = radio_->getFrequencyError();
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
float snr = LoRa.packetSnr();
|
float snr = LoRa.packetSnr();
|
||||||
int rssi = LoRa.packetRssi();
|
int rssi = LoRa.packetRssi();
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// When using RadioLib, default module is SX1278, if you are using
|
// When using RadioLib, default module is SX1278, if you are using
|
||||||
// different module then update MODULE_NAME in module_name.h
|
// different module then update MODULE_NAME in module_name.h
|
||||||
#define USE_RADIOLIB
|
#define USE_RADIOLIB
|
||||||
|
#define HW_DJAPRS 2
|
||||||
#ifdef USE_RADIOLIB
|
#ifdef USE_RADIOLIB
|
||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
#include "module_name.h"
|
#include "module_name.h"
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
// 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 MODULE_NAME SX1278
|
#define MODULE_NAME SX1268
|
||||||
|
|
Ładowanie…
Reference in New Issue