Skip to content

Commit 8716c25

Browse files
authored
Merge pull request #5 from libdriver/dev
fix: fix raspberrypi4b uart bugs
2 parents fa8ce03 + 1217063 commit 8716c25

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.0.3 (2024-10-13)
2+
3+
## Bug Fixes
4+
5+
- fix raspberrypi4b uart bugs
6+
17
## 1.0.2 (2024-08-10)
28

39
## Bug Fixes

project/raspberrypi4b/interface/src/uart.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ static uint8_t a_uart_config(int fd, uint32_t baud_rate, uint8_t data_bits, char
110110
break;
111111
}
112112

113+
/* 57600bps */
114+
case 57600 :
115+
{
116+
speed = B57600;
117+
118+
break;
119+
}
120+
113121
/* 115200bps */
114122
case 115200 :
115123
{
@@ -312,6 +320,11 @@ uint8_t uart_init(char *name, int *fd, uint32_t baud_rate, uint8_t data_bits, ch
312320
}
313321
else
314322
{
323+
/* control no block */
324+
int flags = fcntl(*fd, F_GETFL, 0);
325+
flags |= O_NONBLOCK;
326+
fcntl(*fd, F_SETFL, flags);
327+
315328
/* default settings */
316329
return a_uart_config(*fd, baud_rate, data_bits, parity, stop_bits);
317330
}

0 commit comments

Comments
 (0)