/* Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY/ BOOT1 and OB_VDDA_ANALOG.  */
FLASH_Status FLASH_OB_WriteUser(uint8_t OB_USER)
/* Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY/ BOOT1 and OB_VDDA_ANALOG.  */
FLASH_Status FLASH_OB_WriteUser(uint8_t OB_USER)
{
  FLASH_Status status = FLASH_COMPLETE;
  FLASH->OPTKEYR = FLASH_KEY1;
  FLASH->OPTKEYR = FLASH_KEY2;
  status = FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
  if(status == FLASH_COMPLETE)
  {
    FLASH->CR |= FLASH_CR_OPTPG; 
	  OB->USER = OB_USER | 0x88;
    status = FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
    if(status != FLASH_TIMEOUT)
    {
      FLASH->CR &= ~FLASH_CR_OPTPG;
    }
  }
  return status;
}