1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 21:17:31 +02:00

swuart-chat/chat.c: open/close UBB explicitly (tracking API change)

This commit is contained in:
Werner Almesberger 2012-12-28 17:11:19 -03:00
parent 661420933e
commit ace55ffb37

View File

@ -65,6 +65,7 @@ static void at_exit(void)
{ {
restore_term(); restore_term();
swuart_close(); swuart_close();
ubb_close(0);
} }
@ -73,9 +74,16 @@ int main(int argc, char **argv)
uint8_t local[10], remote[100]; uint8_t local[10], remote[100];
int got, i; int got, i;
raw(); if (ubb_open(0) < 0) {
perror("ubb_open");
exit(1);
}
atexit(at_exit); atexit(at_exit);
swuart_open(TX, RX, 38400); raw();
if (swuart_open(TX, RX, 38400) < 0) {
fprintf(stderr, "swuart_open failed\n");
exit(1);
}
while (1) { while (1) {
got = read(0, local, sizeof(local)); got = read(0, local, sizeof(local));