您好,
对于以下代码:
#pragma code_section (example_CallFlashAPI,"ramfuncs");
void Example_CallFlashAPI (void)
{
funcA();
}
作废功能A (作废)
{
}
我知道函数"Example_CallFlashAPI"将驻留在ramfuns中,函数"funnA"是否也位于ramfuncs中?
谢谢。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,
对于以下代码:
#pragma code_section (example_CallFlashAPI,"ramfuncs");
void Example_CallFlashAPI (void)
{
funcA();
}
作废功能A (作废)
{
}
我知道函数"Example_CallFlashAPI"将驻留在ramfuns中,函数"funnA"是否也位于ramfuncs中?
谢谢。
您好,Howard:
以下是 TMS320C28x编译器用户手册中的内容。
http://www.ti.com/lit/ug/spru514n/spru514n.pdf
这应提供一些澄清。 在您的示例中,只有函数example_CallFlashAPI()位于指定的部分。
6.9 ............5代码段Pragma
code_section pragma为C中的符号或C++中声明的下一个符号在名为节名的节中分配空间。
C中pragma的语法为:
#pragma code_section (符号,“节名”)
C++中pragma的语法为:
#pragma code_section ("段名称")
如果要将代码对象链接到独立于.text部分的区域,则code_section pragma非常有用。
Tom