mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-08 13:10:29 +00:00
wrapping up configs
more config work to come...
This commit is contained in:
parent
7ff846e5af
commit
3aa3719ec5
@ -228,19 +228,19 @@ void printLoraDetails() {
|
||||
#ifdef USE_LORA
|
||||
printSmallSectionHeader("LoRa Details:");
|
||||
|
||||
#if defined(LORA_BAND)
|
||||
DBG("LoRa Band used from LORA_BAND : " + String(FDRS_BAND));
|
||||
#elif defined (GLOBAL_LORA_BAND)
|
||||
DBG("LoRa Band used from GLOBAL_LORA_BAND : " + String(FDRS_BAND));
|
||||
#if defined(FDRS_LORA_FREQUENCY)
|
||||
DBG("LoRa frequency used from FDRS_LORA_FREQUENCY : " + String(FDRS_LORA_FREQUENCY));
|
||||
#elif defined (GLOBAL_FDRS_LORA_FREQUENCY)
|
||||
DBG("LoRa frequency used from GLOBAL_FDRS_LORA_FREQUENCY : " + String(FDRS_LORA_FREQUENCY));
|
||||
#else
|
||||
DBG("NO LORA_BAND defined! Please define in fdrs_globals.h (recommended) or in fdrs_sensor_config.h");
|
||||
DBG("NO FDRS_LORA_FREQUENCY defined! Please define in fdrs_globals.h (recommended) or in fdrs_sensor_config.h");
|
||||
//exit(0);
|
||||
#endif //LORA-BAND
|
||||
#endif //LORA-FREQUENCY
|
||||
|
||||
#if defined(LORA_SF)
|
||||
DBG("LoRa SF used from LORA_SF : " + String(FDRS_SF));
|
||||
DBG("LoRa SF used from LORA_SF : " + String(FDRS_LORA_SF));
|
||||
#elif defined (GLOBAL_LORA_SF)
|
||||
DBG("LoRa SF used from GLOBAL_LORA_SF : " + String(FDRS_SF));
|
||||
DBG("LoRa SF used from GLOBAL_LORA_SF : " + String(FDRS_LORA_SF));
|
||||
#else
|
||||
// ASSERT("NO LORA-SF defined! Please define in fdrs_globals.h (recommended) or in fdrs_sensor_config.h");
|
||||
DBG("NO LORA_SF defined! Please define in fdrs_globals.h (recommended) or in fdrs_sensor_config.h");
|
||||
@ -248,9 +248,9 @@ void printLoraDetails() {
|
||||
#endif //LORA_SF
|
||||
|
||||
#if defined(LORA_TXPWR)
|
||||
DBG("LoRa TXPWR used from LORA_TXPWR : " + String(FDRS_TXPWR));
|
||||
DBG("LoRa TXPWR used from LORA_TXPWR : " + String(FDRS_LORA_TXPWR));
|
||||
#elif defined (GLOBAL_LORA_TXPWR)
|
||||
DBG("LoRa TXPWR used from GLOBAL_LORA_TXPWR : " + String(FDRS_TXPWR));
|
||||
DBG("LoRa TXPWR used from GLOBAL_LORA_TXPWR : " + String(FDRS_LORA_TXPWR));
|
||||
#else
|
||||
// ASSERT("NO LORA-TXPWR defined! Please define in fdrs_globals.h (recommended) or in fdrs_sensor_config.h");
|
||||
DBG("NO LORA_TXPWR defined! Please define in fdrs_globals.h (recommended) or in fdrs_sensor_config.h");
|
||||
|
@ -76,6 +76,12 @@ enum {
|
||||
|
||||
|
||||
#ifdef USE_WIFI
|
||||
// Internal Globals
|
||||
// Default values that are assigned if none are present in config
|
||||
|
||||
#define GLOBAL_ACK_TIMEOUT 400 // LoRa ACK timeout in ms. (Minimum = 200)
|
||||
#define GLOBAL_LORA_RETRIES 2 // LoRa ACK automatic retries [0 - 3]
|
||||
#define GLOBAL_LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
|
||||
// select WiFi SSID configuration
|
||||
#if defined(WIFI_SSID)
|
||||
@ -150,6 +156,11 @@ enum {
|
||||
#define FDRS_LORA_SF GLOBAL_LORA_SF
|
||||
#endif //LORA_SF
|
||||
|
||||
// select LoRa ACK configuration
|
||||
#if defined(LORA_ACK) || defined(GLOBAL_LORA_ACK)
|
||||
#define FDRS_LORA_ACK
|
||||
#endif //LORA_ACK
|
||||
|
||||
// select LoRa ACK Timeout configuration
|
||||
#if defined(LORA_ACK_TIMEOUT)
|
||||
#define FDRS_ACK_TIMEOUT LORA_ACK_TIMEOUT
|
||||
|
@ -102,7 +102,7 @@ void begin_lora() {
|
||||
// SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
|
||||
// #endif
|
||||
#ifdef USE_LORA
|
||||
int state = radio.begin(FDRS_LORA_BAND, FDRS_LORA_BANDWIDTH, FDRS_LORA_SF, FDRS_LORA_CR, FDRS_LORA_SYNCWORD, FDRS_LORA_TXPWR, 8, 1);
|
||||
int state = radio.begin(FDRS_LORA_FREQUENCY, FDRS_LORA_BANDWIDTH, FDRS_LORA_SF, FDRS_LORA_CR, FDRS_LORA_SYNCWORD, FDRS_LORA_TXPWR, 8, 1);
|
||||
if (state == RADIOLIB_ERR_NONE) {
|
||||
DBG("RadioLib initialization successful!");
|
||||
} else {
|
||||
|
@ -40,6 +40,11 @@
|
||||
#define FDRS_LORA_SF GLOBAL_LORA_SF
|
||||
#endif //LORA_SF
|
||||
|
||||
// select LoRa ACK configuration
|
||||
#if defined(LORA_ACK) || defined(GLOBAL_LORA_ACK)
|
||||
#define FDRS_LORA_ACK
|
||||
#endif //LORA_ACK
|
||||
|
||||
// select LoRa ACK Timeout configuration
|
||||
#if defined(LORA_ACK_TIMEOUT)
|
||||
#define FDRS_ACK_TIMEOUT LORA_ACK_TIMEOUT
|
||||
@ -59,7 +64,7 @@
|
||||
#define FDRS_LORA_TXPWR LORA_TXPWR
|
||||
#else
|
||||
#define FDRS_LORA_TXPWR GLOBAL_LORA_TXPWR
|
||||
#endif //LORA_RETRIES
|
||||
#endif //LORA_TXPWR
|
||||
|
||||
// select LoRa BANDWIDTH configuration
|
||||
#if defined(LORA_BANDWIDTH)
|
||||
@ -236,7 +241,7 @@ void
|
||||
// SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
|
||||
// #endif
|
||||
#ifdef USE_LORA
|
||||
int state = radio.begin(FDRS_LORA_BAND, FDRS_LORA_BANDWIDTH, FDRS_LORA_SF, FDRS_LORA_CR, FDRS_LORA_SYNCWORD, FDRS_LORA_TXPWR, 8, 1);
|
||||
int state = radio.begin(FDRS_LORA_FREQUENCY, FDRS_LORA_BANDWIDTH, FDRS_LORA_SF, FDRS_LORA_CR, FDRS_LORA_SYNCWORD, FDRS_LORA_TXPWR, 8, 1);
|
||||
if (state == RADIOLIB_ERR_NONE) {
|
||||
DBG("RadioLib initialization successful!");
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user