2012-03-05 16:47:01 +01:00
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* hardware-specific putchar() routine for TI SmartRF05EB
|
|
|
|
*
|
|
|
|
* \author
|
|
|
|
* George Oikonomou - <oikonomou@users.sourceforge.net>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "contiki-conf.h"
|
2012-09-10 17:14:54 +02:00
|
|
|
#include "dev/io-arch.h"
|
2012-03-05 16:47:01 +01:00
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
void
|
|
|
|
putchar(char c)
|
|
|
|
{
|
|
|
|
#if SLIP_ARCH_CONF_ENABLE
|
|
|
|
#define SLIP_END 0300
|
|
|
|
static char debug_frame = 0;
|
|
|
|
|
|
|
|
if(!debug_frame) { /* Start of debug output */
|
2012-09-10 17:14:54 +02:00
|
|
|
io_arch_writeb(SLIP_END);
|
|
|
|
io_arch_writeb('\r'); /* Type debug line == '\r' */
|
2012-03-05 16:47:01 +01:00
|
|
|
debug_frame = 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-09-10 17:14:54 +02:00
|
|
|
io_arch_writeb((char)c);
|
2012-03-05 16:47:01 +01:00
|
|
|
|
|
|
|
#if SLIP_ARCH_CONF_ENABLE
|
|
|
|
/*
|
|
|
|
* Line buffered output, a newline marks the end of debug output and
|
|
|
|
* implicitly flushes debug output.
|
|
|
|
*/
|
|
|
|
if(c == '\n') {
|
2012-09-10 17:14:54 +02:00
|
|
|
io_arch_writeb(SLIP_END);
|
2012-03-05 16:47:01 +01:00
|
|
|
debug_frame = 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|