Using CodeVision with a Mega1281 and external RAM.
I need to keep several variable in memory and in the same order that I declare them. I thought the best solution would be to define exact memory locations for these variables as follows:
uint8_t StatusMsg @ 0x1200; uint8_t CtrlAddr @ 0x1201; uint8_t Power @ 0x1202; uint8_t CurrentSlot @ 0x1203; uint8_t Test @ 0x1204; uint8_t Subtest @ 0x1205; uint16_t PassCount @ 0x1206; uint16_t FailCount @ 0x1216;
But I have found that strings declared in my code are using the same memory area, so the following line will have part of the string erased when I clear the above variables.
ErrorHandlerString("Timeout waiting for response");
What can I do to prevent strings and variables from using the same memory space?
Is there a better way to define variables and keep them in a specific order?