Hi!

I liked the new idea with printf! The split phase method is no more here and it 
is good. But the small change of the standard example still doesn't work.

File: $TOSROOT/apps/tests/TestPrintf/
--------------
  event void Boot.booted() {
        printf("Hi I am writing to you from my TinyOS application!!\n");
        printf("Here is a uint8: %u\n", dummyVar1);
        printf("Here is a uint16: %u\n", dummyVar2);
        printf("Here is a uint32: %ld\n", dummyVar3);
        printfflush();
        // BEGIN
        while (1) {
               printf("123\n");
               printfflush();
        }
        // END
   }
----------
It prints nothing at all. In the old version of printf I've used variable 
locked to be sure PrintfFlush.done() was already called.

---------------
        while  (1) {
           if (locked)
                continue;
---------------
locked was released in .done()

This didn't help.

I guess I'm doing something wrong, but what?

I plan to use printf() for debugging or there is a better way?

Best regards,
Andrey


----- Оригінал листа -----
Від: "David" [EMAIL PROTECTED]
Кому: "TINYOS" [EMAIL PROTECTED]
Відправлено: вівторок, 17 червня, 2008 р. 14:12
Тема: [Tinyos-help] printf problems

> Hi list.
> 
> It looks like the printf() tutorial here is out of date:
> 
> http://docs.tinyos.net/index.php/The_TinyOS_printf_Library
> 
> In a recent commit, the old printf files were moved to a
> 2_0_2-subdirectory, and there are a few differences in the new
> version.
> 
> One difference that I'm having trouble with (and was hoping the tut
> would clarify) is the lack of a PrintfFlush interface.
> 
> According to the new PrintfP.nc file's comments, if you want to flush
> sooner than the default, you need to call printfflush() directly.
> 
> My app needs to call printfflush() because I want printf output to be
> displayed quickly, instead of waiting until the printf buffer (250
> chars) is half-full.
> 
> How can I call printfflush() in my app if the function isn't in an
> interface or header file?
> 
> For now I will use the 2_0_2 version.
> 
> David.
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to