/* Programs the FLASH brownout reset threshold level Option Byte.  */
FLASH_Status FLASH_OB_BORConfig(uint8_t OB_BOR)
/* Programs the FLASH brownout reset threshold level Option Byte.  */
FLASH_Status FLASH_OB_BORConfig(uint8_t OB_BOR)
{
  FLASH_Status status = FLASH_COMPLETE;
  uint32_t tmp = 0, tmp1 = 0;
  assert_param(IS_OB_BOR_LEVEL(OB_BOR));
  tmp1 = (FLASH->OBR & 0x00F00000) >> 16;
  tmp = (uint32_t)~(OB_BOR | tmp1)<<16;
  tmp |= (OB_BOR | tmp1);
  status = FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
  if(status == FLASH_COMPLETE)
  {            
    OB->USER = tmp; 
  }
  status = FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
  return status;
}