[En-Nut-Discussion] Nut/OS port for H8/300H.

Harald Kipp harald.kipp at egnite.de
Wed Mar 17 19:58:29 CET 2004


Hi Jan,

you are still with us. :-)

I prefer the 2nd one, because the first looks
disgusting. But there is no choice, we must
use the 1st version. It's the only one which
saves RAM, a scarce resource on AVR platforms,
and which works with compilers, that do not
support ...was intrinsic functions the correct
name for {(static int i; i)}?

Harald

At 17:21 17.03.2004 +0100, you wrote:
>On Wed, 17 Mar 2004 17:28:23 +0100, Harald Kipp <harald.kipp at egnite.de> wrote:
>[.....]
> > No, string constants are placed in RAM by default.
> > Actually in the data segment, which contains all
> > pre-initialized RAM.
>OK, I have caught it. So I am going to prepare a patch to fix all
>those debug stuff. Just tell me which of the following two versions do
>you prefer.
>
>1st version:
>
>void foo(void)
>{
>#ifdef NUTDEBUG
>#ifdef ARCH_32BIT
>     static prog_char fmt[] = "SWC<%08lx %08lx>";
>#else
>     static prog_char fmt[] = "SWC<%04x %04x>";
>#endif
>#endif
>
>     do_something();
>
>#ifdef NUTDEBUG
>     fprintf_P(__os_trs, fmt, level, (uptr_t) runningThread);
>#endif
>}
>
>2nd version:
>
>void foo(void)
>{
>     do_something();
>
>#ifdef NUTDEBUG
>#ifdef ARCH_32BIT
>     fprintf(__os_trs, "SWC<%08lx %08lx>", level, (uptr_t) runningThread);
>#else
>     fprintf(__os_trs, "SWC<%04x %04x>", level, (uptr_t) runningThread);
>#endif
>#endif
>}
>
>Regards,
>/J.D.
>--
>Jan Dubiec, jdx at slackware.pl, mobile: +48 602 101787
>
>G³êboka wiara wymaga p³ytkiego rozumu i nik³ej wiedzy.
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list