]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/printf/printf.h
Updated to use generic printf functionality if none provided easily by their native...
[tinyos-2.x.git] / tos / lib / printf / printf.h
index af95c28de30a34ce35a6b16b81d6373624da40cd..0f2f051746d70b088a4ebb843e911dd13d871f23 100644 (file)
@@ -7,15 +7,15 @@
  * hereby granted, provided that the above copyright notice, the following
  * two paragraphs and the author appear in all copies of this software.
  *
- * IN NO EVENT SHALL WASHINGTON UNIVERSITY IN ST. LOUIS BE LIABLE TO ANY PARTY 
- * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING 
- * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF WASHINGTON 
+ * IN NO EVENT SHALL WASHINGTON UNIVERSITY IN ST. LOUIS BE LIABLE TO ANY PARTY
+ * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
+ * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF WASHINGTON
  * UNIVERSITY IN ST. LOUIS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * WASHINGTON UNIVERSITY IN ST. LOUIS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND WASHINGTON UNIVERSITY IN ST. LOUIS HAS NO 
+ * ON AN "AS IS" BASIS, AND WASHINGTON UNIVERSITY IN ST. LOUIS HAS NO
  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
  * MODIFICATIONS."
  */
 #ifndef PRINTF_H
 #define PRINTF_H
 
-#include <stdio.h>
-#include "message.h"
+#ifndef PRINTF_BUFFER_SIZE
+#define PRINTF_BUFFER_SIZE 250 
+#endif
+
+#if PRINTF_BUFFER_SIZE > 255
+  #define PrintfQueueC BigQueueC
+  #define PrintfQueue  BigQueue
+#else
+  #define PrintfQueueC QueueC
+  #define PrintfQueue  Queue
+#endif
 
-#define PRINTF_BUFFER_SIZE 250
+#ifdef _H_msp430hardware_h
+  #include <stdio.h>
+#else
+#ifdef _H_atmega128hardware_H
+  #include "avr_stdio.h"
+#else
+#ifdef __M16C62PHARDWARE_H__ 
+  #include "m16c62p_printf.h"
+#else
+  #include "generic_printf.h"
+#endif
+#endif
+#endif
+#include "message.h"
+int printfflush();
 
-typedef nx_struct PrintfMsg {
-  nx_uint8_t buffer[TOSH_DATA_LENGTH];
-} PrintfMsg;
+#ifndef PRINTF_MSG_LENGTH
+#define PRINTF_MSG_LENGTH      28
+#endif
+typedef nx_struct printf_msg {
+  nx_uint8_t buffer[PRINTF_MSG_LENGTH];
+} printf_msg_t;
 
 enum {
-  AM_PRINTFMSG = 100,
+  AM_PRINTF_MSG = 100,
 };
 
 #endif //PRINTF_H