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

lcd does not show the first char of the converted string

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



Joined: 14 Jul 2007
Posts: 38

View user's profile Send private message

lcd does not show the first char of the converted string
PostPosted: Sun Jan 03, 2010 10:13 am     Reply with quote

Here is my codes. I get the string from serial channel and show it on 1st line of the LCD. It is ok. But when I try to convert it by using atol() then the first char is not shown. Could you help me?
Code:

char gv[10]=""; 
char gv2[10]="";
 
#int_RDA
RDA_isr()
{
disable_interrupts(int_rda);
gets(gv);

z=atol(gv);
lcd_gotoxy(1,2);
printf(lcd_putc,"gveri:%s",gv);
lcd_gotoxy(1,1);
printf(lcd_putc,"%lu",z);
}



//////////////the summary is below
023
gveri:123


any comment?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jan 03, 2010 12:47 pm     Reply with quote

See the comments in this thread about not using gets() inside an #int_rda
routine:
http://www.ccsinfo.com/forum/viewtopic.php?t=39708

See this thread for more comments about what code should be put in
an #int_rda routine (and what code you should not put in it):
http://www.ccsinfo.com/forum/viewtopic.php?t=41072
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