diff options
| author | Damien George <damien@micropython.org> | 2023-03-09 11:36:10 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-03-09 13:20:59 +1100 |
| commit | b336b6bb743159356f26dc79585186ca3c89cab6 (patch) | |
| tree | ae3208910cf40484bea6b86723d8b56646beecbd /ports/stm32/pybthread.c | |
| parent | 067c7cd9dcb1391e16551db04d55b32b98a45518 (diff) | |
stm32/pybthread: Make pyb_thread_dump take a printer as its argument.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'ports/stm32/pybthread.c')
| -rw-r--r-- | ports/stm32/pybthread.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ports/stm32/pybthread.c b/ports/stm32/pybthread.c index 3af0112fa..57c8d1fdd 100644 --- a/ports/stm32/pybthread.c +++ b/ports/stm32/pybthread.c @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -#include <string.h> -#include <stdio.h> - #include "py/obj.h" #include "boardctrl.h" #include "gccollect.h" @@ -142,11 +139,11 @@ uint32_t pyb_thread_new(pyb_thread_t *thread, void *stack, size_t stack_len, voi return (uint32_t)thread; // success } -void pyb_thread_dump(void) { +void pyb_thread_dump(const mp_print_t *print) { if (!pyb_thread_enabled) { - printf("THREAD: only main thread\n"); + mp_printf(print, "THREAD: only main thread\n"); } else { - printf("THREAD:\n"); + mp_printf(print, "THREAD:\n"); for (pyb_thread_t *th = pyb_thread_all; th != NULL; th = th->all_next) { bool runable = false; for (pyb_thread_t *th2 = pyb_thread_cur;; th2 = th2->run_next) { @@ -158,11 +155,11 @@ void pyb_thread_dump(void) { break; } } - printf(" id=%p sp=%p sz=%u", th, th->stack, th->stack_len); + mp_printf(print, " id=%p sp=%p sz=%u", th, th->stack, th->stack_len); if (runable) { - printf(" (runable)"); + mp_printf(print, " (runable)"); } - printf("\n"); + mp_printf(print, "\n"); } } } |
