Modify USB<->USART example.

This commit is contained in:
NIIBE Yutaka
2017-12-15 16:00:59 +09:00
parent cb628fe317
commit 22039ee717
7 changed files with 110 additions and 54 deletions

View File

@@ -498,7 +498,7 @@ usart_main (void *arg)
}
int
usart_read (uint8_t dev_no, uint8_t *buf, uint16_t buflen)
usart_read (uint8_t dev_no, char *buf, uint16_t buflen)
{
struct rb *rb;
@@ -509,11 +509,11 @@ usart_read (uint8_t dev_no, uint8_t *buf, uint16_t buflen)
else
return -1;
return rb_read (rb, buf, buflen);
return rb_read (rb, (uint8_t *)buf, buflen);
}
int
usart_write (uint8_t dev_no, uint8_t *buf, uint16_t buflen)
usart_write (uint8_t dev_no, char *buf, uint16_t buflen)
{
struct rb *rb;
@@ -524,7 +524,7 @@ usart_write (uint8_t dev_no, uint8_t *buf, uint16_t buflen)
else
return -1;
rb_write (rb, buf, buflen);
rb_write (rb, (uint8_t *)buf, buflen);
return 0;
}