just small code cleaning

This commit is contained in:
richonguzman 2024-03-27 15:28:27 -03:00
parent d004efb193
commit df3b15ff35
5 changed files with 7 additions and 8 deletions

View File

@ -11,7 +11,6 @@
extern Configuration Config; extern Configuration Config;
extern WiFiClient espClient; extern WiFiClient espClient;
extern int internalLedPin;
extern uint32_t lastScreenOn; extern uint32_t lastScreenOn;
extern String firstLine; extern String firstLine;
extern String secondLine; extern String secondLine;
@ -29,7 +28,7 @@ namespace APRS_IS_Utils {
} }
void connect() { void connect() {
int count = 0; uint8_t count = 0;
String aprsauth; String aprsauth;
Serial.print("Connecting to APRS-IS ... "); Serial.print("Connecting to APRS-IS ... ");
while (!espClient.connect(Config.aprs_is.server.c_str(), Config.aprs_is.port) && count < 20) { while (!espClient.connect(Config.aprs_is.server.c_str(), Config.aprs_is.port) && count < 20) {

View File

@ -30,7 +30,7 @@ namespace BATTERY_Utils {
float checkBattery() { float checkBattery() {
int sample; int sample;
int sampleSum = 0; int sampleSum = 0;
for (int i=0; i<100; i++) { for (int i = 0; i < 100; i++) {
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_WSL) #if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_WSL)
sample = analogRead(batteryPin); sample = analogRead(batteryPin);
#endif #endif
@ -51,7 +51,7 @@ namespace BATTERY_Utils {
float checkExternalVoltage() { float checkExternalVoltage() {
int sample; int sample;
int sampleSum = 0; int sampleSum = 0;
for (int i=0; i<100; i++) { for (int i = 0; i < 100; i++) {
sample = analogRead(Config.externalVoltagePin); sample = analogRead(Config.externalVoltagePin);
sampleSum += sample; sampleSum += sample;
delayMicroseconds(50); delayMicroseconds(50);

View File

@ -18,7 +18,7 @@ namespace GPS_Utils {
int v = n; int v = n;
r += v; r += v;
r += '.'; r += '.';
for (int i=0;i<ndec;i++) { for (int i = 0; i < ndec; i++) {
n -= v; n -= v;
n = 10 * abs(n); n = 10 * abs(n);
v = n; v = n;
@ -158,7 +158,7 @@ namespace GPS_Utils {
} }
String getDistance(String packet) { String getDistance(String packet) {
int encodedBytePosition = 0; uint8_t encodedBytePosition = 0;
if (packet.indexOf(":!") > 10) { if (packet.indexOf(":!") > 10) {
encodedBytePosition = packet.indexOf(":!") + 14; encodedBytePosition = packet.indexOf(":!") + 14;
} }

View File

@ -199,7 +199,7 @@ namespace Utils {
fifthLine = "LoRa Rx ----> LoRa Tx"; fifthLine = "LoRa Rx ----> LoRa Tx";
sender = packet.substring(3,packet.indexOf(">")); sender = packet.substring(3,packet.indexOf(">"));
} }
for (int i=sender.length();i<9;i++) { for (int i = sender.length(); i < 9; i++) {
sender += " "; sender += " ";
} }
if (packet.indexOf("::") >= 10) { if (packet.indexOf("::") >= 10) {

View File

@ -42,7 +42,7 @@ namespace WIFI_Utils {
if (currentWiFi->ssid == "") { if (currentWiFi->ssid == "") {
startAP = true; startAP = true;
} else { } else {
int wifiCounter = 0; uint8_t wifiCounter = 0;
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.disconnect(); WiFi.disconnect();
delay(500); delay(500);