|
|
View previous topic :: View next topic |
Author |
Message |
mahalingam
Joined: 17 Jul 2010 Posts: 4 Location: Malaysia
|
Help me with compiler errors |
Posted: Sat Jul 17, 2010 11:38 pm |
|
|
Can anybody please help me to solve errors or correct my coding?
Code: |
#include <18F14K50.h>
#fuses INTRC,NOWDT,NOPROTECT,NOLVP // use Internal osc
#use delay(clock=16000000)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
int Buffer,Buff=0,b;
#int_rda //enable usart receive interrupt
rs232_handler() //interrupt driven data read and store
{
b=getch(); //load character
Buffer[Buff+1]=b; //store character [Error line 32]
Buff++; //increment pointer
}
main()
{
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
do { while(True); }
}
[Error line 41]
|
Errors:
Quote: |
*** Error 66 Line 32(13,14): Previous identifier must be a pointer
*** Error 75 Line 41(1,2): Expect WHILE rs232_handler
|
Please help me as soon as possible friends.
Thank you. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 18, 2010 12:54 am |
|
|
Quote: |
*** Error 66 Line 32(13,14): Previous identifier must be a pointer
|
Look at the Ex_Sisr.c example to see how to declare an array
for use as a buffer in the #int_rda routine. Here is the file location:
Quote: |
c:\program files\picc\examples\ex_sisr.c
|
Quote: | *** Error 75 Line 41(1,2): Expect WHILE rs232_handler
|
Read a tutorial on how to correctly make a do-while statement:
http://blog.robbychen.com/2010/07/13/c-do-while-loop/
You need to learn C. This forum is not a C learning forum.
In other words, we don't want to teach you C. You need to
learn it outside of the forum. We'll help you with using CCS C
to write your programs, but it's your responsibilty to learn basic C. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|