From b3aed37a1831ea95f1aefa410ee4299b6c0aba52 Mon Sep 17 00:00:00 2001 From: Peter Harper <77111776+peterharperuk@users.noreply.github.com> Date: Mon, 14 Jul 2025 17:29:28 +0100 Subject: [PATCH] Provide an easy way to disable cyw43 logging (#2535) * Provide an easy way to disable cyw43 logging All cyw43 logging uses CYW43_PRINTF by default. To disable logging you have to define this to do nothing. There's no simple way to achieve this. Make it easier by adding PICO_CYW43_LOGGING_ENABLED which can be set to zero to disable CYW43_PRINTF. Fixes #2523 * teensy style change --------- Co-authored-by: Graham Sanderson --- .../pico_cyw43_driver/include/cyw43_configport.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/rp2_common/pico_cyw43_driver/include/cyw43_configport.h b/src/rp2_common/pico_cyw43_driver/include/cyw43_configport.h index f1c00c2f..570ba2a1 100644 --- a/src/rp2_common/pico_cyw43_driver/include/cyw43_configport.h +++ b/src/rp2_common/pico_cyw43_driver/include/cyw43_configport.h @@ -198,9 +198,18 @@ void cyw43_post_poll_hook(void); #define cyw43_free free #endif +// PICO_CONFIG: PICO_CYW43_LOGGING_ENABLED, Enable/disable CYW43_PRINTF used for logging in cyw43 components. Has no effect if CYW43_PRINTF is defined by the user, default=1, type=bool, group=pico_cyw43_driver +#ifndef PICO_CYW43_LOGGING_ENABLED +#define PICO_CYW43_LOGGING_ENABLED 1 +#endif + +#if !defined(CYW43_PRINTF) && !PICO_CYW43_LOGGING_ENABLED +#define CYW43_PRINTF(...) (void)0 +#endif + #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif