KugleFirmware/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c
/**
  * @brief  Unlock the FLASH control registers access
  * @retval HAL Status
  */
@brief  Unlock the FLASH control registers access
@retval HAL Status
@brief Unlock the FLASH control registers access @retval HAL Status
HAL_StatusTypeDef HAL_FLASH_Unlock(void)
{
  if((READ_BIT(FLASH->CR1, FLASH_CR_LOCK) != RESET) && (READ_BIT(FLASH->CR2, FLASH_CR_LOCK) != RESET))
  {
    WRITE_REG(FLASH->KEYR1, FLASH_KEY1);
    WRITE_REG(FLASH->KEYR1, FLASH_KEY2);
    WRITE_REG(FLASH->KEYR2, FLASH_KEY1);
    WRITE_REG(FLASH->KEYR2, FLASH_KEY2);
  }
  else
  {
    return HAL_ERROR;
  }
  return HAL_OK;
}
HAL_StatusTypeDef HAL_FLASH_Unlock ( void ) { if ( ( READ_BIT ( FLASH -> CR1 , FLASH_CR_LOCK ) != RESET ) && ( READ_BIT ( FLASH -> CR2 , FLASH_CR_LOCK ) != RESET ) ) { WRITE_REG ( FLASH -> KEYR1 , FLASH_KEY1 ) ; WRITE_REG ( FLASH -> KEYR1 , FLASH_KEY2 ) ; WRITE_REG ( FLASH -> KEYR2 , FLASH_KEY1 ) ; WRITE_REG ( FLASH -> KEYR2 , FLASH_KEY2 ) ; } else { return HAL_ERROR ; } return HAL_OK ; }
@brief  Unlock the FLASH control registers access
 @retval HAL Status
@brief Unlock the FLASH control registers access @retval HAL Status
/* Authorize the FLASH A Registers access */ /* Authorize the FLASH B Registers access */