1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-12-24 20:23:54 +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();
swuart_close();
ubb_close(0);
}
@ -73,9 +74,16 @@ int main(int argc, char **argv)
uint8_t local[10], remote[100];
int got, i;
raw();
if (ubb_open(0) < 0) {
perror("ubb_open");
exit(1);
}
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) {
got = read(0, local, sizeof(local));