X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Flib%2Fuprintf%2FREADME.txt;fp=tos%2Flib%2Fuprintf%2FREADME.txt;h=dedf345b5891d92d0b33f31a6c23470834aa3d1d;hp=0000000000000000000000000000000000000000;hb=eb7d4fbd7e465dd1a4a8450111ec93af2dce936b;hpb=46696d41fef125e00b09b24a378f106d1347526f diff --git a/tos/lib/uprintf/README.txt b/tos/lib/uprintf/README.txt new file mode 100644 index 00000000..dedf345b --- /dev/null +++ b/tos/lib/uprintf/README.txt @@ -0,0 +1,29 @@ +The UprintC component uses the uprintf() function. The MSP430 libc provides +uprintf(), which can be trivially created for any other platform. The benefits +of uprintf are: + +* No internal buffer; data are written as the format string is parsed. +* By using a pointer to a putc() function, the function is usable for + multiple UARTs, when appropriate. + +An example of using UprintC is shown below. + +configuration AppC { + ... + components PlatformUartC as UartC; + AppP.UartResource -> UartC; + AppP.UartByte -> UartC; + + components new UprintC(); + AppP.Uprint -> UprintC; + UprintC.UartByte -> UartC; + ... +} + +module AppP { + ... + #define cprintf(fmt, args...) uprintf(call Uprint.uptr(), fmt, ## args) + ... + cprintf("Hello, world!\r\n"); + ... +}