Skip to content

Commit 9148a52

Browse files
Clear some space
1 parent 419dd43 commit 9148a52

File tree

7 files changed

+31
-43
lines changed

7 files changed

+31
-43
lines changed

esp32_marauder/BatteryInterface.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ void BatteryInterface::RunSetup() {
2626

2727
#ifdef HAS_BATTERY
2828

29-
Serial.println("Checking for battery monitors...");
30-
3129
#ifndef HAS_AXP2101
3230
Wire.begin(I2C_SDA, I2C_SCL);
3331

3432
Wire.beginTransmission(IP5306_ADDR);
3533
error = Wire.endTransmission();
3634

3735
if (error == 0) {
38-
Serial.println("Detected IP5306");
36+
Serial.println(F("Detected IP5306"));
3937
this->has_ip5306 = true;
4038
this->i2c_supported = true;
4139
}
@@ -45,7 +43,7 @@ void BatteryInterface::RunSetup() {
4543

4644
if (error == 0) {
4745
if (maxlipo.begin()) {
48-
Serial.println("Detected MAX17048");
46+
Serial.println(F("Detected MAX17048"));
4947
this->has_max17048 = true;
5048
this->i2c_supported = true;
5149
}
@@ -56,7 +54,7 @@ void BatteryInterface::RunSetup() {
5654
if (!result)
5755
return;
5856

59-
Serial.println("Detected AXP2101");
57+
Serial.println(F("Detected AXP2101"));
6058

6159
this->i2c_supported = true;
6260
this->has_axp2101 = true;

esp32_marauder/EvilPortal.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void EvilPortal::setupServer() {
128128
}
129129

130130
void EvilPortal::setHtmlFromSerial() {
131-
Serial.println("Setting HTML from serial...");
131+
Serial.println(F("Setting HTML from serial..."));
132132
const char *htmlStr = Serial.readString().c_str();
133133
#ifdef HAS_PSRAM
134134
index_html = (char*) ps_malloc(MAX_HTML_SIZE);
@@ -215,18 +215,18 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
215215
// Could not open config file. return false
216216
if (!ap_config_file) {
217217
#ifdef HAS_SCREEN
218-
this->sendToDisplay("Could not find /ap.config.txt.");
219-
this->sendToDisplay("Touch to exit...");
218+
this->sendToDisplay(F("Could not find /ap.config.txt."));
219+
this->sendToDisplay(F("Touch to exit..."));
220220
#endif
221-
Serial.println("Could not find /ap.config.txt. Use stopscan...");
221+
Serial.println(F("Could not find /ap.config.txt. Use stopscan..."));
222222
return false;
223223
}
224224
// Config file good. Proceed
225225
else {
226226
// ap name too long. return false
227227
if (ap_config_file.size() > MAX_AP_NAME_SIZE) {
228228
#ifdef HAS_SCREEN
229-
this->sendToDisplay("The given AP name is too large.");
229+
this->sendToDisplay(F("The given AP name is too large."));
230230
this->sendToDisplay("The Byte limit is " + (String)MAX_AP_NAME_SIZE);
231231
this->sendToDisplay("Touch to exit...");
232232
#endif
@@ -242,7 +242,7 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
242242
}
243243
}
244244
#ifdef HAS_SCREEN
245-
this->sendToDisplay("AP name from config file");
245+
this->sendToDisplay(F("AP name from config file"));
246246
this->sendToDisplay("AP name: " + ap_config);
247247
#endif
248248
Serial.println("AP name from config file: " + ap_config);
@@ -255,23 +255,23 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
255255
ap_config = ssids->get(0).essid;
256256
if (ap_config.length() > MAX_AP_NAME_SIZE) {
257257
#ifdef HAS_SCREEN
258-
this->sendToDisplay("The given AP name is too large.");
258+
this->sendToDisplay(F("The given AP name is too large."));
259259
this->sendToDisplay("The Byte limit is " + (String)MAX_AP_NAME_SIZE);
260260
this->sendToDisplay("Touch to exit...");
261261
#endif
262262
Serial.println("The provided AP name is too large. Byte limit is " + (String)MAX_AP_NAME_SIZE + "\nUse stopscan...");
263263
return false;
264264
}
265265
#ifdef HAS_SCREEN
266-
this->sendToDisplay("AP name from SSID list");
266+
this->sendToDisplay(F("AP name from SSID list"));
267267
this->sendToDisplay("AP name: " + ap_config);
268268
#endif
269269
Serial.println("AP name from SSID list: " + ap_config);
270270
}
271271
else if (temp_ap_name != "") {
272272
if (temp_ap_name.length() > MAX_AP_NAME_SIZE) {
273273
#ifdef HAS_SCREEN
274-
this->sendToDisplay("The given AP name is too large.");
274+
this->sendToDisplay(F("The given AP name is too large."));
275275
this->sendToDisplay("The Byte limit is " + (String)MAX_AP_NAME_SIZE);
276276
this->sendToDisplay("Touch to exit...");
277277
#endif
@@ -280,24 +280,24 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
280280
else {
281281
ap_config = temp_ap_name;
282282
#ifdef HAS_SCREEN
283-
this->sendToDisplay("AP name from AP list");
283+
this->sendToDisplay(F("AP name from AP list"));
284284
this->sendToDisplay("AP name: " + ap_config);
285285
#endif
286286
Serial.println("AP name from AP list: " + ap_config);
287287
}
288288
}
289289
else {
290-
Serial.println("Could not configure Access Point. Use stopscan...");
290+
Serial.println(F("Could not configure Access Point. Use stopscan..."));
291291
#ifdef HAS_SCREEN
292-
this->sendToDisplay("Could not configure Access Point.");
293-
this->sendToDisplay("Touch to exit...");
292+
this->sendToDisplay(F("Could not configure Access Point."));
293+
this->sendToDisplay(F("Touch to exit..."));
294294
#endif
295295
}
296296

297297
if (ap_config != "") {
298298
strncpy(apName, ap_config.c_str(), MAX_AP_NAME_SIZE);
299299
this->has_ap = true;
300-
Serial.println("ap config set");
300+
Serial.println(F("ap config set"));
301301
this->ap_index = targ_ap_index;
302302
return true;
303303
}
@@ -331,7 +331,7 @@ void EvilPortal::startAP() {
331331
WiFi.softAP(apName);
332332

333333
#ifdef HAS_SCREEN
334-
this->sendToDisplay("AP started");
334+
this->sendToDisplay(F("AP started"));
335335
#endif
336336

337337
Serial.print(F("ap ip address: "));
@@ -348,7 +348,7 @@ void EvilPortal::startAP() {
348348
server.begin();
349349
Serial.println(F("Server started"));
350350
#ifdef HAS_SCREEN
351-
this->sendToDisplay("Evil Portal READY");
351+
this->sendToDisplay(F("Evil Portal READY"));
352352
#endif
353353
}
354354

esp32_marauder/GpsInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void GpsInterface::begin() {
2222
uint32_t gps_baud = this->initGpsBaudAndForce115200();
2323

2424
if ((gps_baud != 9600) && (gps_baud != 115200))
25-
Serial.println("Could not detect GPS baudrate");
25+
Serial.println(F("Could not detect GPS baudrate"));
2626

2727
delay(1000);
2828

@@ -45,7 +45,7 @@ void GpsInterface::begin() {
4545
}
4646
else {
4747
this->gps_enabled = false;
48-
Serial.println("GPS Not Found");
48+
Serial.println(F("GPS Not Found"));
4949
}
5050

5151

esp32_marauder/MenuFunctions.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3513,7 +3513,6 @@ void MenuFunctions::buildButtons(Menu *menu, int starting_index, String button_n
35133513
button_name.toCharArray(buf, button_name.length() + 1);
35143514

35153515
if (i >= BUTTON_SCREEN_LIMIT) {
3516-
Serial.println("Error: Trying to access out-of-bounds button index " + (String)i);
35173516
break;
35183517
}
35193518

esp32_marauder/SDInterface.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ bool SDInterface::initSD() {
4747
#else
4848
this->spiExt = new SPIClass(FSPI);
4949
#endif
50-
Serial.println("Using external SPI configuration...");
50+
Serial.println(F("Using external SPI configuration..."));
5151
this->spiExt->begin(SPI_SCK, SPI_MISO, SPI_MOSI, SD_CS);
5252
if (!SD.begin(SD_CS, *(this->spiExt))) {
5353
#elif defined(HAS_C5_SD)
54-
Serial.println("Using C5 SD configuration...");
54+
Serial.println(F("Using C5 SD configuration..."));
5555
if (!SD.begin(SD_CS, *_spi)) {
5656
#else
5757
if (!SD.begin(SD_CS)) {
@@ -82,10 +82,8 @@ bool SDInterface::initSD() {
8282
}
8383

8484
if (!SD.exists("/SCRIPTS")) {
85-
Serial.println(F("/SCRIPTS does not exist. Creating..."));
8685

8786
SD.mkdir("/SCRIPTS");
88-
Serial.println(F("/SCRIPTS created"));
8987
}
9088

9189
this->sd_files = new LinkedList<String>();
@@ -96,7 +94,6 @@ bool SDInterface::initSD() {
9694
}
9795

9896
#else
99-
Serial.println(F("SD support disabled, skipping init"));
10097
return false;
10198
#endif
10299
}

esp32_marauder/WiFiScan.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ extern "C" {
274274
break;
275275
}
276276
default: {
277-
Serial.println(F("Please Provide a Company Type"));
278277
break;
279278
}
280279
}
@@ -705,7 +704,6 @@ extern "C" {
705704
mac.toUpperCase();
706705
int rssi = advertisedDevice->getRSSI();
707706

708-
Serial.println(F("[FLOCK PENGUIN BATTERY CANDIDATE]"));
709707
Serial.println(rssi);
710708
Serial.print(F(" MAC: "));
711709
Serial.println(mac);
@@ -1389,7 +1387,6 @@ extern "C" {
13891387
mac.toUpperCase();
13901388
int rssi = advertisedDevice->getRSSI();
13911389

1392-
Serial.println(F("[FLOCK PENGUIN BATTERY CANDIDATE]"));
13931390
Serial.println(rssi);
13941391
Serial.print(F(" MAC: "));
13951392
Serial.println(mac);
@@ -3228,7 +3225,6 @@ void WiFiScan::RunLoadATList() {
32283225
DynamicJsonDocument doc(10048);
32293226
DeserializationError error = deserializeJson(doc, file);
32303227
if (error) {
3231-
Serial.print(F("JSON deserialize error: "));
32323228
Serial.println(error.c_str());
32333229
file.close();
32343230
#ifdef HAS_SCREEN
@@ -3238,7 +3234,6 @@ void WiFiScan::RunLoadATList() {
32383234
display_obj.tft.setTextSize(1);
32393235
display_obj.tft.setTextColor(TFT_CYAN);
32403236

3241-
display_obj.tft.println(F("Could not deserialize JSON"));
32423237
display_obj.tft.println(error.c_str());
32433238
#endif
32443239
return;
@@ -3773,22 +3768,22 @@ void WiFiScan::logPoint(String lat, String lon, float alt, String datetime, bool
37733768

37743769
void WiFiScan::writeHeader(bool poi) {
37753770
Serial.println(F("Writing header to GPX file..."));
3776-
buffer_obj.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
3777-
buffer_obj.append("<gpx version=\"1.1\" creator=\"ESP32 GPS Logger\" xmlns=\"http://www.topografix.com/GPX/1/1\">\n");
3771+
buffer_obj.append(F("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"));
3772+
buffer_obj.append(F("<gpx version=\"1.1\" creator=\"ESP32 GPS Logger\" xmlns=\"http://www.topografix.com/GPX/1/1\">\n"));
37783773
if (!poi)
3779-
buffer_obj.append(" <trk>\n");
3780-
buffer_obj.append(" <name>ESP32 Track</name>\n");
3774+
buffer_obj.append(F(" <trk>\n"));
3775+
buffer_obj.append(F(" <name>ESP32 Track</name>\n"));
37813776
if (!poi)
3782-
buffer_obj.append(" <trkseg>\n");
3777+
buffer_obj.append(F(" <trkseg>\n"));
37833778
}
37843779

37853780
void WiFiScan::writeFooter(bool poi) {
37863781
Serial.println(F("Writing footer to GPX file...\n"));
37873782
if (!poi) {
3788-
buffer_obj.append(" </trkseg>\n");
3789-
buffer_obj.append(" </trk>\n");
3783+
buffer_obj.append(F(" </trkseg>\n"));
3784+
buffer_obj.append(F(" </trk>\n"));
37903785
}
3791-
buffer_obj.append("</gpx>\n");
3786+
buffer_obj.append(F("</gpx>\n"));
37923787
}
37933788

37943789
void WiFiScan::RunSetupGPSTracker(uint8_t scan_mode) {

esp32_marauder/esp32_marauder.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ void setup()
170170
delay(10);
171171

172172
#ifdef HAS_C5_SD
173-
Serial.println("Starting shared SPI for C5 SD configuration...");
174173
sharedSPI.begin(SD_SCK, SD_MISO, SD_MOSI);
175174
delay(100);
176175
#endif

0 commit comments

Comments
 (0)