aboutsummaryrefslogtreecommitdiff
path: root/ports/esp32/mphalport.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/esp32/mphalport.c')
-rw-r--r--ports/esp32/mphalport.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ports/esp32/mphalport.c b/ports/esp32/mphalport.c
index 65fa88e4d..cf668216d 100644
--- a/ports/esp32/mphalport.c
+++ b/ports/esp32/mphalport.c
@@ -43,10 +43,11 @@
#include "lib/timeutils/timeutils.h"
#include "lib/utils/pyexec.h"
#include "mphalport.h"
+#include "usb.h"
TaskHandle_t mp_main_task_handle;
-STATIC uint8_t stdin_ringbuf_array[256];
+STATIC uint8_t stdin_ringbuf_array[260];
ringbuf_t stdin_ringbuf = {stdin_ringbuf_array, sizeof(stdin_ringbuf_array), 0, 0};
// Check the ESP-IDF error code and raise an OSError if it's not ESP_OK.
@@ -110,9 +111,13 @@ void mp_hal_stdout_tx_strn(const char *str, uint32_t len) {
if (release_gil) {
MP_THREAD_GIL_EXIT();
}
+ #if CONFIG_USB_ENABLED
+ usb_tx_strn(str, len);
+ #else
for (uint32_t i = 0; i < len; ++i) {
uart_tx_one_char(str[i]);
}
+ #endif
if (release_gil) {
MP_THREAD_GIL_ENTER();
}