kopia lustrzana https://github.com/sh123/esp32_loraprs
Configuraion improvements
rodzic
e1520628c5
commit
99603e8906
9
config.h
9
config.h
|
@ -19,8 +19,13 @@
|
||||||
#define CFG_LORA_PIN_SS SS
|
#define CFG_LORA_PIN_SS SS
|
||||||
#define CFG_LORA_PIN_RST LORA_RST
|
#define CFG_LORA_PIN_RST LORA_RST
|
||||||
#define CFG_LORA_PIN_DIO0 LORA_IRQ
|
#define CFG_LORA_PIN_DIO0 LORA_IRQ
|
||||||
#define CFG_LORA_PIN_DIO1 LORA_IRQ
|
#ifdef USE_RADIOLIB
|
||||||
#define CFG_LORA_USE_ISR false // set to true for incoming packet ISR usage (stream mode, e.g. speech)
|
#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_FREQ 433.775E6
|
||||||
#define CFG_LORA_BW 125e3
|
#define CFG_LORA_BW 125e3
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
#include <arduino-timer.h>
|
#include <arduino-timer.h>
|
||||||
#include "WiFi.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")
|
#if __has_include("/tmp/esp32_loraprs_config.h")
|
||||||
#pragma message("Using external config")
|
#pragma message("Using external config")
|
||||||
#include "/tmp/esp32_loraprs_config.h"
|
#include "/tmp/esp32_loraprs_config.h"
|
||||||
|
@ -20,6 +15,14 @@
|
||||||
#pragma message("Configured for server mode")
|
#pragma message("Configured for server mode")
|
||||||
#endif
|
#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) {
|
void initializeConfig(LoraPrs::Config &cfg) {
|
||||||
|
|
||||||
// client/server mode switch
|
// client/server mode switch
|
||||||
|
@ -38,7 +41,7 @@ void initializeConfig(LoraPrs::Config &cfg) {
|
||||||
cfg.LoraPinSs = CFG_LORA_PIN_SS;
|
cfg.LoraPinSs = CFG_LORA_PIN_SS;
|
||||||
cfg.LoraPinRst = CFG_LORA_PIN_RST;
|
cfg.LoraPinRst = CFG_LORA_PIN_RST;
|
||||||
cfg.LoraPinDio0 = CFG_LORA_PIN_DIO0;
|
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)
|
cfg.LoraUseIsr = CFG_LORA_USE_ISR; // set to true for incoming packet ISR usage (stream mode, e.g. speech)
|
||||||
|
|
||||||
// aprs configuration
|
// aprs configuration
|
||||||
|
|
Ładowanie…
Reference in New Issue