diff --git a/tasmota/xdrv_50_filesystem.ino b/tasmota/xdrv_50_filesystem.ino index 7d9f6b5b5..b36a11260 100644 --- a/tasmota/xdrv_50_filesystem.ino +++ b/tasmota/xdrv_50_filesystem.ino @@ -146,6 +146,7 @@ void UfsCheckSDCardInit(void) { cs = Pin(GPIO_SDCARD_CS); } + #ifdef EPS8266 SPI.begin(); #endif // EPS8266 @@ -563,7 +564,12 @@ const char UFS_FORM_FILE_UPGb[] PROGMEM = "
" "
" #endif - "" D_SHOW_HIDDEN_FILES "" +; + +const char UFS_FORM_FILE_UPGb1[] PROGMEM = + "" D_SHOW_HIDDEN_FILES ""; + +const char UFS_FORM_FILE_UPGb2[] PROGMEM = "" "" ""; @@ -665,14 +671,30 @@ void UfsDirectory(void) { } WSContentSend_P(UFS_FORM_SDC_DIRc); WSContentSend_P(UFS_FORM_FILE_UPGb); + if (!isSDC()) { + WSContentSend_P(UFS_FORM_FILE_UPGb1); + } + WSContentSend_P(UFS_FORM_FILE_UPGb2); + WSContentSpaceButton(BUTTON_MANAGEMENT); WSContentStop(); Web.upload_file_type = UPL_UFSFILE; } +// return true if SDC +bool isSDC(void) { +#ifndef SDC_HIDE_INVISIBLES + return false; +#else + if (((uint32_t)ufsp != (uint32_t)ffsp) && ((uint32_t)ffsp == (uint32_t)dfsp)) return false; + if (((uint32_t)ufsp == (uint32_t)ffsp) && (ufs_type != UFS_TSDC)) return false; + return true; +#endif +} + void UfsListDir(char *path, uint8_t depth) { - char name[32]; + char name[48]; char npath[128]; char format[12]; sprintf(format, PSTR("%%-%ds"), 24 - depth); @@ -717,6 +739,8 @@ void UfsListDir(char *path, uint8_t depth) { // osx formatted disks contain a lot of stuff we dont want bool hiddable = UfsReject((char*)ep); + if (!hiddable || !isSDC() ) { + for (uint8_t cnt = 0; cnt