mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-03-18 11:14:51 +01:00
cambio6
This commit is contained in:
parent
d70a35de1c
commit
0af4670dee
|
|
@ -8,10 +8,10 @@ namespace BATTERY_Utils {
|
|||
|
||||
void adcCalibration();
|
||||
void adcCalibrationCheck();
|
||||
|
||||
void setup();
|
||||
float checkInternalVoltage();
|
||||
float checkExternalVoltage();
|
||||
void checkIfShouldSleep(); // ????
|
||||
void startupBatteryHealth();
|
||||
|
||||
String generateEncodedTelemetryBytes(float value, bool firstBytes, byte voltageType);
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ void setup() {
|
|||
delay(STARTUP_DELAY * 60 * 1000);
|
||||
#endif
|
||||
|
||||
// ????? kill ?????
|
||||
#ifdef HELTEC_HTCT62
|
||||
if (Config.lowPowerMode) {
|
||||
gpio_wakeup_enable(GPIO_NUM_3, GPIO_INTR_HIGH_LEVEL);
|
||||
|
|
@ -133,6 +134,7 @@ void setup() {
|
|||
Config.loramodule.rxActive = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
SLEEP_Utils::setup();
|
||||
WIFI_Utils::setup();
|
||||
NTP_Utils::setup();
|
||||
|
|
@ -152,6 +154,7 @@ void loop() {
|
|||
SLEEP_Utils::checkWakeUpFlag();
|
||||
Utils::checkBeaconInterval();
|
||||
STATION_Utils::processOutputPacketBufferUltraEcoMode();
|
||||
Utils::checkSleepByLowBatteryVoltage(1);
|
||||
SLEEP_Utils::startSleeping();
|
||||
} else {
|
||||
WIFI_Utils::checkAutoAPTimeout();
|
||||
|
|
@ -160,10 +163,6 @@ void loop() {
|
|||
ElegantOTA.loop();
|
||||
return; // Don't process IGate and Digi during OTA update
|
||||
}
|
||||
|
||||
if (Config.lowVoltageCutOff > 0) {
|
||||
BATTERY_Utils::checkIfShouldSleep();
|
||||
}
|
||||
|
||||
#ifdef HAS_GPS
|
||||
if (Config.beacon.gpsActive) {
|
||||
|
|
|
|||
|
|
@ -198,15 +198,6 @@ namespace BATTERY_Utils {
|
|||
// return mapVoltage(voltage, 5.05, 6.32, 4.5, 5.5); // mapped voltage
|
||||
}
|
||||
|
||||
void checkIfShouldSleep() {
|
||||
if (lastBatteryCheck == 0 || millis() - lastBatteryCheck >= 15 * 60 * 1000) {
|
||||
lastBatteryCheck = millis();
|
||||
if (checkInternalVoltage() < Config.lowVoltageCutOff) {
|
||||
ESP.deepSleep(1800000000); // 30 min sleep (60s = 60e6)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void startupBatteryHealth() {
|
||||
#ifdef BATTERY_PIN
|
||||
if (Config.battery.monitorInternalVoltage && checkInternalVoltage() < Config.battery.internalSleepVoltage + 0.1) {
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace DIGI_Utils {
|
|||
if (!thirdPartyPacket && !Utils::checkValidCallsign(Sender)) {
|
||||
return;
|
||||
}
|
||||
if (STATION_Utils::check25SegBuffer(Sender, temp.substring(temp.indexOf(":") + 2)) || Config.lowPowerMode) {
|
||||
if (STATION_Utils::check25SegBuffer(Sender, temp.substring(temp.indexOf(":") + 2))) {
|
||||
STATION_Utils::updateLastHeard(Sender);
|
||||
Utils::typeOfPacket(temp, 2); // Digi
|
||||
bool queryMessage = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue