From 54929f6aee7c5a58fc72dbdced2d6aaca843244a Mon Sep 17 00:00:00 2001 From: Jan Jongboom Date: Thu, 3 Aug 2017 12:59:52 +0200 Subject: [PATCH] STM32F4_HAL_MMC erase command check is wrong. == has higher precedence than & --- targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_mmc.c b/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_mmc.c index 04d269c6fb..6b4c063d60 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_mmc.c +++ b/targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_mmc.c @@ -1316,7 +1316,7 @@ HAL_StatusTypeDef HAL_MMC_Erase(MMC_HandleTypeDef *hmmc, uint32_t BlockStartAdd, hmmc->State = HAL_MMC_STATE_BUSY; /* Check if the card command class supports erase command */ - if((hmmc->MmcCard.Class) & SDIO_CCCC_ERASE == 0U) + if(((hmmc->MmcCard.Class) & SDIO_CCCC_ERASE) == 0U) { /* Clear all the static flags */ __HAL_MMC_CLEAR_FLAG(hmmc, SDIO_STATIC_FLAGS);