mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-04 22:53:08 +02:00
swuart-chat/chat.c: open/close UBB explicitly (tracking API change)
This commit is contained in:
parent
661420933e
commit
ace55ffb37
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user