diff options
author | Damien George <damien@micropython.org> | 2024-09-18 12:10:22 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-10-03 12:12:18 +1000 |
commit | ca6723b144501d3ea96a5a79bb18f0947a63fc87 (patch) | |
tree | 91e27b8acadaf66c668703a84a5565de3bc76f3e | |
parent | ca220b5fc57860f3c5e584230c9d9b684b8847a3 (diff) |
rp2/cyw43_configport: Define CYW43_PRINTF to mp_printf to get messages.
The cyw43-driver uses `printf` by default for `CYW43_PRINTF`, but on the
rp2 port `printf` only goes to a UART output and not to USB CDC.
By defining `CYW43_PRINTF` to `mp_printf`, all the messages from the
cyw43-driver are seen on USB CDC.
For example this allows `network.WLAN().config(trace=1)` to show async
WALN events.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r-- | ports/rp2/cyw43_configport.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/rp2/cyw43_configport.h b/ports/rp2/cyw43_configport.h index 7b1a1ae3d..4b012ce17 100644 --- a/ports/rp2/cyw43_configport.h +++ b/ports/rp2/cyw43_configport.h @@ -27,6 +27,7 @@ #define MICROPY_INCLUDED_RP2_CYW43_CONFIGPORT_H // The board-level config will be included here, so it can set some CYW43 values. +#include <stdio.h> #include "py/mpconfig.h" #include "py/mperrno.h" #include "py/mphal.h" @@ -39,6 +40,7 @@ #define CYW43_SLEEP_MAX (10) #define CYW43_NETUTILS (1) #define CYW43_USE_OTP_MAC (1) +#define CYW43_PRINTF(...) mp_printf(MP_PYTHON_PRINTER, __VA_ARGS__) #define CYW43_EPERM MP_EPERM // Operation not permitted #define CYW43_EIO MP_EIO // I/O error |