Skip to content

Commit ab85a13

Browse files
committed
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
1 parent 52ec9ec commit ab85a13

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/rp2_common/pico_cyw43_driver/include/cyw43_configport.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,15 @@ void cyw43_post_poll_hook(void);
198198
#define cyw43_free free
199199
#endif
200200

201+
// 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
202+
#ifndef PICO_CYW43_LOGGING_ENABLED
203+
#define PICO_CYW43_LOGGING_ENABLED 1
204+
#endif
205+
206+
#if !defined CYW43_PRINTF && !PICO_CYW43_LOGGING_ENABLED
207+
#define CYW43_PRINTF(...) (void)0
208+
#endif
209+
201210
#ifdef __cplusplus
202211
}
203212
#endif

0 commit comments

Comments
 (0)