When using the command WrPortI (SPCR,&SPCRShadow,0x088);it shows the following error:

line 7 : ERROR CODE -PARALLEL1.C : Return type (re)declared differently after use.
line 7 : ERROR CODE -PARALLEL1.C : Need function definition or declaration.
line 7 : ERROR CODE -PARALLEL1.C : Syntax error - or garbage at end of program.

Is there a need to define SPCR also in the code.If so,how can it be done?

It seems to me that, Those errors are not related to the above function WrPortI(), you do not need to define the SPCR in your application. If you provide the code here I will check what is the issue.

Not seeing any further from the OP, I’m getting similar these Error messages too without resolve. I was hoping more information would be forthcoming in this thread.

I’m writing an embedded application that receives TCP packets and then must do some gpio on Port A. I have both the TCP portion and the gpio portion working in separate files. The errors show up when I try to combine the two in a single executable.

In an effort to pare the problem down to it’s essence, I’ve constructed the following test case:

#define TCPCONFIG 1
#define LOCAL_PORT 5551
#use “dcrtcp.lib”

tcp_Socket server_socket;

WrPortI(SPCR, &SPCRShadow, 0x84); // Initialize port A
WrPortI(PADR, &PADRShadow, 0x04); // set the bits

main(){
int i // Give main something to do even though unrelated
i=78 // to the issue
printf ("i = %d
", i)

} // End main

I get the following compiler messages:

line 12 : ERROR UNTITLED1.C : Return type (re)declared differently after use.
line 12 : ERROR UNTITLED1.C : Need function definition or declaration.
line 12 : ERROR UNTITLED1.C : Syntax error - or garbage at end of program.
line 12 : ERROR UNTITLED1.C : Need function definition or declaration.
line 12 : ERROR UNTITLED1.C : Syntax error - or garbage at end of program.
line 12 : ERROR UNTITLED1.C : Need function definition or declaration.
line 12 : ERROR UNTITLED1.C : Syntax error - or garbage at end of program.
line 12 : ERROR UNTITLED1.C : Need function definition or declaration.
line 12 : ERROR UNTITLED1.C : Syntax error - or garbage at end of program.
line 12 : ERROR UNTITLED1.C : Need function definition or declaration.
10 errors reached; further errors suppressed.

I banged up against this 2 days ago and have been stuck since.

Any suggestions?
Bob

Bob,

The code snippet you used is incorrect as you are trying to call the WrPortI function outside of a function definition and the compiler thinks you are implementing a function named WrPortI. Also there are a few missing ;.

The following compiles ok:

#define TCPCONFIG 1
#define LOCAL_PORT 5551
#use “dcrtcp.lib”
tcp_Socket server_socket;

main(){
int i; // Give main something to do even though unrelated
i=78; // to the issue

WrPortI(SPCR, &SPCRShadow, 0x84); // Initialize port A
WrPortI(PADR, &PADRShadow, 0x04); // set the bits

printf ("i = %d
", i);

} // End main

Regards,
Peter