Volatile issue

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

Volatile issue

1,813 次查看
jberri
Contributor II
I am trying to use the following documentation AN2616 and follow an example.  In the example they initialize the data direction register as such:
 
PTADD = 0;    //initialize as input (Data Direction Register) */
 
when I compile this I get an error saying the following
 
Error   : C1019: Incompatible type to previous declaration (found 'int ', expected 'PTAPESTR volatile ')
main.c line 9  
 
what is the proper way of doing this or am I missing something.
标签 (1)
0 项奖励
回复
2 回复数

868 次查看
CompilerGuru
NXP Employee
NXP Employee
Are you placing
>PTADD = 0;
inside of a function, inside of main?

Daniel
0 项奖励
回复

868 次查看
jberri
Contributor II
Daniel, you hit it on the dot.....  I had the code placed outside the main loop.  What I don't understand is, I thought it should have been outside the main.  Maybe I am thinking C++
Anyway, thank you so much.
0 项奖励
回复