mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-05 20:40:25 -08:00
Add kit firmware modifications
This commit is contained in:
@@ -68,6 +68,10 @@ void Display::RunSetup()
|
||||
//digitalWrite(TFT_BL, HIGH);
|
||||
|
||||
//delay(5000);
|
||||
|
||||
#ifdef KIT
|
||||
pinMode(KIT_LED_BUILTIN, OUTPUT);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Interrupt driven periodic handler */
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
#define TFT_SHIELD
|
||||
//#define TFT_DIY
|
||||
//#define KIT
|
||||
|
||||
#define SCREEN_WIDTH 240
|
||||
#define SCREEN_HEIGHT 320
|
||||
@@ -70,6 +71,8 @@
|
||||
|
||||
#define STATUSBAR_COLOR 0x4A49
|
||||
|
||||
#define KIT_LED_BUILTIN 13
|
||||
|
||||
/*
|
||||
PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
|
||||
PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data);
|
||||
@@ -108,7 +111,7 @@ class Display
|
||||
TFT_eSPI tft = TFT_eSPI();
|
||||
TFT_eSprite img = TFT_eSprite(&tft);
|
||||
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
|
||||
const String PROGMEM version_number = "v0.9.1";
|
||||
const String PROGMEM version_number = "v0.9.2";
|
||||
|
||||
bool printing = false;
|
||||
bool loading = false;
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
bool SDInterface::initSD() {
|
||||
String display_string = "";
|
||||
|
||||
#ifdef KIT
|
||||
pinMode(SD_DET, INPUT);
|
||||
if (digitalRead(SD_DET) == LOW) {
|
||||
Serial.println(F("SD Card Detect Pin Detected"));
|
||||
}
|
||||
else {
|
||||
Serial.println(F("SD Card Detect Pin Not Detected"));
|
||||
this->supported = false;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!SD.begin(SD_CS)) {
|
||||
Serial.println(F("Failed to mount SD Card"));
|
||||
@@ -167,11 +179,28 @@ void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
|
||||
}
|
||||
}
|
||||
|
||||
bool SDInterface::checkDetectPin() {
|
||||
#ifdef KIT
|
||||
if (digitalRead(SD_DET) == LOW)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SDInterface::main() {
|
||||
if ((this->supported) && (this->do_save)) {
|
||||
//Serial.println("Saving packet...");
|
||||
buffer_obj.forceSave(&SD);
|
||||
}
|
||||
else if (!this->supported) {
|
||||
if (checkDetectPin()) {
|
||||
delay(100);
|
||||
this->initSD();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//void SDInterface::savePacket(uint8_t* buf, uint32_t len) {
|
||||
|
||||
@@ -11,9 +11,14 @@ extern Display display_obj;
|
||||
|
||||
#define SD_CS 12
|
||||
|
||||
#ifdef KIT
|
||||
#define SD_DET 4
|
||||
#endif
|
||||
|
||||
class SDInterface {
|
||||
|
||||
private:
|
||||
bool checkDetectPin();
|
||||
|
||||
public:
|
||||
uint8_t cardType;
|
||||
|
||||
BIN
pictures/IMG_3475 - Copy.jpg
Normal file
BIN
pictures/IMG_3475 - Copy.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
BIN
pictures/IMG_3484 - Copy.jpg
Normal file
BIN
pictures/IMG_3484 - Copy.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 113 KiB |
BIN
pictures/IMG_3485 - Copy.jpg
Normal file
BIN
pictures/IMG_3485 - Copy.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 286 KiB |
BIN
pictures/IMG_3491 - Copy.jpg
Normal file
BIN
pictures/IMG_3491 - Copy.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 509 KiB |
Reference in New Issue
Block a user