Skip to content

Commit

Permalink
rp2/cyw43_configport: Define CYW43_PRINTF to mp_printf to get messages.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dpgeorge committed Oct 3, 2024
1 parent ca220b5 commit ca6723b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ports/rp2/cyw43_configport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit ca6723b

Please sign in to comment.