mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-04-05 14:37:05 +00:00
display repack
This commit is contained in:
parent
be908e2120
commit
6d15a555c7
8 changed files with 156 additions and 156 deletions
|
|
@ -2,11 +2,22 @@
|
|||
#include <Arduino.h>
|
||||
#include "configuration.h"
|
||||
#include "wifi_utils.h"
|
||||
#include "lora_utils.h"
|
||||
#include "display.h"
|
||||
#include "utils.h"
|
||||
|
||||
extern WiFiClient espClient;
|
||||
extern Configuration Config;
|
||||
extern bool statusAfterBoot;
|
||||
extern WiFiClient espClient;
|
||||
extern Configuration Config;
|
||||
extern bool statusAfterBoot;
|
||||
extern String firstLine;
|
||||
extern String secondLine;
|
||||
extern String thirdLine;
|
||||
extern String fourthLine;
|
||||
extern uint32_t lastBeaconTx;
|
||||
extern uint32_t lastScreenOn;
|
||||
extern bool beacon_update;
|
||||
extern int stationMode;
|
||||
extern String iGateBeaconPacket;
|
||||
|
||||
namespace utils {
|
||||
|
||||
|
|
@ -16,4 +27,50 @@ void processStatus() {
|
|||
statusAfterBoot = false;
|
||||
}
|
||||
|
||||
void setupDiplay() {
|
||||
setup_display();
|
||||
firstLine = "LoRa iGate: " + Config.callsign;
|
||||
if (stationMode==3 || stationMode==4) {
|
||||
secondLine = "<DigiRepeater Active>";
|
||||
} else {
|
||||
secondLine = "";
|
||||
}
|
||||
thirdLine = " LoRa Module Ready";
|
||||
fourthLine = " listening...";
|
||||
}
|
||||
|
||||
void checkBeaconInterval() {
|
||||
uint32_t lastTx = millis() - lastBeaconTx;
|
||||
if (lastTx >= Config.beaconInterval*60*1000) {
|
||||
beacon_update = true;
|
||||
}
|
||||
if (beacon_update) {
|
||||
display_toggle(true);
|
||||
thirdLine = "";
|
||||
Serial.println("---- Sending iGate Beacon ----");
|
||||
if (stationMode==3 || stationMode==4) {
|
||||
show_display(firstLine, secondLine, thirdLine, "SENDING iGate BEACON", 0);
|
||||
fourthLine = " listening...";
|
||||
LoRa_Utils::sendNewPacket("APRS",iGateBeaconPacket);
|
||||
} else if (stationMode==1 || stationMode==2) {
|
||||
show_display(firstLine, secondLine, thirdLine, "SENDING iGate BEACON", 1000);
|
||||
fourthLine = " listening...";
|
||||
espClient.write((iGateBeaconPacket + "\n").c_str());
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, 0);
|
||||
}
|
||||
lastBeaconTx = millis();
|
||||
lastScreenOn = millis();
|
||||
beacon_update = false;
|
||||
}
|
||||
}
|
||||
|
||||
void checkDisplayInterval() {
|
||||
uint32_t lastDisplayTime = millis() - lastScreenOn;
|
||||
if (!Config.display.alwaysOn) {
|
||||
if (lastDisplayTime >= Config.display.timeout*1000) {
|
||||
display_toggle(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue