mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 20:06:42 +01:00
Disconnect SDCard if it shares the pins with the flasher
Signed-off-by: Mimoja <git@mimoja.de>
This commit is contained in:
@@ -25,6 +25,7 @@ class DynStorage {
|
||||
public:
|
||||
DynStorage();
|
||||
void begin();
|
||||
void end();
|
||||
void listFiles();
|
||||
size_t freeSpace();
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include "storage.h"
|
||||
#include "LittleFS.h"
|
||||
#include <MD5Builder.h>
|
||||
// #include <FS.h>
|
||||
|
||||
@@ -109,9 +110,11 @@ class flasher {
|
||||
|
||||
flasher::flasher() {
|
||||
zbs = new ZBS_interface;
|
||||
Storage.end();
|
||||
}
|
||||
flasher::~flasher() {
|
||||
delete zbs;
|
||||
Storage.begin();
|
||||
}
|
||||
|
||||
bool flasher::connectTag(uint8_t port) {
|
||||
|
||||
@@ -141,6 +141,27 @@ void DynStorage::begin() {
|
||||
}
|
||||
}
|
||||
|
||||
void DynStorage::end() {
|
||||
#ifdef HAS_SDCARD
|
||||
initLittleFS();
|
||||
if (SD_CARD_CLK == FLASHER_AP_CLK ||
|
||||
SD_CARD_MISO == FLASHER_AP_MISO ||
|
||||
SD_CARD_MOSI == FLASHER_AP_MOSI) {
|
||||
Serial.println("Tearing down SD card connection");
|
||||
|
||||
copyBetweenFS(*contentFS, "/tag_md5_db.json", LittleFS);
|
||||
copyBetweenFS(*contentFS, "/AP_FW_Pack.bin", LittleFS);
|
||||
if (contentFS->exists("/AP_force_flash.bin")) {
|
||||
copyBetweenFS(*contentFS, "/AP_force_flash.bin", LittleFS);
|
||||
contentFS->remove("/AP_force_flash.bin");
|
||||
}
|
||||
Serial.println("Swapping to LittleFS");
|
||||
|
||||
contentFS = &LittleFS;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void listDir(fs::FS& fs, const char* dirname, uint8_t levels) {
|
||||
Storage.begin();
|
||||
|
||||
Reference in New Issue
Block a user