X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Flib%2Fuprintf%2FUprint.h;fp=tos%2Flib%2Fuprintf%2FUprint.h;h=bcb4066d0633b92059c61be27f31e00b42f4ff61;hp=0e05ebbce94b7a1675ae27b4bd319e4241595ffa;hb=13e400e82fdf39ec7807c7b290136408044d6273;hpb=3aed39b6730a55e41c9ae5a8a1e690bca5746147 diff --git a/tos/lib/uprintf/Uprint.h b/tos/lib/uprintf/Uprint.h index 0e05ebbc..bcb4066d 100644 --- a/tos/lib/uprintf/Uprint.h +++ b/tos/lib/uprintf/Uprint.h @@ -16,6 +16,18 @@ #ifndef UPRINT_H #define UPRINT_H +/* Console printf macro implicitly uses the Uprint interface used by the module + * within which this macro is called. + */ +#define cprintf(fmt, args...) uprintf(call Uprint.uptr(), fmt, ## args) + +/* Console fprintf macro prints to the channel wired to the Uprint interface + * provided as the uprint_interface argument. Allows for printing to multiple + * channels from within the same module. + */ +#define cfprintf(uprint_interface, fmt, args...) \ + uprintf(call uprint_interface.uptr(), fmt, ## args) + typedef int (*uprint_ptr_t)(); #endif /* end of include guard: UPRINT_H */