git.droids-corp.org
/
aversive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
beacon, prepare integration
[aversive.git]
/
projects
/
microb2010
/
tests
/
beacon_tsop
/
uart_proto.c
diff --git
a/projects/microb2010/tests/beacon_tsop/uart_proto.c
b/projects/microb2010/tests/beacon_tsop/uart_proto.c
index
81c315c
..
940cd38
100644
(file)
--- a/
projects/microb2010/tests/beacon_tsop/uart_proto.c
+++ b/
projects/microb2010/tests/beacon_tsop/uart_proto.c
@@
-31,8
+31,6
@@
#include "cmdline.h"
#include "main.h"
#include "cmdline.h"
#include "main.h"
-#include "board2006.h"
-//#include "board2010.h"
#define UART_NUM 0
#define UART_NUM 0
@@
-79,12
+77,18
@@
void uart_proto_init(void)
UBRRxH = 0;
}
UBRRxH = 0;
}
-static void uart_proto_send(char c)
-{
+static void uart_proto_send(char c)
+{
while ( !( UCSRxA & (1<<UDREx)) ) ;
while ( !( UCSRxA & (1<<UDREx)) ) ;
- UDRx = c;
+ UDRx = c;
}
}
+int16_t uart_proto_recv(void)
+{
+ if ( !(UCSRxA & (1<<RXCx)) )
+ return -1;
+ return UDRx;
+}
/* transmit an integer between 0 and 16384 */
static void xmit_int14(uint16_t x)
/* transmit an integer between 0 and 16384 */
static void xmit_int14(uint16_t x)