mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-13 00:00:44 -08:00
Add kit firmware modifications
This commit is contained in:
@@ -68,6 +68,10 @@ void Display::RunSetup()
|
|||||||
//digitalWrite(TFT_BL, HIGH);
|
//digitalWrite(TFT_BL, HIGH);
|
||||||
|
|
||||||
//delay(5000);
|
//delay(5000);
|
||||||
|
|
||||||
|
#ifdef KIT
|
||||||
|
pinMode(KIT_LED_BUILTIN, OUTPUT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Interrupt driven periodic handler */
|
/* Interrupt driven periodic handler */
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
#define TFT_SHIELD
|
#define TFT_SHIELD
|
||||||
//#define TFT_DIY
|
//#define TFT_DIY
|
||||||
|
//#define KIT
|
||||||
|
|
||||||
#define SCREEN_WIDTH 240
|
#define SCREEN_WIDTH 240
|
||||||
#define SCREEN_HEIGHT 320
|
#define SCREEN_HEIGHT 320
|
||||||
@@ -70,6 +71,8 @@
|
|||||||
|
|
||||||
#define STATUSBAR_COLOR 0x4A49
|
#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 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);
|
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_eSPI tft = TFT_eSPI();
|
||||||
TFT_eSprite img = TFT_eSprite(&tft);
|
TFT_eSprite img = TFT_eSprite(&tft);
|
||||||
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
|
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 printing = false;
|
||||||
bool loading = false;
|
bool loading = false;
|
||||||
|
|||||||
@@ -2,6 +2,18 @@
|
|||||||
|
|
||||||
bool SDInterface::initSD() {
|
bool SDInterface::initSD() {
|
||||||
String display_string = "";
|
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)) {
|
if (!SD.begin(SD_CS)) {
|
||||||
Serial.println(F("Failed to mount SD Card"));
|
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() {
|
void SDInterface::main() {
|
||||||
if ((this->supported) && (this->do_save)) {
|
if ((this->supported) && (this->do_save)) {
|
||||||
//Serial.println("Saving packet...");
|
//Serial.println("Saving packet...");
|
||||||
buffer_obj.forceSave(&SD);
|
buffer_obj.forceSave(&SD);
|
||||||
}
|
}
|
||||||
|
else if (!this->supported) {
|
||||||
|
if (checkDetectPin()) {
|
||||||
|
delay(100);
|
||||||
|
this->initSD();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//void SDInterface::savePacket(uint8_t* buf, uint32_t len) {
|
//void SDInterface::savePacket(uint8_t* buf, uint32_t len) {
|
||||||
|
|||||||
@@ -11,9 +11,14 @@ extern Display display_obj;
|
|||||||
|
|
||||||
#define SD_CS 12
|
#define SD_CS 12
|
||||||
|
|
||||||
|
#ifdef KIT
|
||||||
|
#define SD_DET 4
|
||||||
|
#endif
|
||||||
|
|
||||||
class SDInterface {
|
class SDInterface {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool checkDetectPin();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
uint8_t cardType;
|
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