pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

Should there be a stdio_uart_deinit()?

Open bruelltuete opened this issue 3 years ago • 0 comments

I would like to disable UART console output after running for a while. Idea is to dump boot diagnostics to console but once everything is up and running (say after 1 minute or so) I would like to disable UART output to save power running off batteries. I'd call stdio_uart_deinit and then clock-off UART. My crusty amp meter says clock-off will save about 0.5mA.

Stumbled over #808 while trying this.

I got a related question: what is supposed to happen (wrt to printf) if I disable CLOCKS_WAKE_EN1_CLK_SYS_UART0_BITS and CLOCKS_WAKE_EN1_CLK_PERI_UART0_BITS? Somewhere down the call stack is a call to uart_write_blocking(). If the UART controller is not clocked, is there always space in the tx fifo?

bruelltuete avatar May 05 '22 00:05 bruelltuete