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

code const illegal initialization

I'm trying to put 2 config chars into ROM (user makes a change which the ROM remembers during power down). However on compiling I get:

'error C142: illegal initialization' and then
'warning C34: 'code' : missing declaration specifiers

The code I am using is as follows:

code const unsigned char Config1 = 0x00;
code const unsigned char Config2 = 0xA0;

Can anyone tell me what is going on.

Thanks

Parents
  • I'm using a C166. The idea is that I have two bytes stored in some sort of non volatile memory that I can change at runtime. As I make changes to the attached hardware, my software stores the values in NV memory, which can then be recalled upon next power up and used to set up the hardware.

Reply
  • I'm using a C166. The idea is that I have two bytes stored in some sort of non volatile memory that I can change at runtime. As I make changes to the attached hardware, my software stores the values in NV memory, which can then be recalled upon next power up and used to set up the hardware.

Children