/* Program a single byte in the flash device.  */
int NORFLASH_ProgramByte(uint32_t addr, uint8_t data)
/* Program a single byte in the flash device.  */
int NORFLASH_ProgramByte(uint32_t addr, uint8_t data)
{
  uint16_t tmp;
  tmp = *(volatile uint16_t*)(addr & 0xFFFFFFFE);
  if (addr & 1)
  {
    tmp = (tmp & 0xFF) | (data << 8);
  }
  else
  {
    tmp = (tmp & 0xFF00) | data;
  }
  return NORFLASH_ProgramWord16(addr & 0xFFFFFFFE, tmp);
}