From 3edb5bb0964e92a9000cafd8be950974b94067bd Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 1 Jul 2023 12:48:33 +0200 Subject: [PATCH] Move SD card init up Move SD card init up (#18934) --- tasmota/tasmota_support/support_tasmota.ino | 6 ++++++ tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino | 3 +++ 2 files changed, 9 insertions(+) diff --git a/tasmota/tasmota_support/support_tasmota.ino b/tasmota/tasmota_support/support_tasmota.ino index 0c37a5eb0..113181ce0 100644 --- a/tasmota/tasmota_support/support_tasmota.ino +++ b/tasmota/tasmota_support/support_tasmota.ino @@ -2261,6 +2261,12 @@ void GpioInit(void) } } +#ifdef USE_UFILESYS +#ifdef USE_SDCARD + UfsCheckSDCardInit(); +#endif // USE_SDCARD +#endif // USE_UFILESYS + XdrvCall(FUNC_SETUP_RING1); // Setup RTC hardware XsnsXdrvCall(FUNC_SETUP_RING2); // Setup hardware supporting virtual switches/buttons/relays diff --git a/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino b/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino index e61a22535..d3d0acbd7 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino @@ -1138,11 +1138,14 @@ bool Xdrv50(uint32_t function) { case FUNC_LOOP: UfsExecuteCommandFileLoop(); break; +/* +// Moved to support_tasmota.ino for earlier init to be used by scripter #ifdef USE_SDCARD case FUNC_PRE_INIT: UfsCheckSDCardInit(); break; #endif // USE_SDCARD +*/ case FUNC_MQTT_INIT: if (!TasmotaGlobal.no_autoexec) { UfsExecuteCommandFile(TASM_FILE_AUTOEXEC);