8000 renesas-ra/mphalport: Use shared/tinyusb cdc functions. · micropython/micropython@dc7b9c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit dc7b9c1

Browse files
committed
renesas-ra/mphalport: Use shared/tinyusb cdc functions.
Signed-off-by: Andrew Leech <andrew@alelec.net>
1 parent 5040637 commit dc7b9c1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

ports/renesas-ra/mphalport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "py/ringbuf.h"
3535
#include "extmod/misc.h"
3636
#include "shared/runtime/interrupt_char.h"
37+
#include "shared/tinyusb/mp_cdc_common.h"
3738
#include "tusb.h"
3839
#include "uart.h"
3940

@@ -49,7 +50,6 @@ void flash_cache_commit(void);
4950

5051
static uint8_t stdin_ringbuf_array[MICROPY_HW_STDIN_BUFFER_LEN];
5152
ringbuf_t stdin_ringbuf = { stdin_ringbuf_array, sizeof(stdin_ringbuf_array) };
52-
5353
#endif
5454

5555
// this table converts from HAL_StatusTypeDef to POSIX errno
@@ -68,7 +68,7 @@ NORETURN void mp_hal_raise(HAL_StatusTypeDef status) {
6868

6969
uint8_t cdc_itf_pending; // keep track of cdc interfaces which need attention to poll
7070

71-
void poll_cdc_interfaces(void) {
71+
void tud_cdc_poll_interfaces(void) {
7272
// any CDC interfaces left to poll?
7373
if (cdc_itf_pending && ringbuf_free(&stdin_ringbuf)) {
7474
for (uint8_t itf = 0; itf < 8; ++itf) {
@@ -106,7 +106,7 @@ void tud_cdc_rx_cb(uint8_t itf) {
106106
uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) {
107107
uintptr_t ret = 0;
108108
#if MICROPY_HW_USB_CDC
109-
poll_cdc_interfaces();
109+
tud_cdc_poll_interfaces();
110110
#endif
111111
#if MICROPY_HW_ENABLE_UART_REPL || MICROPY_HW_USB_CDC
112112
if ((poll_flags & MP_STREAM_POLL_RD) && ringbuf_peek(&stdin_ringbuf) != -1) {
@@ -132,7 +132,7 @@ uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) {
132132
int mp_hal_stdin_rx_chr(void) {
133133
for (;;) {
134134
#if MICROPY_HW_USB_CDC
135-
poll_cdc_interfaces();
135+
tud_cdc_poll_interfaces();
136136
#endif
137137

138138
#if MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE

ports/renesas-ra/mphalport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#define MICROPY_HW_USB_CDC_TX_TIMEOUT (500)
4343

4444
extern const unsigned char mp_hal_status_to_errno_table[4];
45+
extern int mp_interrupt_char;
4546
extern ringbuf_t stdin_ringbuf;
4647

4748
static inline int mp_hal_status_to_neg_errno(HAL_StatusTypeDef status) {

0 commit comments

Comments
 (0)
0