Skip to content

Commit

Permalink
STM32F7 HAL CRYPT patch to add missing UNLOCK
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecoutant authored and adbridge committed Nov 18, 2019
1 parent c7e6be5 commit 7eb6ed6
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_cryp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,10 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u

default:
hcryp->ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED;

/* Process unlocked */
__HAL_UNLOCK(hcryp); // MBED patch

return HAL_ERROR;
}

Expand Down Expand Up @@ -1057,6 +1061,10 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u

default:
hcryp->ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED;

/* Process unlocked */
__HAL_UNLOCK(hcryp); // MBED patch

return HAL_ERROR;
}
#endif /*end AES or CRYP */
Expand All @@ -1065,10 +1073,10 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
{
/* Change the CRYP peripheral state */
hcryp->State = HAL_CRYP_STATE_READY;

}

/* Process unlocked */
__HAL_UNLOCK(hcryp);
}
__HAL_UNLOCK(hcryp); // MBED patch
}
else
{
Expand Down Expand Up @@ -1186,6 +1194,10 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u

default:
hcryp->ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED;

/* Process unlocked */
__HAL_UNLOCK(hcryp); // MBED patch

return HAL_ERROR;
}

Expand Down Expand Up @@ -1230,10 +1242,10 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
{
/* Change the CRYP peripheral state */
hcryp->State = HAL_CRYP_STATE_READY;

/* Process unlocked */
__HAL_UNLOCK(hcryp);
}

/* Process unlocked */
__HAL_UNLOCK(hcryp); // MBED patch
}
else
{
Expand Down

0 comments on commit 7eb6ed6

Please sign in to comment.