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

Writing constant to ROM

Maybe this is a simple question, but I just couldn't figure it out. Can someone tell me how to place a constant variable into the specific ROM area? I would like to be able to set a constant value at a particualr ROM area and use a pointer to get it whenever I need it.

Cheers,
Tang

Parents
  • unfortunately, the _at_ keyword can't be used with initialisation.

    How about

    code const unsigned char fred = 0xaa;
    
    and then using the linker to fix the location?
    you'd probably need to define 'fred' such that it was in a segment of its own?

Reply
  • unfortunately, the _at_ keyword can't be used with initialisation.

    How about

    code const unsigned char fred = 0xaa;
    
    and then using the linker to fix the location?
    you'd probably need to define 'fred' such that it was in a segment of its own?

Children