disabled Lora by define

This commit is contained in:
Marcel Peterkau 2023-04-12 22:56:36 +02:00
parent a960e67c7d
commit 3a0e1a931d
2 changed files with 17 additions and 2 deletions

View File

@ -28,6 +28,7 @@ build_flags=
!python git_rev_macro.py
-DATOMIC_FS_UPDATE
;-DFEATURE_ENABLE_WIFI_CLIENT
;-DFEATURE_ENABLE_LORA
;-DCAPTIVE
-DWIFI_AP_IP_GW=10,0,1,1
-DADMIN_PASSWORD=${wifi_cred.admin_password}

View File

@ -17,7 +17,9 @@
#include "globals.h"
#include "dtc.h"
#include "common.h"
#ifdef FEATURE_ENABLE_LORA
#include "lora_net.h"
#endif
#ifdef WIFI_CLIENT
#include <WiFiMulti.h>
@ -46,10 +48,13 @@ void SetBatteryType(batteryType_t type);
void ProcessKeyCombos(bool *btnState);
void OverrideDisplay(const uint8_t *message, uint32_t time);
void initGlobals();
void setMPins_Helper(int pin, int status);
#ifdef FEATURE_ENABLE_LORA
void setMPins_Helper(int pin, int status);
void tmrCallback_StatusSender();
Ticker tmrStatusSender(tmrCallback_StatusSender, 30000, 0, MILLIS);
#endif
void tmrCallback_PowerMonitor();
Ticker tmrPowerMonitor(tmrCallback_PowerMonitor, 10000, 0, MILLIS);
void tmrCallback_FactionTicker();
@ -75,11 +80,12 @@ void initGlobals()
globals.resumeStatus = sysStat_Normal;
globals.systemStatus = sysStat_Startup;
}
#ifdef FEATURE_ENABLE_LORA
void setMPins_Helper(int pin, int status)
{
i2c_io.write(pin, status);
}
#endif
void setup()
{
@ -120,6 +126,7 @@ void setup()
Serial.print("INA219 not Initialized\n");
}
#ifdef FEATURE_ENABLE_LORA
if (InitLoRa(&setMPins_Helper))
{
Serial.printf("Initialized LoRa_Transceiver");
@ -129,6 +136,7 @@ void setup()
{
Serial.print("LoRa not Initialized\n");
}
#endif
#ifdef FEATURE_ENABLE_WIFI_CLIENT
WiFi.mode(WIFI_STA);
@ -218,7 +226,11 @@ void loop()
ArduinoOTA.handle();
SevenSeg_Output();
EEPROM_Process();
#ifdef FEATURE_ENABLE_LORA
tmrStatusSender.update();
LoRa_Process();
#endif
#ifdef CAPTIVE
dnsServer.processNextRequest();
@ -362,10 +374,12 @@ void tmrCallback_InputGetter()
}
}
#ifdef FEATURE_ENABLE_LORA
void tmrCallback_StatusSender()
{
sendStatus_LoRa();
}
#endif
void tmrCallback_PowerMonitor()
{