command: Check for reentrant calls to sendf()

Allow sendf() to be called from irq and timer context - check for the
case where sendf() is called while already in sendf() and simply
discard those messages.  This makes it safe to use output() debugging
calls even in irq and timer context.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-01-13 12:10:00 -05:00
parent f335045273
commit 9a44a20a9d
2 changed files with 15 additions and 4 deletions

View file

@ -105,9 +105,7 @@ output("The value of %u is %s with size %u.", x, buf, buf_len);
```
The output() function is similar in usage to printf() - it is intended
to generate and format arbitrary messages for human consumption. It is
a wrapper around sendf() and as with sendf() it should not be called
from interrupts or timers.
to generate and format arbitrary messages for human consumption.
Declaring constants
-------------------