Skip to content

Commit

Permalink
Merge pull request #10696 from hydra/bf-config-id-sd-card-fix
Browse files Browse the repository at this point in the history
Fix infinite loop in SD card initialisation failure when CONFIG_IN_SDCARD is used.
  • Loading branch information
mikeller committed Apr 26, 2021
1 parent e0562d6 commit 411b715
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/pg/sdcard.c
Expand Up @@ -45,7 +45,17 @@ void pgResetFn_sdcardConfig(sdcardConfig_t *config)
// On generic targets, SPI has precedence over SDIO; SDIO must be post-flash configured.
config->useDma = false;
config->device = SPI_DEV_TO_CFG(SPIINVALID);

#ifdef CONFIG_IN_SDCARD
// CONFIG_ID_SDDCARD requires a default mode.
#if defined(USE_SDCARD_SDIO)
config->mode = SDCARD_MODE_SDIO;
#elif defined(USE_SDCARD_SPI)
config->mode = SDCARD_MODE_SPI;
#endif
#else
config->mode = SDCARD_MODE_NONE;
#endif

#ifdef USE_SDCARD_SPI
// These settings do not work for Unified Targets
Expand Down

0 comments on commit 411b715

Please sign in to comment.