/* Obtains the base address of the specified sector.  */
static blt_addr FlashGetSectorBaseAddr(blt_int8u sector)
/* Obtains the base address of the specified sector.  */
static blt_addr FlashGetSectorBaseAddr(blt_int8u sector)
{
  blt_int8u sectorIdx;
  blt_addr baseAddr;
  baseAddr = FLASH_INVALID_ADDRESS;
  for (sectorIdx = 0; sectorIdx < FLASH_TOTAL_SECTORS; sectorIdx++)
  {
    CopService();
    if (flashLayout[sectorIdx].sector_num == sector)
    {
      baseAddr = flashLayout[sectorIdx].sector_start;
      break;
    }
  }
  return baseAddr;
}