Skip to content

pm: provide way to disable uart_stdio rx #7947

@roberthartung

Description

@roberthartung

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: driversArea: Device driversArea: pmArea: (Low) power managementType: enhancementThe issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions