This commit is contained in:
rusefi 2017-04-02 00:21:06 -04:00
commit 94794e4f38
2 changed files with 11 additions and 2 deletions

View File

@ -1754,8 +1754,8 @@ typedef enum {
CUSTOM_OBD_58 = 6058,
CUSTOM_OBD_59 = 6059,
CUSTOM_OBD_60 = 6060,
CUSTOM_OBD_61 = 6061,
CUSTOM_OBD_MMC_START1 = 6060,
CUSTOM_OBD_MMC_START2 = 6061,
CUSTOM_OBD_62 = 6062,
CUSTOM_OBD_63 = 6063,
CUSTOM_OBD_64 = 6064,

View File

@ -344,6 +344,10 @@ static void MMCmount(void) {
scheduleMsg(&logger, "Error: Already mounted. \"umountsd\" first");
return;
}
if ((MMCD1.state != BLK_STOP) && (MMCD1.state != BLK_ACTIVE)) {
firmwareError(CUSTOM_OBD_MMC_START1, "mmc_state1 %d", MMCD1.state);
return;
}
// start to initialize MMC/SD
mmcStart(&MMCD1, &mmccfg); // Configures and activates the MMC peripheral.
@ -430,6 +434,11 @@ void initMmcCard(void) {
// start to initialize MMC/SD
mmcObjectInit(&MMCD1); // Initializes an instance.
if ((MMCD1.state != BLK_STOP) && (MMCD1.state != BLK_ACTIVE)) {
firmwareError(CUSTOM_OBD_MMC_START2, "mmc_state2 %d", MMCD1.state);
return;
}
mmcStart(&MMCD1, &mmccfg);
chThdCreateStatic(mmcThreadStack, sizeof(mmcThreadStack), LOWPRIO, (tfunc_t) MMCmonThread, NULL);