[riot-devel] Discussion of Power Management

Kaspar Schleiser kaspar at schleiser.de
Thu Aug 31 17:02:01 CEST 2017


Hi Robert,

On 08/31/2017 04:37 PM, Robert Hartung wrote:
>> - if not, possibly e.g., kinetis_common has pm_set(), then that should
>> depend on pm_layered
> 
> This means that kinetis_common should provide a module
> **kinetis_common_pm** that provides pm_set. The CPU should then depend
> on this module. Additionally, it should select pm_layered.

Yes!

>> - if not, it depends on periph_pm_fallback (which should wrap current
>> drivers/periph_common/pm.c)
> 
> In this case we use the existing pm_* functions from
> drivers/periph_common/pm.c, but I would move them to the module I
> created (pm_fallback?).

Perfect!

> I am working on a pm_fallback module (moved it from drivers/periph/pm.c
> to sys/pm_fallback/pm.c) - is that the right location? Or where should
> it be located?

I think as the periph common code is in drivers/, so should the fallback
code.

How about using submodules within drivers/periph_common/Makefile? E.g.,

- rename drivers/periph_common/pm.c to pm_fallback.c
- add
    # exclude submodule sources from *.c wildcard source selection
    SRC := $(pm_fallback.c,$(wildcard *.c))
  to drivers/periph_common/Makefile

- add "PSEUDOMODULES += periph_common_%" to makefiles/pseudomodules.mk

That would compile pm_fallback *only* if periph_common_pm_fallback is
selected. (with #5757, all periph files will become submodules...)

kinetis_common/periph/pm.c can just go (and be replaced with a
dependency on the cortem_common code).

Kaspar


More information about the devel mailing list