Add kit firmware modifications

This commit is contained in:
Just Call Me Koko
2021-07-08 18:44:47 -04:00
parent f801ba0bc5
commit a23e7a4c48
8 changed files with 42 additions and 1 deletions

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 KiB