/* Check if an address is valid for the flash device.  */
bool NORFLASH_AddressValid(uint32_t addr)
/* Check if an address is valid for the flash device.  */
bool NORFLASH_AddressValid(uint32_t addr)
{
  if (!flashInitialized)
  {
    if (flashInterrogate() != NORFLASH_STATUS_OK)
      return false;
  }
  if ((addr >= flashInfo.baseAddress) &&
      (addr < (flashInfo.baseAddress + flashInfo.deviceSize)))
    return true;
  return false;
}