diff options
| author | wdfk-prog <[email protected]> | 2026-02-12 08:57:46 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-02-12 09:24:18 +0800 |
| commit | db6c0ddbf333be65f5ddc990ee63a200f768a9f7 (patch) | |
| tree | 0df5392754915d89a5bc1dbfc04d628af5deaa76 /include/rtthread.h | |
| parent | 9412a2899d08c3ef806accf0335bda2397c326de (diff) | |
feat(console): Add console output enable switch
- rt_console_output_enabled()/rt_console_output_is_enabled() gate rt_kprintf/rt_kputs output with the switch
Diffstat (limited to 'include/rtthread.h')
| -rw-r--r-- | include/rtthread.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/rtthread.h b/include/rtthread.h index 7f97c068cd..a87515907e 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -783,6 +783,13 @@ void rt_components_board_init(void); #else int rt_kprintf(const char *fmt, ...); void rt_kputs(const char *str); +#ifdef RT_USING_CONSOLE_OUTPUT_CTL +void rt_console_output_set_enabled(rt_bool_t enabled); +rt_bool_t rt_console_output_get_enabled(void); +#else +#define rt_console_output_set_enabled(enabled) ((void)0) +#define rt_console_output_get_enabled() (RT_TRUE) +#endif /* RT_USING_CONSOLE_OUTPUT_CTL */ #endif /* RT_USING_CONSOLE */ rt_err_t rt_backtrace(void); |
