stm32f1xx_hal_sram.c: Fix that SRAM state not set correctly
Fixes SRAM HAL code always set `State` to `HAL_SRAM_STATE_READY` even `WriteOperation` is not set.
This commit is contained in:
parent
bdec2f6b06
commit
bd0201714b
|
|
@ -215,7 +215,10 @@ HAL_StatusTypeDef HAL_SRAM_Init(SRAM_HandleTypeDef *hsram, FSMC_NORSRAM_TimingTy
|
|||
__FSMC_NORSRAM_ENABLE(hsram->Instance, hsram->Init.NSBank);
|
||||
|
||||
/* Initialize the SRAM controller state */
|
||||
hsram->State = HAL_SRAM_STATE_READY;
|
||||
if (hsram->Init.WriteOperation == FSMC_WRITE_OPERATION_DISABLE)
|
||||
hsram->State = HAL_SRAM_STATE_PROTECTED;
|
||||
else
|
||||
hsram->State = HAL_SRAM_STATE_READY;
|
||||
|
||||
return HAL_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue