From d8c9399cfff12cbb2214f5cb30ffc51abade6132 Mon Sep 17 00:00:00 2001 From: Max K Date: Mon, 11 Jun 2018 06:09:48 +0200 Subject: [PATCH] fusee: Run periodic autocal only on the uSD controller (#137) --- fusee/fusee-primary/src/sdmmc.c | 5 ++++- fusee/fusee-secondary/src/sdmmc.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fusee/fusee-primary/src/sdmmc.c b/fusee/fusee-primary/src/sdmmc.c index 1b36bfd3b..4deb1066d 100644 --- a/fusee/fusee-primary/src/sdmmc.c +++ b/fusee/fusee-primary/src/sdmmc.c @@ -2175,7 +2175,10 @@ static int sdmmc_send_command(struct mmc *mmc, enum sdmmc_command command, } } - sdmmc_run_autocal(mmc, true); + // Periodically recalibrate the SD controller + if (mmc->controller == SWITCH_MICROSD) { + sdmmc_run_autocal(mmc, true); + } // If we have data to send, prepare it. sdmmc_prepare_command_data(mmc, blocks_to_transfer, is_write, auto_terminate, mmc->use_dma, argument); diff --git a/fusee/fusee-secondary/src/sdmmc.c b/fusee/fusee-secondary/src/sdmmc.c index 78f2baff5..1f6879e3a 100644 --- a/fusee/fusee-secondary/src/sdmmc.c +++ b/fusee/fusee-secondary/src/sdmmc.c @@ -2176,7 +2176,10 @@ static int sdmmc_send_command(struct mmc *mmc, enum sdmmc_command command, } } - sdmmc_run_autocal(mmc, true); + // Periodically recalibrate the SD controller + if (mmc->controller == SWITCH_MICROSD) { + sdmmc_run_autocal(mmc, true); + } // If we have data to send, prepare it. sdmmc_prepare_command_data(mmc, blocks_to_transfer, is_write, auto_terminate, mmc->use_dma, argument);