Its not 'advisable' - its mandatory. printf will attempt to block on IO
- something you can't do in an interrupt routine. Conversely, logMsg
simply sends the text to a queue (with NOWAIT) where it is picked up by
a different thread and printed.
--
Wade Oram
Reply address valid for 1 calendar month from date of posting.
1.non reentrant.
2.usually one will disable all the hardware interrupts inside isr,and
printf() cannot proceed unless interrupts are enabled for the serial
device.
3.Also printf() code is supposed to be quite large.
logMsg()is equivalent to printk() in unix.
Best Regards,
Biju Koruthu.
pushpa wrote:
> Why is it advisable to use logMsg instead of printf's in a interrupt
> service routine?
Mainly, because the use of printf() (or any function that can block
is absolutely forbidden in ISR context. There is a very restricted list
of
functions that can be called fro ISR context, and this list should be
adhered
to strictly. See the manuals for the list.
Speaking only for myself,
Joe Durusau
>In message <78a4243a.04051...@posting.google.com>, pushpa
><deena.m...@wipro.com> writes
>>Why is it advisable to use logMsg instead of printf's in a interrupt
>>service routine?
>
>
>Its not 'advisable' - its mandatory. printf will attempt to block on IO
>- something you can't do in an interrupt routine. Conversely, logMsg
>simply sends the text to a queue (with NOWAIT) where it is picked up by
>a different thread and printed.
printf() may also malloc, IIRC.
D.Falessi
davf...@tin.it (Falessi D.) wrote in message news:<5831889a.04051...@posting.google.com>...