kopia lustrzana https://github.com/sh123/esp32_loraprs
Set USE_RADIOLIB by default
rodzic
3c0558d2eb
commit
fc494adda5
|
@ -15,12 +15,6 @@
|
|||
#pragma message("Configured for server mode")
|
||||
#endif
|
||||
|
||||
// When USE_RADIOLIB is defined then RadioLib will be used, otherwise arduino-LoRa will be used
|
||||
// When using RadioLib, default module is SX1278, if you are using
|
||||
// different module then update loraprs_service.h and loraprs_service.cpp
|
||||
// search for SX1278 and replace with your module name
|
||||
|
||||
//#define USE_RADIOLIB
|
||||
#include "loraprs_service.h"
|
||||
|
||||
void initializeConfig(LoraPrs::Config &cfg) {
|
||||
|
|
|
@ -26,6 +26,11 @@ Service::Service()
|
|||
|
||||
void Service::setup(const Config &conf)
|
||||
{
|
||||
#ifdef USE_RADIOLIB
|
||||
Serial.println("Built with RadioLib library");
|
||||
#else
|
||||
Serial.println("Built with arudino-LoRa library");
|
||||
#endif
|
||||
config_ = conf;
|
||||
previousBeaconMs_ = 0;
|
||||
|
||||
|
@ -273,7 +278,7 @@ void Service::loop()
|
|||
|
||||
bool Service::isLoraRxBusy() {
|
||||
#ifdef USE_RADIOLIB
|
||||
return cfg_.LoraUseCad && (radio_->getModemStatus() & 0x01); // SX1278_STATUS_SIG_DETECT
|
||||
return config_.LoraUseCad && (radio_->getModemStatus() & 0x01); // SX1278_STATUS_SIG_DETECT
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
#include <Arduino.h>
|
||||
#include <SPI.h>
|
||||
|
||||
// When USE_RADIOLIB is defined then RadioLib will be used, otherwise arduino-LoRa will be used
|
||||
// When using RadioLib, default module is SX1278, if you are using
|
||||
// different module then update loraprs_service.h and loraprs_service.cpp
|
||||
// search for SX1278 and replace with your module name
|
||||
#define USE_RADIOLIB
|
||||
|
||||
#ifdef USE_RADIOLIB
|
||||
#include <RadioLib.h>
|
||||
#pragma message("Using RadioLib")
|
||||
|
|
Ładowanie…
Reference in New Issue