-
Notifications
You must be signed in to change notification settings - Fork 2.1k
pm: provide way to disable uart_stdio rx #7947
Description
The pm_layered module is used to automatically enter power modes if they are not blocked. However, the U(S)ART is usually initialized automatically:
find . -name "board.c" | xargs grep "stdio_init"
./boards/telosb/board.c: uart_stdio_init();
./boards/waspmote-pro/board.c: uart_stdio_init();
./boards/z1/board.c: uart_stdio_init();
./boards/arduino-atmega-common/board.c: uart_stdio_init();
However, this always blocks even first sleep modes, because the uart driver will block the level. Therefore I propose to introduce a simple wrapper e.g.
#ifndef PM_DISABLE_UART
uart_stdio_init();
#endif... or something similar that I can set in my application or pass to make in order to disable the default initialization of the uart. This will surely introduce problems when printf() calls are made,so a custom printf() function (PRINTF?) has to be used.
Are there any other ideas on how to solve this problem?
From what I observed, uart is the only thing that will currently block deep sleep capability.
I look forward to constructive discussions and propoals!