Skip to content

Commit

Permalink
fix: wrong preprocessor tests
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Jul 5, 2023
1 parent 338f600 commit e656bc8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bsp_sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ uint8_t BSP_SD_GetInstance(void)
SD_PinNames.pin_d3 = PinMap_SD_DATA3[0].pin;
SD_PinNames.pin_cmd = PinMap_SD_CMD[0].pin;
SD_PinNames.pin_ck = PinMap_SD_CK[0].pin;
#if defined(SDMMC1) && defined(SDMMC2)
#if defined(SDMMC1) || defined(SDMMC2)
SD_PinNames.pin_ckin = PinMap_SD_CKIN[0].pin;
SD_PinNames.pin_cdir = PinMap_SD_CDIR[0].pin;
SD_PinNames.pin_d0dir = PinMap_SD_D0DIR[0].pin;
SD_PinNames.pin_d123dir = PinMap_SD_D123DIR[0].pin;
#endif /* SDMMC1 && SDMMC2 */
#endif /* SDMMC1 || SDMMC2 */
}
/* Get SD instance from pins */
sd_d0 = pinmap_peripheral(SD_PinNames.pin_d0, PinMap_SD_DATA0);
Expand All @@ -192,7 +192,7 @@ uint8_t BSP_SD_GetInstance(void)
return MSD_ERROR;
}
uSdHandle.Instance = sd_base;
#if defined(SDMMC1) && defined(SDMMC2)
#if defined(SDMMC1) || defined(SDMMC2)
if (SD_PinNames.pin_ckin != NC) {
SD_TypeDef *sd_ckin = pinmap_peripheral(SD_PinNames.pin_ckin, PinMap_SD_CKIN);
SD_TypeDef *sd_cdir = pinmap_peripheral(SD_PinNames.pin_cdir, PinMap_SD_CDIR);
Expand Down Expand Up @@ -508,7 +508,7 @@ __weak void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params)
pinmap_pinout(SD_PinNames.pin_d3, PinMap_SD_DATA3);
pinmap_pinout(SD_PinNames.pin_cmd, PinMap_SD_CMD);
pinmap_pinout(SD_PinNames.pin_ck, PinMap_SD_CK);
#if defined(SDMMC1) && defined(SDMMC2)
#if defined(SDMMC1) || defined(SDMMC2)
if (SD_PinNames.pin_ckin != NC) {
pinmap_pinout(SD_PinNames.pin_ckin, PinMap_SD_CKIN);
pinmap_pinout(SD_PinNames.pin_cdir, PinMap_SD_CDIR);
Expand Down Expand Up @@ -573,7 +573,7 @@ __weak void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
HAL_GPIO_DeInit((GPIO_TypeDef *)STM_PORT(SD_PinNames.pin_d3), STM_GPIO_PIN(SD_PinNames.pin_d3));
HAL_GPIO_DeInit((GPIO_TypeDef *)STM_PORT(SD_PinNames.pin_cmd), STM_GPIO_PIN(SD_PinNames.pin_cmd));
HAL_GPIO_DeInit((GPIO_TypeDef *)STM_PORT(SD_PinNames.pin_ck), STM_GPIO_PIN(SD_PinNames.pin_ck));
#if defined(SDMMC1) && defined(SDMMC2)
#if defined(SDMMC1) || defined(SDMMC2)
if (SD_PinNames.pin_ckin != NC) {
HAL_GPIO_DeInit((GPIO_TypeDef *)STM_PORT(SD_PinNames.pin_ckin), STM_GPIO_PIN(SD_PinNames.pin_ckin));
HAL_GPIO_DeInit((GPIO_TypeDef *)STM_PORT(SD_PinNames.pin_cdir), STM_GPIO_PIN(SD_PinNames.pin_cdir));
Expand Down

0 comments on commit e656bc8

Please sign in to comment.