Skip to content

Commit

Permalink
fix: fix raspberrypi4b uart bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
libdriver committed Oct 13, 2024
1 parent 83a1920 commit 1217063
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.0.3 (2024-10-13)

## Bug Fixes

- fix raspberrypi4b uart bugs

## 1.0.2 (2024-08-10)

## Bug Fixes
Expand Down
13 changes: 13 additions & 0 deletions project/raspberrypi4b/interface/src/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ static uint8_t a_uart_config(int fd, uint32_t baud_rate, uint8_t data_bits, char
break;
}

/* 57600bps */
case 57600 :
{
speed = B57600;

break;
}

/* 115200bps */
case 115200 :
{
Expand Down Expand Up @@ -312,6 +320,11 @@ uint8_t uart_init(char *name, int *fd, uint32_t baud_rate, uint8_t data_bits, ch
}
else
{
/* control no block */
int flags = fcntl(*fd, F_GETFL, 0);
flags |= O_NONBLOCK;
fcntl(*fd, F_SETFL, flags);

/* default settings */
return a_uart_config(*fd, baud_rate, data_bits, parity, stop_bits);
}
Expand Down

0 comments on commit 1217063

Please sign in to comment.