Set USE_RADIOLIB by default

pull/25/head
sh123 2021-10-22 21:30:09 +03:00
rodzic 3c0558d2eb
commit fc494adda5
3 zmienionych plików z 12 dodań i 7 usunięć

Wyświetl plik

@ -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) {

Wyświetl plik

@ -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

Wyświetl plik

@ -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")