public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bart Veer <bartv@ecoscentric.com>
To: Simon Kallweit <simon.kallweit@intefo.ch>
Cc: ecos-patches@ecos.sourceware.org
Subject: Re: diagnostic output to custom handler
Date: Wed, 24 Dec 2008 18:44:00 -0000	[thread overview]
Message-ID: <pnprjh1kj8.fsf@delenn.bartv.net> (raw)
In-Reply-To: <49527472.3010200@intefo.ch> (message from Simon Kallweit on Wed, 	24 Dec 2008 18:42:10 +0100)

>>>>> "Simon" == Simon Kallweit <simon.kallweit@intefo.ch> writes:

    Simon> Bart Veer schrieb:
    >>>>>>> "Simon" == Simon Kallweit <simon.kallweit@intefo.ch> 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()?

    Simon> This won't change the output function for some of the
    Simon> diagnostic output calls, but on a second glance it would
    Simon> probably cover most of the diagnostic output and might be
    Simon> 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.

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

I think it would be better to stick with _putc, and fix any diagnostic
calls that currently don't use _putc to make them consistent with the
rest of the diag code.

An alternative approach is to tackle things at a lower level: fix the
HAL so that HAL_DIAG_WRITE_CHAR() does the right thing for your
platform, e.g. write data into flash. That may or may not be easy,
depending on the target hardware and the HAL packages involved.

Bart

-- 
Bart Veer                                   eCos Configuration Architect
eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.

      reply	other threads:[~2008-12-24 18:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-24 14:24 Simon Kallweit
2008-12-24 16:17 ` Bart Veer
2008-12-24 17:42   ` Simon Kallweit
2008-12-24 18:44     ` Bart Veer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pnprjh1kj8.fsf@delenn.bartv.net \
    --to=bartv@ecoscentric.com \
    --cc=ecos-patches@ecos.sourceware.org \
    --cc=simon.kallweit@intefo.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).