Re: Calling sprintf from interrupt context



On Aug 20, 5:29 am, DeNNis <wuhua9...@xxxxxxxxx> wrote:
On Aug 20, 5:11 pm, pawar.shrik...@xxxxxxxxx wrote:





Hello,

It is safe to call printf, but some times it may messup execution of
tasks(As printf is having High priority),
So better not to use it from ISR, it may hit the performance.
For debugging purpose printf can be used.

Regards,
Shrikant

barkan.a...@xxxxxxxxx wrote:
Hello,
Is it safe to call sprintf from interrupt context?
I couldn't think of a reason why not, but on the other hand I'm not
sure what OS facilities it uses (perhaps it needs to allocate
memory?).
I'm using VxWorks 5.5.
Thanks.- Hide quoted text -

- Show quoted text -

if i want to get some log info in ISR ,while the printf can not be
used,what can i do?
how about the logMsg() ?

Regarding your question about logMsg()--yes, it is ISR safe.

Sparky.
.



Relevant Pages

  • Re: query about printf
    ... it is non-re-enterant. ... I didn't get as to why printf is ... If you call a non-reentrant function from an ISR, ... would be blocking further interrupts for far too long. ...
    (comp.lang.c)
  • Re: ISR servicing
    ... Servicing an ISR after my time out interval. ... Can any body help me out why a single printf() or a func call in an ... func() call i am unable to serivce an ISR ... Not sure if by watchdog you mean a board watchdog that reboots the board if it is not frequently pinged of if you mean the standard vxWorks watchdogs from wdLib. ...
    (comp.os.vxworks)
  • Re: query about printf
    ... version of printf uses a static buffer or a global buffer. ... In C there is no such thing as an "ISR" and there is only one ...
    (comp.lang.c)
  • Which functions can I call from an ISR(Interrupt Service Routine)
    ... functions that can be called from an interrupt service routine, ISR. ... Standard functions like printf and so on cannot be used because blocking can ...
    (microsoft.public.windowsce.platbuilder)