Contiki 3.x
putchar.c
Go to the documentation of this file.
1 /**
2  * \file
3  * hardware-specific putchar() routine for TI SmartRF05EB
4  *
5  * \author
6  * George Oikonomou - <oikonomou@users.sourceforge.net>
7  */
8 
9 #include "contiki-conf.h"
10 #include "dev/io-arch.h"
11 /*---------------------------------------------------------------------------*/
12 void
13 putchar(char c)
14 {
15 #if SLIP_ARCH_CONF_ENABLE
16 #define SLIP_END 0300
17  static char debug_frame = 0;
18 
19  if(!debug_frame) { /* Start of debug output */
20  io_arch_writeb(SLIP_END);
21  io_arch_writeb('\r'); /* Type debug line == '\r' */
22  debug_frame = 1;
23  }
24 #endif
25 
26  io_arch_writeb((char)c);
27 
28 #if SLIP_ARCH_CONF_ENABLE
29  /*
30  * Line buffered output, a newline marks the end of debug output and
31  * implicitly flushes debug output.
32  */
33  if(c == '\n') {
34  io_arch_writeb(SLIP_END);
35  debug_frame = 0;
36  }
37 #endif
38 }
Platform-specific header file which switches between UART and USB input/output, depending on whether we are building for the cc2531 USB dongle or the SmartRF