Skip to content

Commit b3aed37

Browse files
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 <[email protected]>
1 parent 69e0185 commit b3aed37

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/rp2_common/pico_cyw43_driver/include/cyw43_configport.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,18 @@ 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
204213

205214

206-
#endif
215+
#endif

0 commit comments

Comments
 (0)