From c77aea65b0a261536b1359f82d8bfdfa4ec1d7e3 Mon Sep 17 00:00:00 2001 From: cosmicpsyop Date: Tue, 4 Jun 2024 09:02:40 -0700 Subject: [PATCH] t-hmi: SD_FREQENCY for everyone --- src/drivers/devices/lilygoT_HMI.h | 1 + src/drivers/storage/SDCard.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/drivers/devices/lilygoT_HMI.h b/src/drivers/devices/lilygoT_HMI.h index ec1e097..abb631f 100644 --- a/src/drivers/devices/lilygoT_HMI.h +++ b/src/drivers/devices/lilygoT_HMI.h @@ -36,6 +36,7 @@ #define TOUCH_ENABLE (1) #define SDMMC_1BIT_FIX (1) +#define SD_FREQUENCY (20000) #ifndef TFT_BL // XXX - defined in User_Setups/Setup207_LilyGo_T_HMI.h:37 #define TFT_BL (38) // LED back-light diff --git a/src/drivers/storage/SDCard.cpp b/src/drivers/storage/SDCard.cpp index 98e58df..378d874 100644 --- a/src/drivers/storage/SDCard.cpp +++ b/src/drivers/storage/SDCard.cpp @@ -169,9 +169,9 @@ bool SDCard::initSDcard() #elif defined (BUILD_SDMMC_1) #warning SDMMC : 1 - bit mode is not always working. If you experience issues, try other modes. iSD_->setPins(SDMMC_CLK, SDMMC_CMD, SDMMC_D0); -#ifdef NERDMINER_T_HMI +#ifdef SD_FREQUENCY // Need to lower frequency to 20000 for proper detection - cardInitialized_ = iSD_->begin("/sd", true, false, 20000); + cardInitialized_ = iSD_->begin("/sd", true, false, SD_FREQUENCY); #else cardInitialized_ = iSD_->begin("/sd", true); #endif