Contiki 2.5
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
platform
msb430
msb430-slip-arch.c
1
#include "dev/msb430-uart1.h"
2
#include "dev/rs232.h"
3
#include "sys/clock.h"
4
#include "dev/slip.h"
5
6
7
void
8
slip_arch_writeb(
unsigned
char
c)
9
{
10
rs232_send
(c);
11
}
12
/*---------------------------------------------------------------------------*/
13
14
/*
15
* The serial line is used to transfer IP packets using slip. To make
16
* it possible to send debug output over the same line we send debug
17
* output as slip frames (i.e delimeted by SLIP_END).
18
*
19
*/
20
int
21
putchar(
int
c)
22
{
23
#define SLIP_END 0300
24
static
char
debug_frame = 0;
25
26
if
(!debug_frame) {
/* Start of debug output */
27
slip_arch_writeb(SLIP_END);
28
slip_arch_writeb(
'\r'
);
/* Type debug line == '\r' */
29
debug_frame = 1;
30
}
31
32
slip_arch_writeb((
char
)c);
33
34
/*
35
* Line buffered output, a newline marks the end of debug output and
36
* implicitly flushes debug output.
37
*/
38
if
(c ==
'\n'
) {
39
slip_arch_writeb(SLIP_END);
40
debug_frame = 0;
41
}
42
43
clock_delay
(100);
44
45
return
c;
46
}
47
48
/**
49
* Initalize the RS232 port and the SLIP driver.
50
*
51
*/
52
void
53
slip_arch_init
(
unsigned
long
ubr)
54
{
55
rs232_set_input
(slip_input_byte);
56
}
Generated on Fri Aug 30 2013 12:34:11 for Contiki 2.5 by
1.8.3.1