Merge pull request #10468 from gemu2015/ufs-issues

Ufs issues
This commit is contained in:
Theo Arends 2021-01-09 10:22:20 +01:00 committed by GitHub
commit bba983f3be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 6 deletions

View File

@ -1609,7 +1609,7 @@ void GpioInit(void)
uint32_t sspi_mosi = (PinUsed(GPIO_SSPI_SCLK) && PinUsed(GPIO_SSPI_MOSI)) ? SPI_MOSI : SPI_NONE;
uint32_t sspi_miso = (PinUsed(GPIO_SSPI_SCLK) && PinUsed(GPIO_SSPI_MISO)) ? SPI_MISO : SPI_NONE;
TasmotaGlobal.soft_spi_enabled = sspi_mosi + sspi_miso;
AddLogSpi(0, Pin(GPIO_SSPI_SCLK), Pin(GPIO_SSPI_MOSI), PinUsed(GPIO_SSPI_MISO));
AddLogSpi(0, Pin(GPIO_SSPI_SCLK), Pin(GPIO_SSPI_MOSI), Pin(GPIO_SSPI_MISO));
#ifdef USE_SPI
#ifdef ESP8266

View File

@ -2512,7 +2512,7 @@ const mytmplt kModules[] PROGMEM =
AGPIO(GPIO_USER), // 1 IO TXD0 GPIO1, U0TXD
AGPIO(GPIO_USER), // 2 IO GPIO2, SPKR_DATA
AGPIO(GPIO_USER), // 3 IO RXD0 GPIO3, U0RXD
0, // 4 IO GPIO4, SPI_CS_CARD
AGPIO(GPIO_SDCARD_CS), // 4 IO GPIO4, SPI_CS_CARD
0, // 5 IO GPIO5, SPI_CS_LCD
// 6 IO GPIO6, Flash CLK
// 7 IO GPIO7, Flash D0

View File

@ -568,7 +568,8 @@ void Play_mp3(const char *path) {
I2S_Task = false;
}
file = new AudioFileSourceFS(*ufsp,path);
file = new AudioFileSourceFS(*ufsp, path);
id3 = new AudioFileSourceID3(file);
if (mp3ram) {
@ -584,11 +585,11 @@ void Play_mp3(const char *path) {
while (mp3->isRunning()) {
if (!mp3->loop()) {
mp3->stop();
mp3_delete();
break;
}
OsWatchLoop();
}
mp3_delete();
}
#endif // USE_SCRIPT

View File

@ -100,6 +100,7 @@ void UfsInitOnce(void) {
#ifdef ESP8266
ffsp = &LittleFS;
if (!LittleFS.begin()) {
ffsp = 0;
return;
}
#endif // ESP8266
@ -137,13 +138,27 @@ void UfsInit(void) {
#ifdef USE_SDCARD
void UfsCheckSDCardInit(void) {
#ifdef ESP8266
if (PinUsed(GPIO_SPI_CLK) && PinUsed(GPIO_SPI_MOSI) && PinUsed(GPIO_SPI_MISO)) {
#endif // ESP8266
#ifdef ESP32
if (TasmotaGlobal.spi_enabled) {
// if (1) {
#endif // ESP32
int8_t cs = SDCARD_CS_PIN;
if (PinUsed(GPIO_SDCARD_CS)) {
cs = Pin(GPIO_SDCARD_CS);
}
#ifdef EPS8266
SPI.begin();
#endif // EPS8266
#ifdef ESP32
SPI.begin(Pin(GPIO_SPI_CLK), Pin(GPIO_SPI_MISO), Pin(GPIO_SPI_MOSI), -1);
#endif // ESP32
if (SD.begin(cs)) {
#ifdef ESP8266
ufsp = &SDFS;
@ -154,7 +169,7 @@ void UfsCheckSDCardInit(void) {
#endif // ESP32
ufs_type = UFS_TSDC;
dfsp = ufsp;
ufs_dir = 1;
if (ffsp) {ufs_dir = 1;}
// make sd card the global filesystem
#ifdef ESP8266
// on esp8266 sdcard info takes several seconds !!!, so we ommit it here