This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiler Error C141

I am getting compiler error for below given function written to read the MAC (IEEE) address of TI CC2430

( error C141: syntax error near 'code' ... & ... error C141: syntax error near ')' )

 // // Keil workaround
#define __code   code;

//IEEE MAC address in flash memory
#define MAC_FLASH_ADDR (0x3FFFF-7)


uint8_t IEEE_MAC[8];

void ReadMAC(void)
{
  bspIState_t state;
  uint8_t fmaptmp;
  uint8_t i;
  uint8_t code *flash;
  BSP_ENTER_CRITICAL_SECTION(state);
  while (FCTL & BIT7); //wait for the flash controller to be ready
  fmaptmp = FMAP;
  FMAP = MAC_FLASH_ADDR >> 15;
  flash = (code uint8_t *)((MAC_FLASH_ADDR & 0xFFFF) | 0x8000);  Compiler Error 
  for(i=0; i<8; i++)
  {
    IEEE_MAC[i] = flash[7-i];
  }
  FMAP = fmaptmp;
  BSP_EXIT_CRITICAL_SECTION(state);
}

I am not sure where I am going wrong any help would be appreciated. Thanks in Advance

Parents
  • // // Keil workaround
    

    That hints at this being an attempt to move code from one compiler to the other without really understanding the particularities of either. And that's exactly where your code fails. The pointer cast is syntacically incorrect. Get back to the documentation and find out how to spell memory-space specific pointer types in Keil.

Reply
  • // // Keil workaround
    

    That hints at this being an attempt to move code from one compiler to the other without really understanding the particularities of either. And that's exactly where your code fails. The pointer cast is syntacically incorrect. Get back to the documentation and find out how to spell memory-space specific pointer types in Keil.

Children