Correct prototype for sdk_uart_rx_one_char, kudos to @foogod
This commit is contained in:
parent
0e521a74a9
commit
64a1e5598b
2 changed files with 9 additions and 4 deletions
|
@ -48,9 +48,13 @@ long _write_r(struct _reent *r, int fd, const char *ptr, int len )
|
|||
*/
|
||||
long _read_r( struct _reent *r, int fd, char *ptr, int len )
|
||||
{
|
||||
for(int i = 0; i < len; i++)
|
||||
ptr[i] = sdk_uart_rx_one_char();
|
||||
return len;
|
||||
for(int i = 0; i < len; i++) {
|
||||
char ch;
|
||||
while (sdk_uart_rx_one_char(&ch)) ;
|
||||
ptr[i] = ch;
|
||||
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
/* These are stub implementations for the reentrant syscalls that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue