disable copydown of rom constants

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

disable copydown of rom constants

跳至解决方案
1,826 次查看
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 解答
417 次查看
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 回复数
418 次查看
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 项奖励
417 次查看
mikeu
Contributor I
That did it !!
 
Thanks very much for the help.
0 项奖励