Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] Re: printf

2005-03-24 by Paul Curtis

Hi,

I think that should be: 

int __putchar(int ch)
{
  debug_putchar(ch);
  return ch;
}

This is all described in the CrossWorks manual--look under "Customizing
the runtime system".

Regards,

--
Paul Curtis, Rowley Associates Ltd  http://www.rowley.co.uk
CrossWorks for MSP430, ARM, AVR and (soon) MAXQ processors

> -----Original Message-----
> From: Michael Johnson 
> Sent: 24 March 2005 11:19
> To: lpc2000@yahoogroups.com
> Subject: Re: [lpc2000] Re: printf
> 
> 
> The crossstudio library implements printf in terms of a 
> function called __putchar - all you have to do is supply an 
> implementation of this function e.g.
> 
> void __putchar(int ch)
> {
>     debug_putchar(ch);
> }
> 
> We supply many variants of printf/scanf and friends which 
> enable the functionality (hence code size) to be trimmed down 
> as required. The selection of the print/scanf library is 
> determined by the Printf/Scanf properties.
> 
> Regards
> Michael
> 
> >I'm use CrossStudio to compile. And a just want to use printf. The 
> >compiler is always telling my that I hava to implement 
> __putChar. So I 
> >thought it is handy to build a Com class, so I can use 
> printf. But it 
> >is not working as a hoped.
> >
> >Thanks
> >
> >ps my there are beter way's
> >
> >--- In lpc2000@yahoogroups.com, "Anton Erasmus" <antone@s...> wrote:
> >  
> >
> >>On 24 Mar 2005 at 9:15, neptunus1000 wrote:
> >>
> >>    
> >>
> >>>Hello,
> >>>
> >>>I'wondering why my classes are not working. I want to build a Com 
> >>>class so a can use printf to put something on the uart.
> >>>
> >>>The functie's com.UARTWriteChar('x'); com.__putchar('\n'); in the
> >>>      
> >>>
> >main
> >  
> >
> >>>are working good. But the printf is not working. Can some one
> >>>      
> >>>
> >help my.
> >  
> >
> >>{Code snipped]
> >>
> >>
> >>Getting printf to output using your own routines, is more a
> >>    
> >>
> >question of porting the
> >  
> >
> >>standard C library than anything else. Which compiler do you use,
> >>    
> >>
> >and which standard
> >  
> >
> >>library ?  If it is newlib, then look at the new-lib_lpc stubs
> >>    
> >>
> >library to see an example of
> >  
> >
> >>how to port newlib.
> >>
> >>Regards
> >>   Anton Erasmus
> >>
> >>
> >>--
> >>A J Erasmus
> >>    
> >>
> >
> >
> >
> >
> >
> > 
> >Yahoo! Groups Links
> >
> >
> >
> > 
> >
> >
> >
> >  
> >
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.