[Tinyos Core WG] Re: Printf

Kevin Klues klueska at gmail.com
Wed Oct 25 17:15:35 PDT 2006


Oh, and its specific to msp430 and atm128 processors at the moment.

Kevin

On 10/25/06, Kevin Klues <klueska at gmail.com> wrote:
> I've changed the syntax of printf to be the same as for traditional c
> programming i.e.
>
> printf("Here is my variable %d", var)
>
> The only catcher as David mentioned before is that it is not being
> called from within a component since commands from interfaces do not
> support variable number of arguments.  Take a look in TestPrintf under
> apps/tests to see how it is used.
>
> Other issues are that (as of now), you still have to flush the printf
> after writing 250 bytes (or less) and wait for a flushDone before
> being allowed to use printf again.  Eventually it would be nice to
> implement some strategy that competes with the normal serial stack for
> use of the USART for writing data out so that printf statements could
> be continusously called and flushing would happen automatically.  This
> would involve alot more effort than I have time for right now though.
> If anyone feels like looking into it to extend it  you are more than
> welcome. It would basically involve having to send serial packets
> asynchronously so that multiple printf statements could continue to be
> called concurrent with their sending.  I have a few ideas on how to do
> this, just no time for it.
>
> Kevin
>
> On 10/24/06, Philip Levis <pal at cs.stanford.edu> wrote:
> > On Oct 24, 2006, at 1:39 PM, Kevin Klues wrote:
> >
> > > You will also have to add the appropriate
> > >
> > > %T/lib/printf
> > >
> > > line to your .platform file.  Currently it is only checked in for
> > > telosb
> >
> > Should this be added to all .platforms as an inherent part of TinyOS?
> > Or is it an application-level thing?
> >
> > Phil
> >
>
>
> --
> ~Kevin
>


-- 
~Kevin


More information about the Tinyos-2.0wg mailing list