[ECOS] stdio vs. diag_printf

Hugo 'NOx' Tyson hmt@cygnus.co.ukx
Tue Jul 11 03:45:00 GMT 2000


Grant Edwards <grante@visi.com> writes:
> > > I'll have to look up the gnu cpp extensions to see if there's a
> > > way to do
> > > 
> > >#define define printf(vararg_list) daig_printf(vararg_list)
> >
> > You chould be able to get away with:
> > 
> > #include <cyg/infra/diag.h>
> > #define printf diag_printf
> 
> Doh!  Of course.  Got caught up looking for a complex solution
> to a simple problem.

But beware: diag_printf is synchronous and disables interrupts for quite a
long time.  Because the diagnostic channel's mission is to get that message
out there no matter how broken the rest of the world is, IYSWIM; we merely
piggybacked the useful diag_printf routine on top of it for convenience for
test writers.

Whether this matter depends on your network performance needs...

The raison d'etre of real serial devices is to avoid that kind of issue.

HTH,
	- Huge


More information about the Ecos-discuss mailing list