kopia lustrzana https://github.com/sh123/esp32_loraprs
Small refactoring
rodzic
17a9d652af
commit
e3196d4736
|
@ -1,3 +1,6 @@
|
||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
// Uncomment for SX126X module usage
|
// Uncomment for SX126X module usage
|
||||||
#define USE_SX126X
|
#define USE_SX126X
|
||||||
|
|
||||||
|
@ -113,3 +116,5 @@
|
||||||
#define CFG_TLM_ENABLE false // enable modem battery monitor
|
#define CFG_TLM_ENABLE false // enable modem battery monitor
|
||||||
#define CFG_TLM_BAT_MON_PIN 36 // battery ADC pin
|
#define CFG_TLM_BAT_MON_PIN 36 // battery ADC pin
|
||||||
#define CFG_TLM_BAT_MON_CAL 0.37f // calibration coefficient
|
#define CFG_TLM_BAT_MON_CAL 0.37f // calibration coefficient
|
||||||
|
|
||||||
|
#endif // CONFIG_H
|
|
@ -123,7 +123,6 @@ private:
|
||||||
|
|
||||||
// processor config
|
// processor config
|
||||||
const int CfgConnRetryMs = 500; // connection retry delay, e.g. wifi
|
const int CfgConnRetryMs = 500; // connection retry delay, e.g. wifi
|
||||||
const int CfgPollDelayMs = 20; // main loop delay
|
|
||||||
const int CfgConnRetryMaxTimes = 10; // number of connection retries
|
const int CfgConnRetryMaxTimes = 10; // number of connection retries
|
||||||
const int CfgTelemetryPeriodMs = 60000; // how often to send telemetry event
|
const int CfgTelemetryPeriodMs = 60000; // how often to send telemetry event
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,6 @@ void Service::loop()
|
||||||
if (config_.TlmEnable) {
|
if (config_.TlmEnable) {
|
||||||
telemetryTimer_.tick();
|
telemetryTimer_.tick();
|
||||||
}
|
}
|
||||||
delay(CfgPollDelayMs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Service::isRigRxBusy() {
|
bool Service::isRigRxBusy() {
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#include <arduino-timer.h>
|
#include <arduino-timer.h>
|
||||||
#include <DebugLog.h>
|
#include <DebugLog.h>
|
||||||
#include "WiFi.h"
|
|
||||||
|
|
||||||
#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")
|
||||||
|
@ -18,6 +15,10 @@
|
||||||
#pragma message("Configured for server mode")
|
#pragma message("Configured for server mode")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "loraprs_service.h"
|
||||||
|
|
||||||
|
const int CfgPollDelayMs = 20; // main loop delay
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize config from config.h options.
|
* Initialize config from config.h options.
|
||||||
* Enables future use of EEPROM or allows user to dynamically modify config at run time.
|
* Enables future use of EEPROM or allows user to dynamically modify config at run time.
|
||||||
|
@ -128,4 +129,5 @@ void setup() {
|
||||||
void loop() {
|
void loop() {
|
||||||
loraPrsService.loop();
|
loraPrsService.loop();
|
||||||
watchdogLedTimer.tick();
|
watchdogLedTimer.tick();
|
||||||
|
delay(CfgPollDelayMs);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue