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
merge
[aversive.git]
/
modules
/
comm
/
uart
/
uart_host.c
diff --git
a/modules/comm/uart/uart_host.c
b/modules/comm/uart/uart_host.c
index
429c4db
..
bd6aeed
100644
(file)
--- a/
modules/comm/uart/uart_host.c
+++ b/
modules/comm/uart/uart_host.c
@@
-34,13
+34,29
@@
void uart_init(void)
event *rx_event[UART_HW_NUM];
event *tx_event[UART_HW_NUM];
event *rx_event[UART_HW_NUM];
event *tx_event[UART_HW_NUM];
+void uart_host_rx_event(char c)
+{
+ /* only one uart */
+ if (rx_event[0])
+ rx_event[0](c);
+}
+
+void uart_host_tx_event(char c)
+{
+ /* only one uart */
+ if (tx_event[0])
+ tx_event[0](c);
+}
+
int8_t uart_setconf(uint8_t num, struct uart_config *u)
{
int8_t uart_setconf(uint8_t num, struct uart_config *u)
{
+ /* XXX todo */
return 0;
}
void uart_getconf(uint8_t num, struct uart_config *u)
{
return 0;
}
void uart_getconf(uint8_t num, struct uart_config *u)
{
+ return;
}
int uart_recv(uint8_t num)
}
int uart_recv(uint8_t num)
@@
-48,6
+64,12
@@
int uart_recv(uint8_t num)
return getchar();
}
return getchar();
}
+/* XXX should not wait */
+int uart_recv_nowait(uint8_t num)
+{
+ return getchar();
+}
+
int uart_send_nowait(uint8_t num, char c)
{
return putchar(c);
int uart_send_nowait(uint8_t num, char c)
{
return putchar(c);
@@
-55,6
+77,5
@@
int uart_send_nowait(uint8_t num, char c)
int uart_send(uint8_t num, char c)
{
int uart_send(uint8_t num, char c)
{
- return put
_
char(c);
+ return putchar(c);
}
}
-