CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Function passing parameters problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Alex
Guest







Function passing parameters problem
PostPosted: Thu Sep 23, 2004 5:27 am     Reply with quote

Could anybody tell me please what the problem is with the following function call?
The error is:Function definition different from previous definition
indicates on the function TxFrame()
All the functions are declared.

void main(void)
{
init_serial();
TxFrame(Frame);
}
void TxFrame(BYTE msg[])
{
int i;
WriteByte(StartFlag);
for (i=0;i<length;i++)
{
WriteByte(msg[i]);
}
WriteByte(StopFlag);
}

void WriteByte(BYTE TxByte)
{
while ((TXSTA & 2) == 0
{
}
TXREG = TxByte;
}
Trampas



Joined: 04 Sep 2004
Posts: 89
Location: NC

View user's profile Send private message MSN Messenger

PostPosted: Thu Sep 23, 2004 5:47 am     Reply with quote

You need to prototype the function before main...

void TxFrame(BYTE msg[]); //prototype

void main(void)
{
init_serial();
TxFrame(Frame);
}
void TxFrame(BYTE msg[])
{
int i;
WriteByte(StartFlag);
for (i=0;i<length;i++)
{
WriteByte(msg[i]);
}
WriteByte(StopFlag);
}

void WriteByte(BYTE TxByte)
{
while ((TXSTA & 2) == 0
{
}
TXREG = TxByte;
}
alex
Guest







PostPosted: Thu Sep 23, 2004 6:03 am     Reply with quote

Thank you very much
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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