Skip to content

Commit 5327f17

Browse files
committed
code sanitizations
1 parent c9303e9 commit 5327f17

File tree

4 files changed

+0
-26
lines changed

4 files changed

+0
-26
lines changed

src/gpsread.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ byte CFG_CFG[] = {
8787
// helper functions to send UBX commands to ublox gps chip
8888

8989
void sendPacket(byte *packet, byte len) {
90-
9190
uint8_t CK_A = 0;
9291
uint8_t CK_B = 0;
9392

@@ -107,7 +106,6 @@ void restoreDefaults() { sendPacket(CFG_CFG, sizeof(CFG_CFG)); }
107106
void changeBaudrate() { sendPacket(CFG_PRT, sizeof(CFG_PRT)); }
108107

109108
void disableNmea() {
110-
111109
// tinygps++ processes only $GPGGA/$GNGGA and $GPRMC/$GNRMC
112110
// thus, we disable all other NMEA messages
113111

@@ -128,7 +126,6 @@ void disableNmea() {
128126

129127
// initialize and configure GPS
130128
int gps_init(void) {
131-
132129
ESP_LOGI(TAG, "Opening serial GPS");
133130

134131
GPS_Serial.begin(GPS_SERIAL);
@@ -144,7 +141,6 @@ int gps_init(void) {
144141
disableNmea();
145142

146143
return 1;
147-
148144
} // gps_init()
149145

150146
// store current GPS location data in struct
@@ -170,13 +166,11 @@ bool gps_hasfix() {
170166

171167
// function to poll UTC time from GPS NMEA data; note: this is costly
172168
time_t get_gpstime(uint16_t *msec = 0) {
173-
174169
const uint16_t txDelay =
175170
70U * 1000 / (GPS_BAUDRATE / 9); // serial tx of 70 NMEA chars
176171

177172
// did we get a current date & time?
178173
if (gps.time.age() < 1000) {
179-
180174
// convert tinygps time format to struct tm format
181175
struct tm gps_tm = {0};
182176
gps_tm.tm_sec = gps.time.second();
@@ -209,26 +203,22 @@ time_t get_gpstime(uint16_t *msec = 0) {
209203

210204
ESP_LOGD(TAG, "no valid GPS time");
211205
return 0;
212-
213206
} // get_gpstime()
214207

215208
// GPS serial feed FreeRTos Task
216209
void gps_loop(void *pvParameters) {
217-
218210
_ASSERT((uint32_t)pvParameters == 1); // FreeRTOS check
219211

220212
// feed GPS decoder with serial NMEA data from GPS device
221213
while (1) {
222214
while (cfg.payloadmask & GPS_DATA) {
223-
224215
while (GPS_Serial.available())
225216
gps.encode(GPS_Serial.read());
226217

227218
delay(5);
228219
}
229220
delay(1000);
230221
} // infinite while loop
231-
232222
} // gps_loop()
233223

234224
#endif // HAS_GPS

src/ledmatrixdisplay.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ void refreshTheMatrixDisplay(bool nextPage) {
7070
}
7171

7272
switch (DisplayPage % MATRIX_DISPLAY_PAGES) {
73-
7473
// page 0: number of current pax OR footfall line diagram
7574
// page 1: time of day
7675

@@ -89,18 +88,14 @@ void refreshTheMatrixDisplay(bool nextPage) {
8988
}
9089

9190
else { // cyclic counter mode -> plot a line diagram
92-
9391
if (ulLastNumMacs != count.pax) {
94-
9592
// next count cycle?
9693
if (count.pax == 0) {
97-
9894
// matrix full? then scroll left 1 dot, else increment column
9995
if (col < (LED_MATRIX_WIDTH - 1))
10096
col++;
10197
else
10298
ScrollMatrixLeft(displaybuf, LED_MATRIX_WIDTH, LED_MATRIX_HEIGHT);
103-
10499
} else
105100
matrix.drawPoint(col, row, 0); // clear current dot
106101

@@ -124,7 +119,6 @@ void refreshTheMatrixDisplay(bool nextPage) {
124119
// DrawNumber(myTZ.dateTime("H:i:s").c_str());
125120
}
126121
break;
127-
128122
} // switch page
129123

130124
matrix.scan();

src/ota.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ inline String getHeaderValue(String header, String headerName) {
4141
}
4242

4343
void start_ota_update() {
44-
4544
const char *host = clientId;
4645

4746
switch_LED(LED_ON);
@@ -121,13 +120,11 @@ void start_ota_update() {
121120
ota_display(5, "**", ""); // mark line rebooting
122121
delay(5000);
123122
do_reset(false);
124-
125123
} // start_ota_update
126124

127125
// Reads data vom wifi client and flashes it to ota partition
128126
// returns: 0 = finished, 1 = retry, -1 = abort
129127
int do_ota_update() {
130-
131128
char buf[17];
132129
bool redirect = true;
133130
size_t written = 0;
@@ -319,7 +316,6 @@ int do_ota_update() {
319316

320317
retry:
321318
return 1;
322-
323319
} // do_ota_update
324320

325321
void ota_display(const uint8_t row, const std::string status,

src/power.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ static const adc_unit_t unit = ADC_UNIT_1;
2626
AXP20X_Class pmu;
2727

2828
void AXP192_powerevent_IRQ(void) {
29-
3029
pmu.readIRQ();
3130

3231
if (pmu.isVbusOverVoltageIRQ())
@@ -83,9 +82,7 @@ void AXP192_powerevent_IRQ(void) {
8382
}
8483

8584
void AXP192_power(pmu_power_t powerlevel) {
86-
8785
switch (powerlevel) {
88-
8986
case pmu_power_off:
9087
pmu.shutdown();
9188
break;
@@ -119,7 +116,6 @@ void AXP192_power(pmu_power_t powerlevel) {
119116
}
120117

121118
void AXP192_showstatus(void) {
122-
123119
if (pmu.isBatteryConnect())
124120
if (pmu.isChargeing())
125121
ESP_LOGI(TAG, "Battery charging, %.2fV @ %.0fmAh",
@@ -137,12 +133,10 @@ void AXP192_showstatus(void) {
137133
}
138134

139135
void AXP192_init(void) {
140-
141136
if (pmu.begin(i2c_readBytes, i2c_writeBytes, AXP192_PRIMARY_ADDRESS) ==
142137
AXP_FAIL)
143138
ESP_LOGI(TAG, "AXP192 PMU initialization failed");
144139
else {
145-
146140
// configure voltages
147141
pmu.setDCDC1Voltage(3300); // for external OLED display
148142
pmu.setLDO2Voltage(3300); // LORA VDD 3v3

0 commit comments

Comments
 (0)