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

printf(), lcd_putc() and ROM space

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







printf(), lcd_putc() and ROM space
PostPosted: Mon Jun 23, 2003 1:18 am     Reply with quote

Hi,

The following:

printf(lcd_putc ,"\fMessage\n");

can be replaced by the following:

lcd_putc("\fMessage\n");

to save ROM space.

Can the following statements be represented by lcd_putc() or another format to save ROM space?

printf(lcd_putc,"\%4.3fV(ADC=\%4lu)", volt, ADC_value);

printf(lcd_putc,"\fFAILED at pos=\%u\n", pos);

Thanks in advance.
RF
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515462
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: printf(), lcd_putc() and ROM space
PostPosted: Mon Jun 23, 2003 5:39 pm     Reply with quote

:=Can the following statements be represented by lcd_putc() or another format to save ROM space?
:=
:= printf(lcd_putc,"\%4.3fV(ADC=\%4lu)", volt, ADC_value);
:=
:= printf(lcd_putc,"\fFAILED at pos=\%u\n", pos);
--------------------------------------------------------

In the code above, the printf is doing a conversion from
the float and "unsigned long" data types to ASCII.

The lcd_putc() function can not do this conversion.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515495
Tommy Liu
Guest







Re: printf(), lcd_putc() and ROM space
PostPosted: Tue Jun 24, 2003 1:20 am     Reply with quote

:=:=Can the following statements be represented by lcd_putc() or another format to save ROM space?
:=:=
:=:= printf(lcd_putc,"\%4.3fV(ADC=\%4lu)", volt, ADC_value);
:=:=
:=:= printf(lcd_putc,"\fFAILED at pos=\%u\n", pos);
:=--------------------------------------------------------
:=
:=In the code above, the printf is doing a conversion from
:=the float and "unsigned long" data types to ASCII.
:=
:=The lcd_putc() function can not do this conversion.

Thanks for your explanation. It is what I thought as well.
Tommy
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515506
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