comparison loadagent/libprintf/README @ 3:45bf8af5f061

libprintf brought in from older PPC/m68k code, but fucking GCC refuses to compile <varargs.h> - need to convert to Anshit C <stdarg.h>
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 29 Apr 2013 07:00:22 +0000
parents
children
comparison
equal deleted inserted replaced
2:ddda170fa6f4 3:45bf8af5f061
1 The present libprintf is a very light printf implementation that is well-suited
2 for simple bare-metal programs like loadagent; in the present case it overrides
3 the much heavier printf implementation in newlib. Programs like the present
4 loadagent only need printf in order to scribble on the serial console port,
5 and the most sensible implementation is to have the "character output" function
6 from the guts of printf point directly to the physical UART output routine, or
7 a trivial wrapper that turns \n into \r\n. In contrast, newlib's version would
8 pull in the complete FILE table infrastructure and malloc etc - maybe OK for
9 more complex embedded programs that use those facilities for other things under
10 a bona fide RTOS, but it would be disgusting to pull that stuff in for a
11 minimal program like ours.
12
13 The present printf implementation has been used earlier by the same author
14 (Michael Spacefalcon) in the StarMON family of PowerPC bootloaders, and in my
15 MC68x302-based SDSL CPE devices (Hack-o-Rocket and OSDCU).