8000 Restore console_uart_printf, fix use of __ZEPHYR__. · eightycc/circuitpython@0a0eb7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a0eb7a

Browse files
committed
Restore console_uart_printf, fix use of __ZEPHYR__.
1 parent 255eea9 commit 0a0eb7a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

supervisor/shared/serial.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,3 +524,15 @@ void print_hexdump(const mp_print_t *printer, const char *prefix, const uint8_t
524524
mp_printf(printer, "\n");
525525
}
526526
}
527+
528+
int console_uart_printf(const char *fmt, ...) {
529+
#if CIRCUITPY_CONSOLE_UART
530+
va_list args;
531+
va_start(args, fmt);
532+
int ret = mp_vprintf(&console_uart_print, fmt, args);
533+
va_end(args);
534+
return ret;
535+
#else
536+
return 0;
537+
#endif
538+
}

supervisor/shared/serial.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ void board_serial_write_substring(const char *text, uint32_t length);
5050

5151
extern const mp_print_t console_uart_print;
5252

53+
int console_uart_printf(const char *fmt, ...);
54+
5355
void print_hexdump(const mp_print_t *printer, const char *prefix, const uint8_t *buf, size_t len);

supervisor/shared/usb/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern "C" {
5555
// When debugging TinyUSB, only output to the console UART link.
5656
#if CIRCUITPY_DEBUG_TINYUSB > 0 && defined(CIRCUITPY_CONSOLE_UART)
5757
#define CFG_TUSB_DEBUG CIRCUITPY_DEBUG_TINYUSB
58-
#if __ZEPHYR__
58+
#ifdef __ZEPHYR__
5959
#define CFG_TUSB_DEBUG_PRINTF zephyr_printk
6060
#else
6161
#define CFG_TUSB_DEBUG_PRINTF console_uart_printf

0 commit comments

Comments
 (0)
0