From f4d13e84ccc416f6d4cb9f9f3b8ec3b53ded845a Mon Sep 17 00:00:00 2001 From: tadeubas Date: Mon, 13 Feb 2023 07:20:22 -0300 Subject: [PATCH] Reducing SD read timeout, allowing the use of machine_sdcard_remount_obj in order to support hot-plugging microSD --- components/drivers/sd_card/src/sdcard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/drivers/sd_card/src/sdcard.c b/components/drivers/sd_card/src/sdcard.c index 047edc5aa..3c199d702 100644 --- a/components/drivers/sd_card/src/sdcard.c +++ b/components/drivers/sd_card/src/sdcard.c @@ -166,7 +166,8 @@ static void sd_end_cmd(void) static uint8_t sd_get_response(void) { uint8_t result; - uint16_t timeout = 0xFFFF; // min: 0x5f + // was set to 0xFFF (values from 95 to 65535) + uint16_t timeout = 0xFDE; // min: 0x5f /*!< Check if response is got or a timeout is happen */ while (timeout--) {