Text table values not located near each other in memory

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Text table values not located near each other in memory

774件の閲覧回数
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

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

690件の閲覧回数
ignisuti
Contributor IV

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

0 件の賞賛
返信

690件の閲覧回数
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 件の賞賛
返信