disable copydown of rom constants

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

disable copydown of rom constants

ソリューションへジャンプ
2,425件の閲覧回数
mikeu
Contributor I
How can I force the compiler not to generate copy down code for rom constants.
 
For example if I have some constants like:
 
#pragma INTO_ROM
const signed char *test[4] =
{
{"one"},
{"two"},
{"three"},
{"four}
};
 
I do not want test included in the copydown section (and in ram)
Right now it is included in the copy down section in the map file when coded as above.
Any help is appreciated!!
 
 
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,016件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
The problem in your snippet is a missing const after the *.

Code:
const signed char * const test[4] ={

The first const says that the individual characters of each string are constant,
the const after the * states that the array members are constant too.

The #pragma INTO_ROM is as far as I remember only for the HIWARE object file format which you very probably do not use.

Daniel

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,017件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
The problem in your snippet is a missing const after the *.

Code:
const signed char * const test[4] ={

The first const says that the individual characters of each string are constant,
the const after the * states that the array members are constant too.

The #pragma INTO_ROM is as far as I remember only for the HIWARE object file format which you very probably do not use.

Daniel
0 件の賞賛
返信
1,016件の閲覧回数
mikeu
Contributor I
That did it !!
 
Thanks very much for the help.
0 件の賞賛
返信