globals.h

This commit is contained in:
2026-01-07 16:29:40 +01:00
parent f0abda9158
commit 68d76e0959
16 changed files with 853 additions and 844 deletions
+1 -15
View File
@@ -1,25 +1,11 @@
#pragma once
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiUdp.h>
#include "ESP32Time.h"
#include "TimeLib.h"
#include "TEF6686.h"
#include "globals.h"
static const char ntpServerName[] = "0.pool.ntp.org";
static const int localPort = 8944;
const int NTP_PACKET_SIZE = 48;
extern ESP32Time rtc;
extern WiFiClient RemoteClient;
extern WiFiUDP Udp;
extern TEF6686 radio;
extern bool wifi;
extern bool NTPupdated;
extern bool rtcset;
void sendNTPpacket(IPAddress &address);
void NTPupdate();
time_t getNtpTime();
+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include <Arduino.h>
template <typename T, size_t MaxObservers>
class Detector {
public:
explicit Detector(T initial) : value(initial) {
for (size_t i = 0; i < MaxObservers; ++i) seen[i] = false;
}
void set(const T& v) {
if (v == value) return;
value = v;
for (size_t i = 0; i < MaxObservers; ++i) seen[i] = false;
}
bool changed(size_t id) {
if (id >= MaxObservers) return false;
if (!seen[id]) {
seen[id] = true;
return true;
}
return false;
}
const T& get() const {
return value;
}
private:
T value;
bool seen[MaxObservers];
};
+1 -126
View File
@@ -1,132 +1,7 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include <WiFiClient.h>
#include "TEF6686.h"
#include <WiFi.h>
#include "globals.h"
#include <Hash.h>
#include "WiFiConnect.h"
#include "WiFiConnectParam.h"
extern bool advancedRDS;
extern bool afscreen;
extern bool aftest;
extern bool autosquelch;
extern bool BWreset;
extern bool Data_Accelerator;
extern bool direction;
extern bool externaltune;
extern bool fullsearchrds;
extern bool menu;
extern bool RDSSPYTCP;
extern bool RDSSPYUSB;
extern bool RDSstatus;
extern bool scandxmode;
extern bool screenmute;
extern bool seek;
extern bool setupmode;
extern bool softmuteam;
extern bool softmutefm;
extern bool SQ;
extern bool StereoToggle;
extern bool store;
extern bool usesquelch;
extern bool wifi;
extern bool wificonnected;
extern bool XDRGTKdata;
extern bool XDRGTKTCP;
extern bool XDRGTKUSB;
extern bool XDRGTKMuteScreen;
extern bool XDRScan;
extern bool XDRMute;
extern byte band;
extern byte audiomode;
extern byte BWset;
extern byte BWsetRecall;
extern byte EQset;
extern byte fmagc;
extern byte fmscansens;
extern byte iMSEQ;
extern byte iMSset;
extern byte language;
extern byte memorypos;
extern byte scanhold;
extern byte stepsize;
extern byte subnetclient;
extern byte TEF;
extern byte tunemode;
extern char buff[16];
extern int ActiveColor;
extern int ActiveColorSmooth;
extern int BackgroundColor;
extern byte fmdeemphasis;
extern int freqold;
extern int GreyoutColor;
extern int InsignificantColor;
extern int InsignificantColorSmooth;
extern int PrimaryColor;
extern int PrimaryColorSmooth;
extern int RDSColor;
extern int RDSColorSmooth;
extern int RDSDropoutColor;
extern int RDSDropoutColorSmooth;
extern int scanner_filter;
extern int SignificantColor;
extern int SignificantColorSmooth;
extern int Squelch;
extern int Squelchold;
extern int Stereostatus;
extern int XDRBWset;
extern int XDRBWsetold;
extern int16_t OStatus;
extern int16_t SStatus;
extern int8_t LowLevelSet;
extern int8_t VolSet;
extern IPAddress remoteip;
extern String cryptedpassword;
extern String salt;
extern String saltkey;
extern String StereoStatusCommand;
extern String StereoStatusCommandold;
extern String XDRGTK_key;
extern uint16_t BW;
extern uint16_t MStatus;
extern uint16_t USN;
extern uint16_t WAM;
extern uint8_t buff_pos;
extern int8_t CN;
extern unsigned int ConverterSet;
extern unsigned int freq_scan;
extern unsigned int frequency;
extern unsigned int frequency_OIRT;
extern unsigned int frequency_LW;
extern unsigned int frequency_AM;
extern unsigned int frequency_MW;
extern unsigned int frequency_SW;
extern unsigned int frequencyold;
extern unsigned int HighEdgeOIRTSet;
extern unsigned int LowEdgeOIRTSet;
extern unsigned int LWHighEdgeSet;
extern unsigned int LWLowEdgeSet;
extern unsigned int MWHighEdgeSet;
extern unsigned int MWLowEdgeSet;
extern unsigned int scanner_end;
extern unsigned int scanner_start;
extern unsigned int scanner_step;
extern unsigned int SWHighEdgeSet;
extern unsigned int SWLowEdgeSet;
extern unsigned long aftimer;
extern unsigned long signalstatustimer;
extern byte amagc;
extern TFT_eSPI tft;
extern TEF6686 radio;
extern WiFiClient RemoteClient;
extern WiFiUDP Udp;
extern WiFiServer Server;
extern WiFiConnect wc;
extern WebServer webserver;
void Communication();
void XDRGTKRoutine();
+402
View File
@@ -0,0 +1,402 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include "TEF6686.h"
#include "constants.h"
#include "change_detector.h"
#include "language.h"
#include <WiFi.h>
#include <WiFiUdp.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include "WiFiConnect.h"
#include "WiFiConnectParam.h"
#include "ESP32Time.h"
#define ROTARY_PIN_A 34
#define ROTARY_PIN_B 36
#define ROTARY_BUTTON 39
#define PIN_POT 35
#define BATTERY_PIN 13
#define BANDBUTTON 4
#define BWBUTTON 25
#define MODEBUTTON 26
#define CONTRASTPIN 2
#define STANDBYLED 19
#define SMETERPIN 27
#define TOUCHIRQ 33
#define EXT_IRQ 14
#define DYNAMIC_SPI_SPEED
extern bool RDSstatus;
extern bool RDSstatusold;
extern TFT_eSPI tft;
extern bool dynamicspi;
extern bool Data_Accelerator;
extern bool advancedRDS, afmethodBold, afpage;
extern bool afscreen, aftest, artheadold;
extern bool autoDST, autolog, autologged;
extern bool autosquelch, batterydetect, beepresetstart;
extern bool beepresetstop, BWreset, bwtouchtune;
extern bool BWtune, change, clockampm;
extern bool compressedold, direction, dropout;
extern bool dynamicPTYold, edgebeep, externaltune;
extern bool findMemoryAF;
extern bool firstTouchHandled;
extern bool flashing;
extern bool fmsi, fullsearchrds;
extern bool hasafold, hasCTold, haseonold;
extern bool hasrtplusold, hastmcold;
extern bool initdxscan, invertdisplay, leave;
extern bool LowLevelInit;
extern bool memorystore;
extern bool memreset, memtune;
extern bool menu, menuopen;
extern bool mwstepsize;
extern bool nobattery;
extern bool NTPupdated;
extern bool optenc;
extern bool rdsflagreset;
extern bool rdsreset;
extern bool rdsstatscreen;
extern bool RDSSPYTCP, RDSSPYUSB;
extern bool rdsstereoold;
extern bool rotaryaccelerate;
extern bool rtcset;
extern bool scandxmode;
extern bool scanholdflag;
extern bool scanholdonsignal;
extern bool scanmem;
extern bool scanmute;
extern bool screenmute;
extern bool screensavertriggered;
extern bool seek;
extern bool seekinit;
extern bool setextendbw;
extern bool setupmode;
extern bool showclock;
extern bool showlongps;
extern bool usesquelch;
extern bool softmuteam;
extern bool softmutefm;
extern bool SQ;
extern bool Stereostatusold;
extern bool StereoToggle;
extern bool store;
extern bool TAold, TPold;
extern bool touchrepeat;
extern bool touch_detect;
extern bool tuned;
extern bool USBmode;
extern bool XDRGTKdata;
extern bool XDRGTKMuteScreen;
extern bool XDRGTKTCP, XDRGTKUSB;
extern bool XDRMute, XDRScan;
extern bool wifi, wificonnected;
extern byte af_counterold;
extern byte aid_counterold;
extern byte af;
extern byte afpagenr;
extern byte amagc;
extern byte amnb;
extern byte amscansens;
extern byte audiomode;
extern byte band;
extern byte bandAM;
extern byte bandFM;
extern byte bandforbidden;
extern byte battery;
extern byte batteryold;
extern byte batteryoptions;
extern byte BWset;
extern byte BWsettemp;
extern byte BWsetAM;
extern byte BWsetFM;
extern byte BWsetRecall;
extern byte BWtemp;
extern byte charwidth;
extern byte chipmodel;
extern byte hardwaremodel;
extern byte ContrastSet;
extern byte CurrentSkin;
extern byte CurrentTheme;
extern byte displayflip;
extern byte ECCold;
extern byte eonptyold[20];
extern byte EQset;
extern byte fmagc;
extern byte fmscansens;
extern byte fmdefaultstepsize;
extern byte fmnb;
extern byte fmdeemphasis;
extern byte freqfont;
extern byte amcodect;
extern byte amcodectcount;
extern byte amgain;
extern byte freqoldcount;
extern byte HighCutLevel;
extern byte HighCutOffset;
extern byte items[10];
extern byte iMSEQ;
extern byte iMSset;
extern byte language;
extern byte longbandpress;
extern byte memdoublepi;
extern byte memorypos;
extern byte memoryposold;
extern byte memoryposstatus;
extern byte mempionly;
extern byte memstartpos;
extern byte memstoppos;
extern byte menuitem;
extern byte menupage;
extern byte poweroptions;
extern byte rdsblockold;
extern byte rdsqualityold;
extern byte rotarymode;
extern byte touchrotating;
extern byte scancancel;
extern byte scanstart;
extern byte scanstop;
extern byte scanhold;
extern byte scanmodeold;
extern byte screensaverOptions[5];
extern byte screensaverset;
extern byte showmodulation;
extern byte showrdserrors;
extern byte showSWMIBand;
extern byte submenu;
extern byte stationlistid;
extern byte nowToggleSWMIBand;
extern byte stepsize;
extern byte StereoLevel;
extern byte subnetclient;
extern byte TEF, tot, tunemode;
extern byte unit, spispeed, programTypePrevious;
extern char buff[16];
extern char eonpicodeold[20][6];
extern const uint8_t* currentFont;
extern float vPerold;
extern int ActiveColor;
extern int ActiveColorSmooth;
extern int AGC;
extern int AMLevelOffset;
extern int BackgroundColor;
extern int BackgroundColor1;
extern int BackgroundColor2;
extern int BackgroundColor3;
extern int BackgroundColor4;
extern int BackgroundColor5;
extern int BarSignificantColor;
extern int BarInsignificantColor;
extern int BatteryValueColor;
extern int BatteryValueColorSmooth;
extern int batupdatetimer;
extern int berPercentold;
extern int BWAutoColor;
extern int BWAutoColorSmooth;
extern int BWOld;
extern int bwupdatetimer;
extern int DisplayedSegments;
extern int ForceMono;
extern int FrameColor;
extern int FreqColor;
extern int FreqColorSmooth;
extern int freq_in;
extern int freqold;
extern int GreyoutColor;
extern int InsignificantColor;
extern int InsignificantColorSmooth;
extern int menuoption;
extern int ModBarInsignificantColor;
extern int ModBarSignificantColor;
extern int MStatusold;
extern int offsetupdatetimer;
extern int OStatusold;
extern int peakholdold;
extern int peakholdtimer;
extern int PrimaryColor;
extern int PrimaryColorSmooth;
extern int RDSColor, RDSColorSmooth;
extern int RDSDropoutColor, RDSDropoutColorSmooth;
extern int SignificantColor;
extern int SignificantColorSmooth;
extern int StereoColor;
extern int StereoColorSmooth;
extern int WifiColorHigh;
extern int WifiColorLow;
extern int SquelchShow;
extern int rotary;
extern int rotarycounter;
extern int rotarycounteraccelerator;
extern int rssi;
extern int rssiold;
extern int scanner_filter;
extern int SecondaryColor;
extern int SecondaryColorSmooth;
extern int SNRupdatetimer;
extern int Sqstatusold;
extern int Squelch;
extern int Squelchold;
extern int SStatusold;
extern int Stereostatus;
extern int volume;
extern int XDRBWset;
extern int XDRBWsetold;
extern int xPos;
extern int xPos2;
extern int xPos3;
extern int xPos4;
extern int xPos5;
extern int xPos6;
extern int16_t OStatus;
extern int16_t SAvg;
extern int16_t SAvg2;
extern int16_t SAvg3;
extern int16_t SAvg4;
extern int16_t SAvg5;
extern int16_t SStatus;
extern int16_t MP;
extern int16_t US;
extern int8_t MPold;
extern int8_t USold;
extern int8_t LevelOffset;
extern int8_t LowLevelSet;
extern int8_t NTPoffset;
extern int8_t CN;
extern int8_t CNold;
extern int8_t VolSet;
extern float batteryVold;
extern IPAddress remoteip;
extern String AIDString;
extern String cryptedpassword;
extern String ECColdString;
extern String ECCString;
extern String eonpsold[20];
extern String PIold;
extern String PSold;
extern String ptynold;
extern String PTYold;
extern String rds_clock;
extern String rds_clockold;
extern String rds_date;
extern String rds_dateold;
extern String RDSSPYRDS;
extern String RDSSPYRDSold;
extern String RTold;
extern String salt;
extern String saltkey;
extern String stationIDold;
extern String stationStateold;
extern String StereoStatusCommand;
extern String StereoStatusCommandold;
extern String SWMIBandstring;
extern String SWMIBandstringold;
extern String XDRGTK_key;
extern String XDRGTKRDS;
extern String XDRGTKRDSold;
extern uint16_t BW;
extern uint16_t MStatus;
extern uint16_t SWMIBandPos;
extern uint16_t SWMIBandPosold;
extern uint16_t TouchCalData[5];
extern uint16_t USN;
extern uint16_t WAM;
extern uint8_t buff_pos;
extern unsigned int ConverterSet;
extern unsigned int freq_scan;
extern unsigned int frequency;
extern unsigned int frequency_OIRT;
extern unsigned int frequency_AM;
extern unsigned int frequency_LW;
extern unsigned int frequency_MIBand_11M;
extern unsigned int frequency_MIBand_120M;
extern unsigned int frequency_MIBand_13M;
extern unsigned int frequency_MIBand_15M;
extern unsigned int frequency_MIBand_160M;
extern unsigned int frequency_MIBand_16M;
extern unsigned int frequency_MIBand_19M;
extern unsigned int frequency_MIBand_22M;
extern unsigned int frequency_MIBand_25M;
extern unsigned int frequency_MIBand_31M;
extern unsigned int frequency_MIBand_41M;
extern unsigned int frequency_MIBand_49M;
extern unsigned int frequency_MIBand_60M;
extern unsigned int frequency_MIBand_75M;
extern unsigned int frequency_MIBand_90M;
extern unsigned int frequency_MW;
extern unsigned int frequency_SW;
extern unsigned int frequencyold;
extern unsigned int HighEdgeOIRTSet;
extern unsigned int HighEdgeSet;
extern unsigned int LowEdgeOIRTSet;
extern unsigned int logcounter;
extern unsigned int LowEdgeSet;
extern unsigned int LWHighEdgeSet;
extern unsigned int LWLowEdgeSet;
extern unsigned int mappedfreqold[20];
extern unsigned int mappedfreqold2[20];
extern unsigned int mappedfreqold3[20];
extern unsigned int memstartfreq;
extern unsigned int memstopfreq;
extern unsigned int MWHighEdgeSet;
extern unsigned int MWLowEdgeSet;
extern unsigned int scanner_end;
extern unsigned int scanner_start;
extern unsigned int scanner_step;
extern unsigned int SWHighEdgeSet;
extern unsigned int SWLowEdgeSet;
extern unsigned long afticker;
extern unsigned long aftickerhold;
extern unsigned long aftimer;
extern unsigned long autosquelchtimer;
extern unsigned long blockcounterold[33];
extern unsigned long eccticker;
extern unsigned long ecctickerhold;
extern unsigned long eonticker;
extern unsigned long eontickerhold;
extern unsigned long flashingtimer;
extern unsigned long keypadtimer;
extern unsigned long lastTouchTime;
extern unsigned long lowsignaltimer;
extern unsigned long ModulationpreviousMillis;
extern unsigned long ModulationpeakPreviousMillis;
extern unsigned long NTPtimer;
extern unsigned long peakholdmillis;
extern unsigned long processed_rdsblocksold[33];
extern unsigned long pslongticker;
extern unsigned long pslongtickerhold;
extern unsigned long rtplusticker;
extern unsigned long rtplustickerhold;
extern unsigned long rtticker;
extern unsigned long rttickerhold;
extern unsigned long rotarytimer;
extern unsigned long scantimer;
extern unsigned long screensavertimer;
extern unsigned long signalstatustimer;
extern unsigned long tottimer;
extern unsigned long tuningtimer;
extern unsigned long udplogtimer;
extern unsigned long udptimer;
extern const size_t language_totalnumber;
extern const size_t language_entrynumber;
extern mem presets[EE_PRESETS_CNT];
extern TEF6686 radio;
extern ESP32Time rtc;
extern TFT_eSprite FrequencySprite;
extern TFT_eSprite RDSSprite;
extern TFT_eSprite SquelchSprite;
extern TFT_eSprite FullLineSprite;
extern TFT_eSprite OneBigLineSprite;
extern TFT_eSprite SignalSprite;
extern TFT_eSprite PSSprite;
extern WiFiConnect wc;
extern WiFiServer Server;
extern WiFiClient RemoteClient;
extern WiFiUDP Udp;
extern WebServer webserver;
+2 -215
View File
@@ -1,10 +1,7 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include "TEF6686.h"
#include "WiFiConnect.h"
#include "WiFiConnectParam.h"
#include "globals.h"
#include "utils.h"
#include "menugraphics.h"
static const char* const unitString[] = {"dBμV", "dBf", "dBm"};
@@ -14,215 +11,6 @@ static const char* const Skin[] = {"Essential"};
static const char* BWButtonLabelsFM[] = {"56 kHz", "64 kHz", "72 kHz", "84 kHz", "97 kHz", "114 kHz", "133 kHz", "151 kHz", "168 kHz", "184 kHz", "200 kHz", "217 kHz", "236 kHz", "254 kHz", "287 kHz", "311 kHz", "Auto", "iMS", "EQ"};
static const char* BWButtonLabelsAM[] = {"3 kHz", "4 kHz", "6 kHz", "8 kHz"};
#define SMETERPIN 27
#define CONTRASTPIN 2
extern bool advancedRDS;
extern bool afmethodBold;
extern bool afpage;
extern bool afscreen;
extern bool artheadold;
extern bool autoDST;
extern bool autolog;
extern bool autosquelch;
extern bool BWreset;
extern bool BWtune;
extern bool change;
extern bool clockampm;
extern bool compressedold;
extern bool dropout;
extern bool dynamicPTYold;
extern bool dynamicspi;
extern bool edgebeep;
extern bool fmsi;
extern bool fullsearchrds;
extern bool hasafold;
extern bool haseonold;
extern bool hasrtplusold;
extern bool hastmcold;
extern bool LowLevelInit;
extern bool menu;
extern bool menuopen;
extern bool mwstepsize;
extern bool rdsreset;
extern bool RDSstatus;
extern bool RDSstatusold;
extern bool rdsstatscreen;
extern bool rdsstereoold;
extern bool usesquelch;
extern bool scandxmode;
extern bool scanholdonsignal;
extern bool scanmem;
extern bool scanmute;
extern bool setupmode;
extern bool showclock;
extern bool showlongps;
extern bool softmuteam;
extern bool softmutefm;
extern bool Stereostatusold;
extern bool StereoToggle;
extern bool TAold;
extern bool TPold;
extern bool USBmode;
extern bool XDRGTKMuteScreen;
extern bool wifi;
extern byte af;
extern byte af_counterold;
extern byte afpagenr;
extern byte amagc;
extern byte amnb;
extern byte amscansens;
extern byte audiomode;
extern byte band;
extern byte bandAM;
extern byte bandFM;
extern byte bandforbidden;
extern byte batteryold;
extern byte batteryoptions;
extern byte BWset;
extern byte BWsettemp;
extern byte ContrastSet;
extern byte CurrentSkin;
extern byte CurrentTheme;
extern byte ECCold;
extern byte fmagc;
extern byte fmscansens;
extern byte fmdefaultstepsize;
extern byte fmnb;
extern byte fmdeemphasis;
extern byte freqfont;
extern byte EQset;
extern byte iMSset;
extern byte amcodect;
extern byte amcodectcount;
extern byte amgain;
extern byte hardwaremodel;
extern byte HighCutLevel;
extern byte HighCutOffset;
extern byte items[10];
extern byte language;
extern byte longbandpress;
extern byte memorypos;
extern byte memdoublepi;
extern byte mempionly;
extern byte memstartpos;
extern byte memstoppos;
extern byte menuitem;
extern byte menupage;
extern byte poweroptions;
extern byte eonptyold[20];
extern byte rdsblockold;
extern byte scancancel;
extern byte scanstart;
extern byte scanstop;
extern byte scanhold;
extern byte scanmodeold;
extern byte screensaverOptions[5];
extern byte screensaverset;
extern byte showmodulation;
extern byte showSWMIBand;
extern byte showrdserrors;
extern byte stationlistid;
extern int8_t CNold;
extern byte StereoLevel;
extern byte StereoLevel;
extern byte submenu;
extern byte subnetclient;
extern byte TEF;
extern byte tot;
extern byte touchrotating;
extern byte tunemode;
extern byte unit;
extern byte spispeed;
extern char eonpicodeold[20][6];
extern byte programTypePrevious;
extern float batteryVold;
extern float vPerold;
extern int ActiveColor;
extern int ActiveColorSmooth;
extern int AMLevelOffset;
extern int BackgroundColor;
extern int BackgroundColor1;
extern int BackgroundColor2;
extern int BackgroundColor3;
extern int BackgroundColor4;
extern int BackgroundColor5;
extern int BarInsignificantColor;
extern int BarSignificantColor;
extern int BatteryValueColor;
extern int BatteryValueColorSmooth;
extern int berPercentold;
extern int BWAutoColor;
extern int BWAutoColorSmooth;
extern int FrameColor;
extern int FreqColor;
extern int FreqColorSmooth;
extern int GreyoutColor;
extern int InsignificantColor;
extern int InsignificantColorSmooth;
extern int menuoption;
extern int ModBarInsignificantColor;
extern int ModBarSignificantColor;
extern int PrimaryColor;
extern int PrimaryColorSmooth;
extern int RDSColor;
extern int RDSColorSmooth;
extern int RDSDropoutColor;
extern int RDSDropoutColorSmooth;
extern int rssiold;
extern int SecondaryColor;
extern int SecondaryColorSmooth;
extern int SignificantColor;
extern int SignificantColorSmooth;
extern int Squelchold;
extern int SStatusold;
extern int StereoColor;
extern int StereoColorSmooth;
extern int WifiColorHigh;
extern int WifiColorLow;
extern int xPos;
extern int xPos2;
extern int xPos3;
extern int xPos4;
extern int xPos5;
extern int16_t SStatus;
extern int8_t LevelOffset;
extern int8_t LowLevelSet;
extern int8_t MPold;
extern int8_t USold;
extern int8_t NTPoffset;
extern int8_t VolSet;
extern String eonpsold[20];
extern String PIold;
extern String PSold;
extern String ptynold;
extern String rds_clockold;
extern String stationIDold;
extern String stationStateold;
extern String XDRGTK_key;
extern unsigned int ConverterSet;
extern unsigned int HighEdgeSet;
extern unsigned int LowEdgeSet;
extern unsigned int mappedfreqold[20];
extern unsigned int mappedfreqold2[20];
extern unsigned int mappedfreqold3[20];
extern unsigned int memstartfreq;
extern unsigned int memstopfreq;
extern unsigned long blockcounterold[33];
extern unsigned long processed_rdsblocksold[33];
extern unsigned long scantimer;
extern byte items[10];
extern const size_t language_totalnumber;
extern TFT_eSPI tft;
extern TEF6686 radio;
extern WiFiConnect wc;
extern TFT_eSprite MenuInfobox;
extern TFT_eSprite FullLineSprite;
extern TFT_eSprite OneBigLineSprite;
extern TFT_eSprite PSSprite;
extern TFT_eSprite FrequencySprite;
void BuildAFScreen();
void BuildRDSStatScreen();
void BuildMenu();
@@ -234,7 +22,6 @@ void DoMenu();
void doTheme();
void Infoboxprint(const char* input);
void drawButton(const char* text, byte button_number, bool active, bool selected);
String removeNewline(String inputString);
String shortLine(String text);
void showMenuOpenTouchButtons();
void showBWSelector();
+1 -26
View File
@@ -1,35 +1,10 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include <WiFi.h>
#include <FS.h>
using fs::FS;
#include <WebServer.h>
#include <SPIFFS.h>
#include "TEF6686.h"
extern bool autoDST;
extern bool clockampm;
extern bool NTPupdated;
extern bool rtcset;
extern bool scandxmode;
extern byte band;
extern byte chipmodel;
extern byte language;
extern byte scanhold;
extern byte unit;
extern int16_t SStatus;
extern int8_t NTPoffset;
extern unsigned int ConverterSet;
extern unsigned int frequency;
extern unsigned int frequency_OIRT;
extern unsigned int logcounter;
extern IPAddress remoteip;
extern TEF6686 radio;
extern WebServer webserver;
extern WiFiUDP Udp;
#include "globals.h"
void handleRoot();
void handleDownloadCSV();
+1 -1
View File
@@ -6,6 +6,7 @@
#include "TEF6686.h"
#include <WiFi.h>
#include <ESP32Time.h>
#include "globals.h"
extern bool advancedRDS;
extern bool afmethodBold;
@@ -31,7 +32,6 @@ extern bool NTPupdated;
extern bool rdsreset;
extern bool RDSSPYTCP;
extern bool RDSSPYUSB;
extern bool RDSstatus;
extern bool rdsstatscreen;
extern bool rdsstereoold;
extern bool rtcset;
+1 -20
View File
@@ -1,25 +1,6 @@
#pragma once
#include <Arduino.h>
#include <TFT_eSPI.h>
#include "TEF6686.h"
extern TFT_eSPI tft;
extern TEF6686 radio;
extern bool advancedRDS, afpage, afscreen;
extern bool bwtouchtune, BWtune, leave;
extern bool menu, menuopen, scandxmode;
extern bool seek, touchrepeat;
extern bool XDRGTKTCP, XDRGTKUSB;
extern byte afpagenr;
extern byte band;
extern byte BWset, BWtemp;
extern byte EQset, iMSEQ, iMSset;
extern byte menuitem;
extern byte items[10];
extern byte menupage;
extern int menuoption;
#include "globals.h"
void doTouchEvent(uint16_t x, uint16_t y);
+2 -1
View File
@@ -14,4 +14,5 @@ uint16_t HSVtoRGB565(float h, float s, float v);
String convertToUTF8(const wchar_t* input);
String trimTrailingSpaces(String str);
String ucs2ToUtf8(const char* ucs2Input);
String extractUTF8Substring(const String & utf8String, size_t start, size_t length, bool underscore);
String extractUTF8Substring(const String & utf8String, size_t start, size_t length, bool underscore);
String removeNewline(String inputString);
+1 -3
View File
@@ -1,10 +1,8 @@
#include "TEF6686.h"
#include "globals.h"
#include "Tuner_Patch_Lithio_V102_p224.h"
#include "Tuner_Patch_Lithio_V205_p512.h"
#include <Wire.h>
bool Data_Accelerator = false;
const unsigned char tuner_init_tab[] PROGMEM = {
9, 0x20, 0x36, 0x01, 0x00, 0x00, 0x01, 0x68, 0x01, 0x2C,
7, 0x20, 0x37, 0x01, 0x00, 0x00, 0x0F, 0xA0,
-1
View File
@@ -1,5 +1,4 @@
#include "comms.h"
#include "constants.h"
#include <EEPROM.h>
extern mem presets[];
+383
View File
@@ -0,0 +1,383 @@
#include "globals.h"
bool RDSstatus;
bool RDSstatusold;
#ifdef ARS
TFT_eSPI tft = TFT_eSPI(320, 240);
#else
TFT_eSPI tft = TFT_eSPI(240, 320);
#endif
#ifdef DYNAMIC_SPI_SPEED
bool dynamicspi = true;
#else
bool dynamicspi = false;
#endif
bool Data_Accelerator = false;
bool advancedRDS, afmethodBold, afpage;
bool afscreen, aftest, artheadold;
bool autoDST, autolog, autologged;
bool autosquelch = true, batterydetect = true, beepresetstart;
bool beepresetstop, BWreset, bwtouchtune;
bool BWtune, change, clockampm;
bool compressedold, direction, dropout;
bool dynamicPTYold, edgebeep, externaltune;
bool findMemoryAF;
bool firstTouchHandled = false;
bool flashing;
bool fmsi, fullsearchrds;
bool hasafold, hasCTold, haseonold;
bool hasrtplusold, hastmcold;
bool initdxscan, invertdisplay, leave;
bool LowLevelInit;
bool memorystore;
bool memreset, memtune;
bool menu, menuopen;
bool mwstepsize;
bool nobattery;
bool NTPupdated;
bool optenc;
bool rdsflagreset;
bool rdsreset;
bool rdsstatscreen;
bool RDSSPYTCP, RDSSPYUSB;
bool rdsstereoold;
bool rotaryaccelerate = true;
bool rtcset;
bool scandxmode;
bool scanholdflag;
bool scanholdonsignal;
bool scanmem;
bool scanmute;
bool screenmute;
bool screensavertriggered = false;
bool seek;
bool seekinit;
bool setextendbw;
bool setupmode;
bool showclock;
bool showlongps;
bool usesquelch;
bool softmuteam;
bool softmutefm;
bool SQ;
bool Stereostatusold;
bool StereoToggle;
bool store;
bool TAold, TPold;
bool touchrepeat = false;
bool touch_detect;
bool tuned;
bool USBmode;
bool XDRGTKdata;
bool XDRGTKMuteScreen;
bool XDRGTKTCP, XDRGTKUSB;
bool XDRMute, XDRScan;
bool wifi, wificonnected;
byte af_counterold;
byte aid_counterold;
byte af;
byte afpagenr;
byte amagc;
byte amnb;
byte amscansens;
byte audiomode;
byte band;
byte bandAM;
byte bandFM;
byte bandforbidden;
byte battery;
byte batteryold;
byte batteryoptions;
byte BWset;
byte BWsettemp;
byte BWsetAM;
byte BWsetFM;
byte BWsetRecall;
byte BWtemp;
byte charwidth = 8;
byte chipmodel;
byte hardwaremodel;
byte ContrastSet;
byte CurrentSkin;
byte CurrentTheme;
byte displayflip;
byte ECCold;
byte eonptyold[20];
byte EQset;
byte fmagc;
byte fmscansens;
byte fmdefaultstepsize;
byte fmnb;
byte fmdeemphasis;
byte freqfont;
byte amcodect;
byte amcodectcount;
byte amgain;
byte freqoldcount;
byte HighCutLevel;
byte HighCutOffset;
byte items[10] = {10, static_cast<byte>(dynamicspi ? 10 : 9), 7, 10, 10, 10, 9, 10, 10, 9};
byte iMSEQ;
byte iMSset;
byte language;
byte longbandpress;
byte memdoublepi;
byte memorypos;
byte memoryposold;
byte memoryposstatus;
byte mempionly;
byte memstartpos;
byte memstoppos;
byte menuitem;
byte menupage;
byte poweroptions;
byte rdsblockold;
byte rdsqualityold;
byte rotarymode;
byte touchrotating;
byte scancancel;
byte scanstart;
byte scanstop;
byte scanhold;
byte scanmodeold;
byte screensaverOptions[5] = {0, 3, 10, 30, 60};
byte screensaverset;
byte showmodulation;
byte showrdserrors;
byte showSWMIBand;
byte submenu;
byte stationlistid;
byte nowToggleSWMIBand = 1;
byte stepsize;
byte StereoLevel;
byte subnetclient;
byte TEF, tot, tunemode;
byte unit, spispeed, programTypePrevious;
char buff[16];
char eonpicodeold[20][6];
const uint8_t* currentFont = nullptr;
float vPerold;
int ActiveColor;
int ActiveColorSmooth;
int AGC;
int AMLevelOffset;
int BackgroundColor;
int BackgroundColor1;
int BackgroundColor2;
int BackgroundColor3;
int BackgroundColor4;
int BackgroundColor5;
int BarSignificantColor;
int BarInsignificantColor;
int BatteryValueColor;
int BatteryValueColorSmooth;
int batupdatetimer;
int berPercentold;
int BWAutoColor;
int BWAutoColorSmooth;
int BWOld;
int bwupdatetimer;
int DisplayedSegments;
int ForceMono;
int FrameColor;
int FreqColor;
int FreqColorSmooth;
int freq_in = 0;
int freqold;
int GreyoutColor;
int InsignificantColor;
int InsignificantColorSmooth;
int menuoption = ITEM1;
int ModBarInsignificantColor;
int ModBarSignificantColor;
int MStatusold;
int offsetupdatetimer;
int OStatusold;
int peakholdold;
int peakholdtimer;
int PrimaryColor;
int PrimaryColorSmooth;
int RDSColor, RDSColorSmooth;
int RDSDropoutColor, RDSDropoutColorSmooth;
int SignificantColor;
int SignificantColorSmooth;
int StereoColor;
int StereoColorSmooth;
int WifiColorHigh;
int WifiColorLow;
int SquelchShow;
int rotary;
int rotarycounter;
int rotarycounteraccelerator;
int rssi;
int rssiold = 200;
int scanner_filter;
int SecondaryColor;
int SecondaryColorSmooth;
int SNRupdatetimer;
int Sqstatusold;
int Squelch;
int Squelchold;
int SStatusold;
int Stereostatus;
int volume;
int XDRBWset;
int XDRBWsetold;
int xPos;
int xPos2;
int xPos3;
int xPos4;
int xPos5;
int xPos6;
int16_t OStatus;
int16_t SAvg;
int16_t SAvg2;
int16_t SAvg3;
int16_t SAvg4;
int16_t SAvg5;
int16_t SStatus;
int16_t MP;
int16_t US;
int8_t MPold = 0;
int8_t USold = 0;
int8_t LevelOffset;
int8_t LowLevelSet;
int8_t NTPoffset;
int8_t CN;
int8_t CNold;
int8_t VolSet;
float batteryVold;
IPAddress remoteip;
String AIDString;
String cryptedpassword;
String ECColdString;
String ECCString;
String eonpsold[20];
String PIold;
String PSold;
String ptynold = " ";
String PTYold;
String rds_clock;
String rds_clockold;
String rds_date;
String rds_dateold;
String RDSSPYRDS;
String RDSSPYRDSold;
String RTold;
String salt;
String saltkey = " ";
String stationIDold;
String stationStateold;
String StereoStatusCommand;
String StereoStatusCommandold;
String SWMIBandstring = String();
String SWMIBandstringold = String();
String XDRGTK_key;
String XDRGTKRDS;
String XDRGTKRDSold;
uint16_t BW;
uint16_t MStatus;
uint16_t SWMIBandPos;
uint16_t SWMIBandPosold;
uint16_t TouchCalData[5];
uint16_t USN;
uint16_t WAM;
uint8_t buff_pos;
unsigned int ConverterSet;
unsigned int freq_scan;
unsigned int frequency;
unsigned int frequency_OIRT;
unsigned int frequency_AM;
unsigned int frequency_LW;
unsigned int frequency_MIBand_11M;
unsigned int frequency_MIBand_120M;
unsigned int frequency_MIBand_13M;
unsigned int frequency_MIBand_15M;
unsigned int frequency_MIBand_160M;
unsigned int frequency_MIBand_16M;
unsigned int frequency_MIBand_19M;
unsigned int frequency_MIBand_22M;
unsigned int frequency_MIBand_25M;
unsigned int frequency_MIBand_31M;
unsigned int frequency_MIBand_41M;
unsigned int frequency_MIBand_49M;
unsigned int frequency_MIBand_60M;
unsigned int frequency_MIBand_75M;
unsigned int frequency_MIBand_90M;
unsigned int frequency_MW;
unsigned int frequency_SW;
unsigned int frequencyold;
unsigned int HighEdgeOIRTSet;
unsigned int HighEdgeSet;
unsigned int LowEdgeOIRTSet;
unsigned int logcounter;
unsigned int LowEdgeSet;
unsigned int LWHighEdgeSet;
unsigned int LWLowEdgeSet;
unsigned int mappedfreqold[20];
unsigned int mappedfreqold2[20];
unsigned int mappedfreqold3[20];
unsigned int memstartfreq;
unsigned int memstopfreq;
unsigned int MWHighEdgeSet;
unsigned int MWLowEdgeSet;
unsigned int scanner_end;
unsigned int scanner_start;
unsigned int scanner_step;
unsigned int SWHighEdgeSet;
unsigned int SWLowEdgeSet;
unsigned long afticker;
unsigned long aftickerhold;
unsigned long aftimer;
unsigned long autosquelchtimer;
unsigned long blockcounterold[33];
unsigned long eccticker;
unsigned long ecctickerhold;
unsigned long eonticker;
unsigned long eontickerhold;
unsigned long flashingtimer;
unsigned long keypadtimer;
unsigned long lastTouchTime = 0;
unsigned long lowsignaltimer;
unsigned long ModulationpreviousMillis;
unsigned long ModulationpeakPreviousMillis;
unsigned long NTPtimer;
unsigned long peakholdmillis;
unsigned long processed_rdsblocksold[33];
unsigned long pslongticker;
unsigned long pslongtickerhold;
unsigned long rtplusticker;
unsigned long rtplustickerhold;
unsigned long rtticker;
unsigned long rttickerhold;
unsigned long rotarytimer;
unsigned long scantimer;
unsigned long screensavertimer;
unsigned long signalstatustimer;
unsigned long tottimer;
unsigned long tuningtimer;
unsigned long udplogtimer;
unsigned long udptimer;
const size_t language_totalnumber = sizeof(myLanguage) / sizeof(myLanguage[0]);
const size_t language_entrynumber = sizeof(myLanguage[0]) / sizeof(myLanguage[0][0]);
mem presets[EE_PRESETS_CNT];
TEF6686 radio;
ESP32Time rtc(0);
TFT_eSprite FrequencySprite = TFT_eSprite(&tft);
TFT_eSprite RDSSprite = TFT_eSprite(&tft);
TFT_eSprite SquelchSprite = TFT_eSprite(&tft);
TFT_eSprite FullLineSprite = TFT_eSprite(&tft);
TFT_eSprite OneBigLineSprite = TFT_eSprite(&tft);
TFT_eSprite SignalSprite = TFT_eSprite(&tft);
TFT_eSprite PSSprite = TFT_eSprite(&tft);
WiFiConnect wc;
WiFiServer Server(7373);
WiFiClient RemoteClient;
WiFiUDP Udp;
WebServer webserver(80);
+9 -25
View File
@@ -1,6 +1,4 @@
#include "gui.h"
#include "constants.h"
#include <WiFi.h>
#include <Wire.h>
#include <EEPROM.h>
#include <cstring>
@@ -3219,7 +3217,8 @@ void MenuUpDown(bool dir) {
switch (tot) {
case 0: tot = 15; break;
case 15: tot = 30; break;
case 30: tot = 60; break;
case 30: tot = 45; break;
case 45: tot = 60; break;
case 60: tot = 90; break;
default: tot = 0; break;
}
@@ -3227,7 +3226,8 @@ void MenuUpDown(bool dir) {
switch (tot) {
case 15: tot = 0; break;
case 30: tot = 15; break;
case 60: tot = 30; break;
case 45: tot = 30; break;
case 60: tot = 45; break;
case 90: tot = 60; break;
default: tot = 90; break;
}
@@ -5586,18 +5586,6 @@ void Infoboxprint(const char* input) {
}
}
String removeNewline(String inputString) {
String outputString = "";
for (int i = 0; i < inputString.length(); i++) {
if (inputString[i] == '\n') {
outputString += ' ';
} else {
outputString += inputString[i];
}
}
return outputString;
}
void drawButton(const char* text, byte button_number, bool active, bool selected) {
const int buttonWidth = 70;
const int buttonHeight = 30;
@@ -5628,7 +5616,7 @@ void drawButton(const char* text, byte button_number, bool active, bool selected
// Draw the button fill
tft.pushImage (x, y, 70, 30, (CurrentTheme == 7 ? bwselector_wo : bwselector));
tft.pushImage(x, y, 70, 30, (CurrentTheme == 7 ? bwselector_wo : bwselector));
// Draw the small line at the bottom (narrower, centered, and 3px up)
@@ -5644,17 +5632,13 @@ void drawButton(const char* text, byte button_number, bool active, bool selected
String shortLine(String text) {
String tempText = text;
if (PSSprite.textWidth(tempText + "...") > 155) { // Include "..." in width check
if (PSSprite.textWidth(tempText + "...") > 155) {
while (PSSprite.textWidth(tempText + "...") > 155 && tempText.length() > 0) {
// Safely remove the last UTF-8 character
int lastCharIndex = tempText.length() - 1;
while (lastCharIndex > 0 && (tempText[lastCharIndex] & 0xC0) == 0x80) {
lastCharIndex--; // Skip over continuation bytes
}
tempText = tempText.substring(0, lastCharIndex); // Remove last character
while (lastCharIndex > 0 && (tempText[lastCharIndex] & 0xC0) == 0x80) lastCharIndex--;
tempText = tempText.substring(0, lastCharIndex);
}
text = tempText + "..."; // Add "..." to the truncated text
text = tempText + "...";
}
return text;
}
-1
View File
@@ -1,5 +1,4 @@
#include "logbook.h"
#include "constants.h"
#include <EEPROM.h>
String UDPlogold = "";
+5 -410
View File
@@ -1,19 +1,14 @@
#pragma region includes
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
#include <WiFiClient.h>
#include <EEPROM.h>
#include <Wire.h>
#include <TimeLib.h>
#include <TFT_eSPI.h>
#include <Hash.h>
#include <FS.h>
#include <TimeLib.h>
using fs::FS;
#include <WebServer.h>
#include <SPIFFS.h>
#include "NTPupdate.h"
#include <WiFiConnect.h>
#include <WiFiConnectParam.h>
#include "FONT16.h"
#include "FONT16_CHS.h"
#include "FONT28.h"
@@ -29,403 +24,7 @@ using fs::FS;
#include "touch.h"
#include "logbook.h"
#include "utils.h"
#pragma endregion
#define ROTARY_PIN_A 34
#define ROTARY_PIN_B 36
#define ROTARY_BUTTON 39
#define PIN_POT 35
#define BATTERY_PIN 13
#define BANDBUTTON 4
#define BWBUTTON 25
#define MODEBUTTON 26
#define CONTRASTPIN 2
#define STANDBYLED 19
#define SMETERPIN 27
#define TOUCHIRQ 33
#define EXT_IRQ 14
#define DYNAMIC_SPI_SPEED
#pragma region global definitions
#ifdef ARS
TFT_eSPI tft = TFT_eSPI(320, 240);
#else
TFT_eSPI tft = TFT_eSPI(240, 320);
#endif
#ifdef DYNAMIC_SPI_SPEED
bool dynamicspi = true;
#else
bool dynamicspi = false;
#endif
bool advancedRDS, afmethodBold, afpage;
bool afscreen, aftest, artheadold;
bool autoDST, autolog, autologged;
bool autosquelch = true, batterydetect = true, beepresetstart;
bool beepresetstop, BWreset, bwtouchtune;
bool BWtune, change, clockampm;
bool compressedold, direction, dropout;
bool dynamicPTYold, edgebeep, externaltune;
bool findMemoryAF;
bool firstTouchHandled = false;
bool flashing;
bool fmsi, fullsearchrds;
bool hasafold, hasCTold, haseonold;
bool hasrtplusold, hastmcold;
bool initdxscan, invertdisplay, leave;
bool LowLevelInit;
bool memorystore;
bool memreset, memtune;
bool menu, menuopen;
bool mwstepsize;
bool nobattery;
bool NTPupdated;
bool optenc;
bool rdsflagreset;
bool rdsreset;
bool rdsstatscreen;
bool RDSSPYTCP, RDSSPYUSB;
bool RDSstatus, RDSstatusold;
bool rdsstereoold;
bool rotaryaccelerate = true;
bool rtcset;
bool scandxmode;
bool scanholdflag;
bool scanholdonsignal;
bool scanmem;
bool scanmute;
bool screenmute;
bool screensavertriggered = false;
bool seek;
bool seekinit;
bool setextendbw;
bool setupmode;
bool showclock;
bool showlongps;
bool usesquelch;
bool softmuteam;
bool softmutefm;
bool SQ;
bool Stereostatusold;
bool StereoToggle;
bool store;
bool TAold, TPold;
bool touchrepeat = false;
bool touch_detect;
bool tuned;
bool USBmode;
bool XDRGTKdata;
bool XDRGTKMuteScreen;
bool XDRGTKTCP, XDRGTKUSB;
bool XDRMute, XDRScan;
bool wifi, wificonnected;
byte af_counterold;
byte aid_counterold;
byte af;
byte afpagenr;
byte amagc;
byte amnb;
byte amscansens;
byte audiomode;
byte band;
byte bandAM;
byte bandFM;
byte bandforbidden;
byte battery;
byte batteryold;
byte batteryoptions;
byte BWset;
byte BWsettemp;
byte BWsetAM;
byte BWsetFM;
byte BWsetRecall;
byte BWtemp;
byte charwidth = 8;
byte chipmodel;
byte hardwaremodel;
byte ContrastSet;
byte CurrentSkin;
byte CurrentTheme;
byte displayflip;
byte ECCold;
byte eonptyold[20];
byte EQset;
byte fmagc;
byte fmscansens;
byte fmdefaultstepsize;
byte fmnb;
byte fmdeemphasis;
byte freqfont;
byte amcodect;
byte amcodectcount;
byte amgain;
byte freqoldcount;
byte HighCutLevel;
byte HighCutOffset;
byte items[10] = {10, static_cast<byte>(dynamicspi ? 10 : 9), 7, 10, 10, 10, 9, 10, 10, 9};
byte iMSEQ;
byte iMSset;
byte language;
byte longbandpress;
byte memdoublepi;
byte memorypos;
byte memoryposold;
byte memoryposstatus;
byte mempionly;
byte memstartpos;
byte memstoppos;
byte menuitem;
byte menupage;
byte poweroptions;
byte rdsblockold;
byte rdsqualityold;
byte rotarymode;
byte touchrotating;
byte scancancel;
byte scanstart;
byte scanstop;
byte scanhold;
byte scanmodeold;
byte screensaverOptions[5] = {0, 3, 10, 30, 60};
byte screensaverset;
byte showmodulation;
byte showrdserrors;
byte showSWMIBand;
byte submenu;
byte stationlistid;
byte nowToggleSWMIBand = 1;
byte stepsize;
byte StereoLevel;
byte subnetclient;
byte TEF, tot, tunemode;
byte unit, spispeed, programTypePrevious;
char buff[16];
char eonpicodeold[20][6];
const uint8_t* currentFont = nullptr;
float vPerold;
int ActiveColor;
int ActiveColorSmooth;
int AGC;
int AMLevelOffset;
int BackgroundColor;
int BackgroundColor1;
int BackgroundColor2;
int BackgroundColor3;
int BackgroundColor4;
int BackgroundColor5;
int BarSignificantColor;
int BarInsignificantColor;
int BatteryValueColor;
int BatteryValueColorSmooth;
int batupdatetimer;
int berPercentold;
int BWAutoColor;
int BWAutoColorSmooth;
int BWOld;
int bwupdatetimer;
int DisplayedSegments;
int ForceMono;
int FrameColor;
int FreqColor;
int FreqColorSmooth;
int freq_in = 0;
int freqold;
int GreyoutColor;
int InsignificantColor;
int InsignificantColorSmooth;
int menuoption = ITEM1;
int ModBarInsignificantColor;
int ModBarSignificantColor;
int MStatusold;
int offsetupdatetimer;
int OStatusold;
int peakholdold;
int peakholdtimer;
int PrimaryColor;
int PrimaryColorSmooth;
int RDSColor, RDSColorSmooth;
int RDSDropoutColor, RDSDropoutColorSmooth;
int SignificantColor;
int SignificantColorSmooth;
int StereoColor;
int StereoColorSmooth;
int WifiColorHigh;
int WifiColorLow;
int SquelchShow;
int rotary;
int rotarycounter;
int rotarycounteraccelerator;
int rssi;
int rssiold = 200;
int scanner_filter;
int SecondaryColor;
int SecondaryColorSmooth;
int SNRupdatetimer;
int Sqstatusold;
int Squelch;
int Squelchold;
int SStatusold;
int Stereostatus;
int volume;
int XDRBWset;
int XDRBWsetold;
int xPos;
int xPos2;
int xPos3;
int xPos4;
int xPos5;
int xPos6;
int16_t OStatus;
int16_t SAvg;
int16_t SAvg2;
int16_t SAvg3;
int16_t SAvg4;
int16_t SAvg5;
int16_t SStatus;
int16_t MP;
int16_t US;
int8_t MPold = 0;
int8_t USold = 0;
int8_t LevelOffset;
int8_t LowLevelSet;
int8_t NTPoffset;
int8_t CN;
int8_t CNold;
int8_t VolSet;
float batteryVold;
IPAddress remoteip;
String AIDString;
String cryptedpassword;
String ECColdString;
String ECCString;
String eonpsold[20];
String PIold;
String PSold;
String ptynold = " ";
String PTYold;
String rds_clock;
String rds_clockold;
String rds_date;
String rds_dateold;
String RDSSPYRDS;
String RDSSPYRDSold;
String RTold;
String salt;
String saltkey = " ";
String stationIDold;
String stationStateold;
String StereoStatusCommand;
String StereoStatusCommandold;
String SWMIBandstring = String();
String SWMIBandstringold = String();
String XDRGTK_key;
String XDRGTKRDS;
String XDRGTKRDSold;
uint16_t BW;
uint16_t MStatus;
uint16_t SWMIBandPos;
uint16_t SWMIBandPosold;
uint16_t TouchCalData[5];
uint16_t USN;
uint16_t WAM;
uint8_t buff_pos;
unsigned int ConverterSet;
unsigned int freq_scan;
unsigned int frequency;
unsigned int frequency_OIRT;
unsigned int frequency_AM;
unsigned int frequency_LW;
unsigned int frequency_MIBand_11M;
unsigned int frequency_MIBand_120M;
unsigned int frequency_MIBand_13M;
unsigned int frequency_MIBand_15M;
unsigned int frequency_MIBand_160M;
unsigned int frequency_MIBand_16M;
unsigned int frequency_MIBand_19M;
unsigned int frequency_MIBand_22M;
unsigned int frequency_MIBand_25M;
unsigned int frequency_MIBand_31M;
unsigned int frequency_MIBand_41M;
unsigned int frequency_MIBand_49M;
unsigned int frequency_MIBand_60M;
unsigned int frequency_MIBand_75M;
unsigned int frequency_MIBand_90M;
unsigned int frequency_MW;
unsigned int frequency_SW;
unsigned int frequencyold;
unsigned int HighEdgeOIRTSet;
unsigned int HighEdgeSet;
unsigned int LowEdgeOIRTSet;
unsigned int logcounter;
unsigned int LowEdgeSet;
unsigned int LWHighEdgeSet;
unsigned int LWLowEdgeSet;
unsigned int mappedfreqold[20];
unsigned int mappedfreqold2[20];
unsigned int mappedfreqold3[20];
unsigned int memstartfreq;
unsigned int memstopfreq;
unsigned int MWHighEdgeSet;
unsigned int MWLowEdgeSet;
unsigned int scanner_end;
unsigned int scanner_start;
unsigned int scanner_step;
unsigned int SWHighEdgeSet;
unsigned int SWLowEdgeSet;
unsigned long afticker;
unsigned long aftickerhold;
unsigned long aftimer;
unsigned long autosquelchtimer;
unsigned long blockcounterold[33];
unsigned long eccticker;
unsigned long ecctickerhold;
unsigned long eonticker;
unsigned long eontickerhold;
unsigned long flashingtimer;
unsigned long keypadtimer;
unsigned long lastTouchTime = 0;
unsigned long lowsignaltimer;
unsigned long ModulationpreviousMillis;
unsigned long ModulationpeakPreviousMillis;
unsigned long NTPtimer;
unsigned long peakholdmillis;
unsigned long processed_rdsblocksold[33];
unsigned long pslongticker;
unsigned long pslongtickerhold;
unsigned long rtplusticker;
unsigned long rtplustickerhold;
unsigned long rtticker;
unsigned long rttickerhold;
unsigned long rotarytimer;
unsigned long scantimer;
unsigned long screensavertimer;
unsigned long signalstatustimer;
unsigned long tottimer;
unsigned long tuningtimer;
unsigned long udplogtimer;
unsigned long udptimer;
const size_t language_totalnumber = sizeof(myLanguage) / sizeof(myLanguage[0]);
const size_t language_entrynumber = sizeof(myLanguage[0]) / sizeof(myLanguage[0][0]);
mem presets[EE_PRESETS_CNT];
TEF6686 radio;
ESP32Time rtc(0);
TFT_eSprite FrequencySprite = TFT_eSprite(&tft);
TFT_eSprite RDSSprite = TFT_eSprite(&tft);
TFT_eSprite SquelchSprite = TFT_eSprite(&tft);
TFT_eSprite FullLineSprite = TFT_eSprite(&tft);
TFT_eSprite OneBigLineSprite = TFT_eSprite(&tft);
TFT_eSprite SignalSprite = TFT_eSprite(&tft);
TFT_eSprite PSSprite = TFT_eSprite(&tft);
WiFiConnect wc;
WiFiServer Server(7373);
WiFiClient RemoteClient;
WiFiUDP Udp;
WebServer webserver(80);
#include "globals.h"
#pragma endregion
#pragma region to move
@@ -2019,7 +1618,7 @@ void setup() {
tft.fillRect(152, 230, 16, 6, GreyoutColor);
tft.fillRect(184, 230, 16, 6, GreyoutColor);
tft.pushImage (78, 34, 163, 84, openradiologo);
tft.pushImage(78, 34, 163, 84, openradiologo);
tft.drawBitmap(130, 124, TEFLogo, 59, 23, ActiveColor);
for (int x = 0; x <= ContrastSet; x++) {
@@ -2030,9 +1629,7 @@ void setup() {
tft.fillRect(120, 230, 16, 6, PrimaryColor);
TEF = EEPROM.readByte(EE_BYTE_TEF);
if (TEF != 102 && TEF != 205) SetTunerPatch();
radio.init(TEF);
uint16_t device, hw, sw;
@@ -2169,10 +1766,8 @@ void loop() {
Communication();
if (tot != 0) {
unsigned long totprobe = tot * 60000;
if (millis() >= tottimer + totprobe) deepSleep();
}
// tottimer is like the time of the last interaction
if (tot != 0 && millis() >= tottimer + (tot * 60000)) deepSleep();
if (freq_in != 0 && millis() >= keypadtimer + 2000) {
freq_in = 0;
+9
View File
@@ -126,4 +126,13 @@ String extractUTF8Substring(const String & utf8String, size_t start, size_t leng
}
return substring;
}
String removeNewline(String inputString) {
String outputString = "";
for (int i = 0; i < inputString.length(); i++) {
if (inputString[i] == '\n') outputString += ' ';
else outputString += inputString[i];
}
return outputString;
}