Bart Veer schrieb:
"Simon" == Simon Kallweit <[email protected]> writes:

    Simon> This patch adds the possibility to override the
    Simon> diag_write_char function at run-time, allowing diagnostic
    Simon> output to be redirected to a custom handler. I need this
    Simon> functionality as I want the diagnostic output to be written
    Simon> into a ring buffer in flash. I think this function may be
    Simon> useful to others too?!?

What is the point of this, given that you can already insert your own
putc function using diag_init_putc()?

This won't change the output function for some of the diagnostic output calls, but on a second glance it would probably cover most of the diagnostic output and might be just fine for my purpose.

The only gain appears to be that
your custom write_char function would not need to worry about
carriage return/linefeed handling, whereas a custom putc may need to
do so - depending on the output destination. That is not worth
imposing a bit more code and data bloat on everybody.

Would it make sense to allow overriding the write_char INSTEAD of the putc call?

Simon

Reply via email to