Skip to content

Commit

Permalink
just small code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Mar 27, 2024
1 parent d004efb commit df3b15f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/aprs_is_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

extern Configuration Config;
extern WiFiClient espClient;
extern int internalLedPin;
extern uint32_t lastScreenOn;
extern String firstLine;
extern String secondLine;
Expand All @@ -29,7 +28,7 @@ namespace APRS_IS_Utils {
}

void connect() {
int count = 0;
uint8_t count = 0;
String aprsauth;
Serial.print("Connecting to APRS-IS ... ");
while (!espClient.connect(Config.aprs_is.server.c_str(), Config.aprs_is.port) && count < 20) {
Expand Down
4 changes: 2 additions & 2 deletions src/battery_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace BATTERY_Utils {
float checkBattery() {
int sample;
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)
sample = analogRead(batteryPin);
#endif
Expand All @@ -51,7 +51,7 @@ namespace BATTERY_Utils {
float checkExternalVoltage() {
int sample;
int sampleSum = 0;
for (int i=0; i<100; i++) {
for (int i = 0; i < 100; i++) {
sample = analogRead(Config.externalVoltagePin);
sampleSum += sample;
delayMicroseconds(50);
Expand Down
4 changes: 2 additions & 2 deletions src/gps_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace GPS_Utils {
int v = n;
r += v;
r += '.';
for (int i=0;i<ndec;i++) {
for (int i = 0; i < ndec; i++) {
n -= v;
n = 10 * abs(n);
v = n;
Expand Down Expand Up @@ -158,7 +158,7 @@ namespace GPS_Utils {
}

String getDistance(String packet) {
int encodedBytePosition = 0;
uint8_t encodedBytePosition = 0;
if (packet.indexOf(":!") > 10) {
encodedBytePosition = packet.indexOf(":!") + 14;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ namespace Utils {
fifthLine = "LoRa Rx ----> LoRa Tx";
sender = packet.substring(3,packet.indexOf(">"));
}
for (int i=sender.length();i<9;i++) {
for (int i = sender.length(); i < 9; i++) {
sender += " ";
}
if (packet.indexOf("::") >= 10) {
Expand Down
2 changes: 1 addition & 1 deletion src/wifi_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace WIFI_Utils {
if (currentWiFi->ssid == "") {
startAP = true;
} else {
int wifiCounter = 0;
uint8_t wifiCounter = 0;
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(500);
Expand Down

0 comments on commit df3b15f

Please sign in to comment.