LPC1769 Second element of array, in Struct, overwritten

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

LPC1769 Second element of array, in Struct, overwritten

794 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by joeltong on Sun Mar 16 08:15:59 MST 2014
Hello,

I am trying to create a state manager, which contains an array of states.

I have tried running my code in standard Linux GCC, and it works.

On the LPC1769, when I have added a new state (at the second element of the array) using a helper function, it works fine.  Upon exit of helper function however, the first element is valid, while the second element gives some other unknown memory location.

This is the array within the struct:

volatile State_t * states[MAX_STATES];


Any idea?
标签 (1)
0 项奖励
回复
1 回复

776 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sun Mar 16 12:00:54 MST 2014
Show use some of your code.
0 项奖励
回复