Browse Source

Even more startup clock cycles - clear any stale card state

main
PaulStoffregen 7 years ago
parent
commit
e02764de2f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      utility/KinetisSDHC.c

+ 1
- 1
utility/KinetisSDHC.c View File

// initial clocks... SD spec says only 74 clocks are needed, but if Teensy rebooted // initial clocks... SD spec says only 74 clocks are needed, but if Teensy rebooted
// while the card was in middle of an operation, thousands of clock cycles can be // while the card was in middle of an operation, thousands of clock cycles can be
// needed to get the card to complete a prior command and return to a usable state. // needed to get the card to complete a prior command and return to a usable state.
for (i=0; i < 50; i++) {
for (i=0; i < 500; i++) {
SDHC_SYSCTL |= SDHC_SYSCTL_INITA; SDHC_SYSCTL |= SDHC_SYSCTL_INITA;
while (SDHC_SYSCTL & SDHC_SYSCTL_INITA) { }; while (SDHC_SYSCTL & SDHC_SYSCTL_INITA) { };
} }

Loading…
Cancel
Save