mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 07:40:58 -08:00
Fixes
Fix wifi shutdown Fix eapolScan Fix font size Fix strings Fix for loops
This commit is contained in:
@@ -34,10 +34,10 @@ void Display::RunSetup()
|
||||
|
||||
#ifdef TFT_SHIELD
|
||||
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
|
||||
Serial.println("Using TFT Shield");
|
||||
Serial.println(F("Using TFT Shield"));
|
||||
#else if defined(TFT_DIY)
|
||||
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
|
||||
Serial.println("Using TFT DIY");
|
||||
Serial.println(F("Using TFT DIY"));
|
||||
#endif
|
||||
tft.setTouch(calData);
|
||||
|
||||
@@ -52,7 +52,7 @@ void Display::RunSetup()
|
||||
// Initialize file system
|
||||
// This should probably have its own class
|
||||
if (!SPIFFS.begin()) {
|
||||
Serial.println("SPIFFS initialisation failed!");
|
||||
Serial.println(F("SPIFFS initialisation failed!"));
|
||||
while (1) yield(); // Stay here twiddling thumbs waiting
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ void Display::touchToExit()
|
||||
// Function to just draw the screen black
|
||||
void Display::clearScreen()
|
||||
{
|
||||
Serial.println("clearScreen()");
|
||||
Serial.println(F("clearScreen()"));
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setCursor(0, 0);
|
||||
}
|
||||
@@ -354,7 +354,7 @@ void Display::showCenterText(String text, int y)
|
||||
|
||||
void Display::initScrollValues(bool tte)
|
||||
{
|
||||
Serial.println("initScrollValues()");
|
||||
Serial.println(F("initScrollValues()"));
|
||||
yDraw = YMAX - BOT_FIXED_AREA - TEXT_HEIGHT;
|
||||
|
||||
xPos = 0;
|
||||
@@ -372,7 +372,7 @@ void Display::initScrollValues(bool tte)
|
||||
yArea = YMAX - TOP_FIXED_AREA_2 - BOT_FIXED_AREA;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 18; i++) blank[i] = 0;
|
||||
for(uint8_t i = 0; i < 18; i++) blank[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ int Display::scroll_line(uint32_t color) {
|
||||
|
||||
// Function to setup hardware scroll for TFT screen
|
||||
void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
|
||||
Serial.println("setupScrollArea()");
|
||||
Serial.println(F("setupScrollArea()"));
|
||||
Serial.println(" tfa: " + (String)tfa);
|
||||
Serial.println(" bfa: " + (String)bfa);
|
||||
Serial.println("yStart: " + (String)this->yStart);
|
||||
@@ -458,7 +458,7 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) {
|
||||
jpegRender(xpos, ypos);
|
||||
}
|
||||
else {
|
||||
Serial.println("Jpeg file format not supported!");
|
||||
Serial.println(F("Jpeg file format not supported!"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ void Display::drawStylus()
|
||||
boolean pressed = tft.getTouch(&x, &y);
|
||||
|
||||
if ((x <= 10) && (y <= 10) && (pressed)) {
|
||||
Serial.println("Exit draw function");
|
||||
Serial.println(F("Exit draw function"));
|
||||
this->draw_tft = false;
|
||||
this->exit_draw = true;
|
||||
return;
|
||||
@@ -646,16 +646,16 @@ void createArray(const char *filename) {
|
||||
uint8_t data;
|
||||
byte line_len = 0;
|
||||
Serial.println("");
|
||||
Serial.println("// Generated by a JPEGDecoder library example sketch:");
|
||||
Serial.println("// https://github.com/Bodmer/JPEGDecoder");
|
||||
Serial.println(F("// Generated by a JPEGDecoder library example sketch:"));
|
||||
Serial.println(F("// https://github.com/Bodmer/JPEGDecoder"));
|
||||
Serial.println("");
|
||||
Serial.println("#if defined(__AVR__)");
|
||||
Serial.println(" #include <avr/pgmspace.h>");
|
||||
Serial.println("#endif");
|
||||
Serial.println(F("#if defined(__AVR__)"));
|
||||
Serial.println(F(" #include <avr/pgmspace.h>"));
|
||||
Serial.println(F("#endif"));
|
||||
Serial.println("");
|
||||
Serial.print ("const uint8_t ");
|
||||
Serial.print (F("const uint8_t "));
|
||||
while (*filename != '.') Serial.print(*filename++);
|
||||
Serial.println("[] PROGMEM = {"); // PROGMEM added for AVR processors, it is ignored by Due
|
||||
Serial.println(F("[] PROGMEM = {")); // PROGMEM added for AVR processors, it is ignored by Due
|
||||
|
||||
while ( jpgFile.available()) {
|
||||
|
||||
@@ -681,13 +681,13 @@ void createArray(const char *filename) {
|
||||
#ifdef ESP8266
|
||||
void Display::listFiles(void) {
|
||||
Serial.println();
|
||||
Serial.println("SPIFFS files found:");
|
||||
Serial.println(F("SPIFFS files found:"));
|
||||
|
||||
fs::Dir dir = SPIFFS.openDir("/"); // Root directory
|
||||
String line = "=====================================";
|
||||
|
||||
Serial.println(line);
|
||||
Serial.println(" File name Size");
|
||||
Serial.println(F(" File name Size"));
|
||||
Serial.println(line);
|
||||
|
||||
while (dir.next()) {
|
||||
@@ -720,22 +720,22 @@ void Display::listFiles(void) {
|
||||
void Display::listDir(fs::FS &fs, const char * dirname, uint8_t levels) {
|
||||
|
||||
Serial.println();
|
||||
Serial.println("SPIFFS files found:");
|
||||
Serial.println(F("SPIFFS files found:"));
|
||||
|
||||
Serial.printf("Listing directory: %s\n", "/");
|
||||
String line = "=====================================";
|
||||
|
||||
Serial.println(line);
|
||||
Serial.println(" File name Size");
|
||||
Serial.println(F(" File name Size"));
|
||||
Serial.println(line);
|
||||
|
||||
fs::File root = fs.open(dirname);
|
||||
if (!root) {
|
||||
Serial.println("Failed to open directory");
|
||||
Serial.println(F("Failed to open directory"));
|
||||
return;
|
||||
}
|
||||
if (!root.isDirectory()) {
|
||||
Serial.println("Not a directory");
|
||||
Serial.println(F("Not a directory"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user