KugleFirmware/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c
/**
  * @brief  Unlock the FLASH Option Control Registers access.
  * @retval HAL Status
  */
@brief  Unlock the FLASH Option Control Registers access.
@retval HAL Status
@brief Unlock the FLASH Option Control Registers access . @retval HAL Status
HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void)
{
  if(READ_BIT(FLASH->OPTCR, FLASH_OPTCR_OPTLOCK) != RESET)
  {
    WRITE_REG(FLASH->OPTKEYR, FLASH_OPT_KEY1);
    WRITE_REG(FLASH->OPTKEYR, FLASH_OPT_KEY2);
  }
  else
  {
    return HAL_ERROR;
  }  
  return HAL_OK;  
}
HAL_StatusTypeDef HAL_FLASH_OB_Unlock ( void ) { if ( READ_BIT ( FLASH -> OPTCR , FLASH_OPTCR_OPTLOCK ) != RESET ) { WRITE_REG ( FLASH -> OPTKEYR , FLASH_OPT_KEY1 ) ; WRITE_REG ( FLASH -> OPTKEYR , FLASH_OPT_KEY2 ) ; } else { return HAL_ERROR ; } return HAL_OK ; }
@brief  Unlock the FLASH Option Control Registers access.
@brief Unlock the FLASH Option Control Registers access .
/* Authorizes the Option Byte register programming */