From d928591a8034cfab2e77309861e1e243157882b9 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Mon, 17 Jun 2019 01:45:47 +0200 Subject: [PATCH] sdmcc.c: Longer delay on SD init (thanks @profi200) --- arm9/source/nand/sdmmc.c | 2 +- arm9/source/nand/wait.s | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arm9/source/nand/sdmmc.c b/arm9/source/nand/sdmmc.c index 1f3d2e7..3654f98 100644 --- a/arm9/source/nand/sdmmc.c +++ b/arm9/source/nand/sdmmc.c @@ -469,7 +469,7 @@ int SD_Init() // We need to send at least 74 clock pulses. set_target(&handleSD); - wait(0x1980); // ~75-76 clocks + wait(2 * 128 * 74); sdmmc_send_command(&handleSD,0,0); sdmmc_send_command(&handleSD,0x10408,0x1AA); diff --git a/arm9/source/nand/wait.s b/arm9/source/nand/wait.s index 8cb3a58..2647d90 100644 --- a/arm9/source/nand/wait.s +++ b/arm9/source/nand/wait.s @@ -5,7 +5,6 @@ .global wait .type wait, %function wait: - subs r0, r0, #2 - nop - bgt wait + subs r0, r0, #4 + bcs wait bx lr