Volatile issue

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

Volatile issue

1,812件の閲覧回数
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 返答(返信)

867件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
Are you placing
>PTADD = 0;
inside of a function, inside of main?

Daniel
0 件の賞賛
返信

867件の閲覧回数
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 件の賞賛
返信