Add SD history UI and pin remap

- Add SD history chart + download listing to web UI
- Use HSPI for SD and fix SD pin mapping
- Swap role/OLED control pins and update role detection
- Update README pin mapping and SD/history docs
This commit is contained in:
2026-02-02 01:43:54 +01:00
parent d32ae30014
commit b5477262ea
7 changed files with 484 additions and 15 deletions

View File

@@ -5,6 +5,7 @@
#include <time.h>
static bool g_sd_ready = false;
static SPIClass *g_sd_spi = nullptr;
static const char *fault_text(FaultType fault) {
switch (fault) {
@@ -43,7 +44,20 @@ void sd_logger_init() {
g_sd_ready = false;
return;
}
g_sd_ready = SD.begin(PIN_SD_CS);
if (!g_sd_spi) {
g_sd_spi = new SPIClass(HSPI);
}
g_sd_spi->begin(PIN_SD_SCK, PIN_SD_MISO, PIN_SD_MOSI, PIN_SD_CS);
g_sd_ready = SD.begin(PIN_SD_CS, *g_sd_spi);
if (SERIAL_DEBUG_MODE) {
if (g_sd_ready) {
uint8_t type = SD.cardType();
uint64_t size = SD.cardSize();
Serial.printf("sd: ok type=%u size=%llu\n", static_cast<unsigned>(type), static_cast<unsigned long long>(size));
} else {
Serial.println("sd: init failed");
}
}
}
bool sd_logger_is_ready() {