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
-DESP32_DIY_LoRa_A7670
-DHAS_SX1278
-DHAS_A7670
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}
@ -357,6 +358,7 @@ build_flags =
-Werror -Wall
-DESP32_DIY_LoRa_A7670_915
-DHAS_SX1276
-DHAS_A7670
-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
lib_deps =
${common.lib_deps}

View File

@ -6,7 +6,7 @@
#include "display.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_RX_BUFFER 1024 // Set RX buffer to 1Kb
#define SerialAT Serial1

View File

@ -33,7 +33,7 @@ ________________________________________________________________________________
#include "tnc_utils.h"
#include "display.h"
#include "utils.h"
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915)
#ifdef HAS_A7670
#include "A7670_utils.h"
#endif
@ -116,7 +116,7 @@ void setup() {
BME_Utils::setup();
WEB_Utils::setup();
TNC_Utils::setup();
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915)
#ifdef HAS_A7670
A7670_Utils::setup();
#endif
Utils::checkRebootMode();
@ -138,7 +138,7 @@ void loop() {
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();
#else
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();
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915)
#ifdef HAS_A7670
extern bool stationBeacon;
#endif
@ -82,7 +82,7 @@ namespace APRS_IS_Utils {
if (!Config.aprs_is.active) {
aprsisState = "OFF";
} else {
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915)
#ifdef HAS_A7670
if (modemLoggedToAPRSIS) {
aprsisState = "OK";
} else {
@ -217,7 +217,7 @@ namespace APRS_IS_Utils {
display_toggle(true);
}
lastScreenOn = millis();
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915)
#ifdef HAS_A7670
stationBeacon = true;
A7670_Utils::uploadToAPRSIS(aprsPacket);
stationBeacon = false;
@ -250,7 +250,7 @@ namespace APRS_IS_Utils {
Sender += ' ';
}
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);
#else
upload(ackPacket);
@ -268,7 +268,7 @@ namespace APRS_IS_Utils {
}
lastScreenOn = millis();
delay(500);
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915)
#ifdef HAS_A7670
A7670_Utils::uploadToAPRSIS(queryAnswer);
#else
upload(queryAnswer);
@ -305,7 +305,7 @@ namespace APRS_IS_Utils {
}
void listenAPRSIS() {
#if defined(ESP32_DIY_LoRa_A7670) || defined(ESP32_DIY_LoRa_A7670_915)
#ifdef HAS_A7670
A7670_Utils::listenAPRSIS();
#else
if (espClient.connected()) {

View File

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