sdcrad optional compile (saves 7k)

#define USE_SDCARD
This commit is contained in:
gemu2015 2021-01-01 11:08:48 +01:00
parent 03a9d5b71f
commit f86bfbc298
1 changed files with 9 additions and 0 deletions

View File

@ -50,11 +50,15 @@ driver enabled by
#ifdef ESP8266
#include <LittleFS.h>
#include <SPI.h>
#ifdef USE_SDCARD
#include <SD.h>
#include <SDFAT.h>
#endif
#else
#include <LITTLEFS.h>
#ifdef USE_SDCARD
#include <SD.h>
#endif
#include "FFat.h"
#include "FS.h"
#include "SPIFFS.h"
@ -92,6 +96,8 @@ void UFSInit(void) {
// 1. check for SD card
// 2. check for littlefs or FAT
// 3. check for SPIFFS obsolete
#ifdef USE_SDCARD
// if (TasmotaGlobal.spi_enabled) {
if (1) {
int8_t cs;
@ -111,6 +117,7 @@ void UFSInit(void) {
return;
}
}
#endif
// if no success with sd card try flash fs
#ifdef ESP8266
@ -146,6 +153,7 @@ uint32_t result = 0;
switch (ufs_type) {
case UFS_TSDC:
#ifdef USE_SDCARD
#ifdef ESP32
if (sel == 0) {
result = SD.totalBytes();
@ -154,6 +162,7 @@ uint32_t result = 0;
}
#else
// currently no size support on esp8266 sdcard
#endif
#endif
break;