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 support@ccsinfo.com

whats wrong with my code (serial data)

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



Joined: 04 Aug 2005
Posts: 21

View user's profile Send private message

whats wrong with my code (serial data)
PostPosted: Mon Aug 13, 2007 2:47 am     Reply with quote

int index, data;
char NewConfig[10];

while(data!=0x3D||index<10) //= or 0x3D indicates end of config packet
{
data=fgetc(com_a);
NewConfig[index]=data;
index++;
}

It seems like PIC will ignore the index<10 rule and keep waiting for
the '='.... or simply hanged...

Anyone has any idea to solve my problem? Helps are very much appreciated!
Thanx~
jmac_link



Joined: 28 Jun 2007
Posts: 9

View user's profile Send private message Visit poster's website

PostPosted: Mon Aug 13, 2007 3:21 am     Reply with quote

Try

while(data!=0x3D && ndex<10) //= or 0x3D indicates end of config packet
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