Configuraion improvements

pull/25/head
sh123 2021-10-20 16:30:52 +03:00
rodzic e1520628c5
commit 99603e8906
2 zmienionych plików z 16 dodań i 8 usunięć

Wyświetl plik

@ -19,8 +19,13 @@
#define CFG_LORA_PIN_SS SS
#define CFG_LORA_PIN_RST LORA_RST
#define CFG_LORA_PIN_DIO0 LORA_IRQ
#define CFG_LORA_PIN_DIO1 LORA_IRQ
#define CFG_LORA_USE_ISR false // set to true for incoming packet ISR usage (stream mode, e.g. speech)
#ifdef USE_RADIOLIB
#define CFG_LORA_PIN_DIO1 RADIOLIB_NC // set to your DIO1 pin number if connected
#define CFG_LORA_USE_ISR true
#else
#define CFG_LORA_PIN_DIO1 LORA_IRQ // not used in arduino-LoRa
#define CFG_LORA_USE_ISR false // set to true for ISR usage
#endif
#define CFG_LORA_FREQ 433.775E6
#define CFG_LORA_BW 125e3

Wyświetl plik

@ -1,11 +1,6 @@
#include <arduino-timer.h>
#include "WiFi.h"
// when defined RadioLib will be used, otherwise arduino-LoRa
//#define USE_RADIOLIB
#include "loraprs_service.h"
#if __has_include("/tmp/esp32_loraprs_config.h")
#pragma message("Using external config")
#include "/tmp/esp32_loraprs_config.h"
@ -20,6 +15,14 @@
#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) {
// client/server mode switch
@ -38,7 +41,7 @@ void initializeConfig(LoraPrs::Config &cfg) {
cfg.LoraPinSs = CFG_LORA_PIN_SS;
cfg.LoraPinRst = CFG_LORA_PIN_RST;
cfg.LoraPinDio0 = CFG_LORA_PIN_DIO0;
cfg.LoraPinDio1 = CFG_LORA_PIN_DIO1;
cfg.LoraPinDio1 = CFG_LORA_PIN_DIO1; // valid for radiolib only
cfg.LoraUseIsr = CFG_LORA_USE_ISR; // set to true for incoming packet ISR usage (stream mode, e.g. speech)
// aprs configuration