Anil Kumar Choudhury

Code Warrior HC08 Compiler Error: C2801: 'while' missing

Discussion created by Anil Kumar Choudhury on Jun 6, 2012
Latest reply on Jun 7, 2012 by CompilerGuru

Hi,

I am using code warrior for first time.

 

I am facing this error during my code compilation:

 

This points to my this function first line.

I am not able to understand what is this about?

 

 

Code

=========================================

void FlashEraseRestart(uint16 startAddr, uint16 size)
{
   FlashOpStatus status = FLASH_OP_OK;
   uint32 addr = startAddr;
   if(addr >= FLASH_START_ADDRESS)
   {
      //Disable Interrupts. Access to flash during flash operations is not allowed
       asm
       {
           SEI;
       }
      for(addr = startAddr; addr < (startAddr + size - 1UL); addr += FLASH_SECTOR_SIZE)
      {
          //Erase 1 sector at a time
          status = u8Flash_Erase((uint16)addr);
          if (FLASH_OP_OK != status)
          {
             break;
          }
      }
      //Enable interrupts
      asm
      {
          CLI;
      }
   }
   else
   {
      status = FLASH_OP_ERROR;
   }
   return status;
}

Outcomes