This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Printf and diag_printf
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Michele Portolan <michele dot Portolan at imag dot fr>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Mon, 22 Nov 2004 16:24:53 +0100
- Subject: Re: [ECOS] Printf and diag_printf
- References: <072501c4d0a6$9e7a9a00$4881ab93@TIMAQLF129>
On Mon, Nov 22, 2004 at 04:19:11PM +0100, Michele Portolan wrote:
> What is the difference between "print" and "diag_printf"?
> I noticed the latter seems to be quite less constrained (ex: I can use it
> from an ISR handler), what doesit have more (or less) than normal printf? At
> first sight it would seem much more useful, but I bet there is a catch I am
> not seeing!
diag_printf() is none realtime. It disables interrupts while doing its
printing. So if you have a low priority function doing a diag_printf
it will stop a high priority function taking over when it becomes
runnable. This can be really bad when you are using a slow serial
port. It can give you some huge latencies.
diag_printf also has a few less modifiers and types implemented.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss