prm data available in C code?

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

prm data available in C code?

675件の閲覧回数
rahulkrishna
Contributor IV

Hi everyone,

i have written a simple program in which i define a local variable in the main function and take the address of that variable similarly i take another variable in each function and calculate the address and do the difference of them.

 

Ex:

unsigned char *ptrone=NULL;

unsigned char *ptrtwo=NULL;

unsigned int stacksize=0;

int main(void)

{

volatile unsigned char test1;

ptrone = &test1;

subfunction1();

}

 

void subfunction1(void)

{

unsigned char test1=0;

ptrtwo = &test2;

stacksize = (ptrone - ptrtwo);

}

 

in somepart of the code i constantly check the stacksize and if it crosses the set value in the prm then it will reset the system.

First question: does the code work as expected? (according to me it works fine)

second: can i read the STACKSIZE parameter of the prm file into my C code?

 

Thanks and regards

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 返信

555件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi rahul,

I think you can also find the answer in this thread

https://community.freescale.com/thread/340654

correct?


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信