A7670 code cleanup

This commit is contained in:
richonguzman 2024-06-18 19:55:33 -04:00
parent 0feb0045d0
commit d83bb19bc8
5 changed files with 13 additions and 11 deletions

View File

@ -201,6 +201,7 @@ build_flags =
-Werror -Wall -Werror -Wall
-DESP32_DIY_LoRa_A7670 -DESP32_DIY_LoRa_A7670
-DHAS_SX1278 -DHAS_SX1278
-DHAS_A7670
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1 -DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps = lib_deps =
${common.lib_deps} ${common.lib_deps}
@ -357,6 +358,7 @@ build_flags =
-Werror -Wall -Werror -Wall
-DESP32_DIY_LoRa_A7670_915 -DESP32_DIY_LoRa_A7670_915
-DHAS_SX1276 -DHAS_SX1276
-DHAS_A7670
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1 -DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps = lib_deps =
${common.lib_deps} ${common.lib_deps}

View File

@ -6,7 +6,7 @@
#include "display.h" #include "display.h"
#include "utils.h" #include "utils.h"
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
#define TINY_GSM_MODEM_SIM7600 //The AT instruction of A7670 is compatible with SIM7600 #define TINY_GSM_MODEM_SIM7600 //The AT instruction of A7670 is compatible with SIM7600
#define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb #define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb
#define SerialAT Serial1 #define SerialAT Serial1

View File

@ -33,7 +33,7 @@ ________________________________________________________________________________
#include "tnc_utils.h" #include "tnc_utils.h"
#include "display.h" #include "display.h"
#include "utils.h" #include "utils.h"
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
#include "A7670_utils.h" #include "A7670_utils.h"
#endif #endif
@ -116,7 +116,7 @@ void setup() {
BME_Utils::setup(); BME_Utils::setup();
WEB_Utils::setup(); WEB_Utils::setup();
TNC_Utils::setup(); TNC_Utils::setup();
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
A7670_Utils::setup(); A7670_Utils::setup();
#endif #endif
Utils::checkRebootMode(); Utils::checkRebootMode();
@ -138,7 +138,7 @@ void loop() {
WIFI_Utils::checkWiFi(); // Always use WiFi, not related to IGate/Digi mode WIFI_Utils::checkWiFi(); // Always use WiFi, not related to IGate/Digi mode
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
if (Config.aprs_is.active && !modemLoggedToAPRSIS) A7670_Utils::APRS_IS_connect(); if (Config.aprs_is.active && !modemLoggedToAPRSIS) A7670_Utils::APRS_IS_connect();
#else #else
if (Config.aprs_is.active && (WiFi.status() == WL_CONNECTED) && !espClient.connected()) APRS_IS_Utils::connect(); if (Config.aprs_is.active && (WiFi.status() == WL_CONNECTED) && !espClient.connected()) APRS_IS_Utils::connect();

View File

@ -24,7 +24,7 @@ extern bool backUpDigiMode;
uint32_t lastRxTime = millis(); uint32_t lastRxTime = millis();
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
extern bool stationBeacon; extern bool stationBeacon;
#endif #endif
@ -82,7 +82,7 @@ namespace APRS_IS_Utils {
if (!Config.aprs_is.active) { if (!Config.aprs_is.active) {
aprsisState = "OFF"; aprsisState = "OFF";
} else { } else {
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
if (modemLoggedToAPRSIS) { if (modemLoggedToAPRSIS) {
aprsisState = "OK"; aprsisState = "OK";
} else { } else {
@ -217,7 +217,7 @@ namespace APRS_IS_Utils {
display_toggle(true); display_toggle(true);
} }
lastScreenOn = millis(); lastScreenOn = millis();
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
stationBeacon = true; stationBeacon = true;
A7670_Utils::uploadToAPRSIS(aprsPacket); A7670_Utils::uploadToAPRSIS(aprsPacket);
stationBeacon = false; stationBeacon = false;
@ -250,7 +250,7 @@ namespace APRS_IS_Utils {
Sender += ' '; Sender += ' ';
} }
String ackPacket = Config.callsign + ">APLRG1,TCPIP,qAC::" + Sender + ":" + ackMessage; String ackPacket = Config.callsign + ">APLRG1,TCPIP,qAC::" + Sender + ":" + ackMessage;
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
A7670_Utils::uploadToAPRSIS(ackPacket); A7670_Utils::uploadToAPRSIS(ackPacket);
#else #else
upload(ackPacket); upload(ackPacket);
@ -268,7 +268,7 @@ namespace APRS_IS_Utils {
} }
lastScreenOn = millis(); lastScreenOn = millis();
delay(500); delay(500);
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
A7670_Utils::uploadToAPRSIS(queryAnswer); A7670_Utils::uploadToAPRSIS(queryAnswer);
#else #else
upload(queryAnswer); upload(queryAnswer);
@ -305,7 +305,7 @@ namespace APRS_IS_Utils {
} }
void listenAPRSIS() { void listenAPRSIS() {
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
A7670_Utils::listenAPRSIS(); A7670_Utils::listenAPRSIS();
#else #else
if (espClient.connected()) { if (espClient.connected()) {

View File

@ -175,7 +175,7 @@ namespace Utils {
if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) { if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) {
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0); show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0);
seventhLine = " listening..."; seventhLine = " listening...";
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915) #ifdef HAS_A7670
A7670_Utils::uploadToAPRSIS(beaconPacket); A7670_Utils::uploadToAPRSIS(beaconPacket);
#else #else
APRS_IS_Utils::upload(beaconPacket); APRS_IS_Utils::upload(beaconPacket);