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

RS232 sending /0D q.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Dec 13, 2004 3:12 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=19083&highlight=ring+buffer

http://www.ccsinfo.com/forum/viewtopic.php?t=6446&highlight=ring+buffer

http://www.ccsinfo.com/wwwboard/messages/1486.html
Userr
Guest







PostPosted: Tue Dec 14, 2004 2:31 pm     Reply with quote

Check please this text

Code:


int_rda
void serial_isr() 
{                                   
  buffer[push++] = rcreg;         // Store it
  bit_clear(push, 5);   
}

main()
{
pop=0;
push=0;
x=0;
num=100000000;
while(1)
{


 if (pop != push)               
  {                             
  if(num<1){ num=100000000; x=0;}
  x = x + atoi32(&buffer[pop++])*num;
  num=num/10;
  bit_clear(pop, 5);   
  }


 
}
}


In terminal I send char and get it to display from left to right cycling
but after sending 2 cyclyng - some bugs!

Sample from terminal

333333333 - ok (that what I want)

cycling

333333333 - ok (that what I want)

cycling

33333333

(then it come to fist char -> '300000000' ) and
300039552 ?
300043506 ?
300043899 ?
300043938 ?
300043941 ?
300000000
330000000 - ok another cyclyng.

Why this char's ?
Userr
Guest







PostPosted: Wed Dec 15, 2004 4:49 pm     Reply with quote

I help to myself by inserting this line:


Code:


if(num<1){ num=100000000; x=0;
  for(in=0;in<32;in++) buffer[in]=0;   // clear  buffer - line inserted
}



Maybe anyboby tell me, how change this line without cycling (clear this
buffer)

Thanks/
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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