/* Programs a half word at a specified address.  */
FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data)
/* Programs a half word at a specified address.  */
FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data)
{
  FLASH_Status status = FLASH_COMPLETE;
  assert_param(IS_FLASH_PROGRAM_ADDRESS(Address));
  status = FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
  if(status == FLASH_COMPLETE)
  {
    FLASH->CR |= FLASH_CR_PG;
    *(__IO uint16_t*)Address = Data;
    status = FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT);
    FLASH->CR &= ~FLASH_CR_PG;
  }
  return status;
}