Text table values not located near each other in memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Text table values not located near each other in memory

304 Views
ignisuti
Contributor IV

I have the following list of text values defined in my code.

 

static char const * const daylight_savings_time_tbl[ TIME_DAYLIGHT_SAVINGS__CNT ] =    {    /* TIME_DAYLIGHT_SAVINGS__OFF  */ "Off",    /* TIME_DAYLIGHT_SAVINGS__ON  */ "On",    /* TIME_DAYLIGHT_SAVINGS__AUTO     */ "Auto"    };

Unfortunatly, these text values don't all show-up together in RAM (see image below). Is there another way I can declare this table?

It's rather critical to what I'm trying to accomplish. Because my function is handed many tables of strings like this one, I have it simply search for the NULL character and assume the start of the next string is the next character.

 

MCU Memory

Labels (1)
0 Kudos
2 Replies

220 Views
ignisuti
Contributor IV

Forgot to add this is with CodeWarrior 10.1 and I'm using a Coldfire MCF51CN128 MCU.

0 Kudos

220 Views
ignisuti
Contributor IV

Okay, so I found that unchecking the following compiler setting fixed my problem.

 

To fix this issue, uncheck this value:  Project > Properties > C/C++ Build > Settings > Language Settings > Reuse Strings

 

If anyone has any other suggestions, please let me know.

0 Kudos