Hi Kaspar, pm.h consists of pm_set_lowest, pm_off and pm_reboot. pm_fallback therefore should define stubs for all of these [1]
cpu/cortexm_common defines some better implementation and also provides cortexm_sleep, that's why I created pm_cortexm_common [2]. cpu/stm32_common provides pm_set, but only for some CPUs, but always uses cortexm_sleep from cortexm_common - However I don't see a dependency of stm32_common to periph_common? Does this mean, all boards currenctly always use cortexm_common anyway, if they use stm32_common? This made me create *pm_stm32_common_layered* [3], as this only provides pm_set, so others can use pm_layered with this one. Another cool thing is that cpu/saml21 / cpu/samd21 are just able to use pm_layered and provide their own pm_set(). Q: Why is the pm_set guarded with ifdefs? Shouldn't all CPUs that use stm32_common be able to use pm_layered with pm_set? The same applies for all CPUs that are based on cortexm_common IMO. I've finished my WIP branch and it can be viewed at [0] [0] https://github.com/roberthartung/RIOT/tree/hartung/power-management [1] https://github.com/roberthartung/RIOT/blob/hartung/power-management/drivers/pm_fallback/pm_fallback.c [2] https://github.com/roberthartung/RIOT/blob/hartung/power-management/cpu/cortexm_common/pm/pm.c [3] https://github.com/roberthartung/RIOT/blob/hartung/power-management/cpu/stm32_common/pm/pm.c On 13.09.2017 15:09, Kaspar Schleiser wrote: > Hi, > > On 09/13/2017 03:06 PM, Robert Hartung wrote: >> Make all pm_* implementations submodules, so the final CPU *always* has >> to select the according pm implementation. > > You mean all functions, like pm_reboot()? > > Kaspar > -- Robert Hartung, M.Sc. Technische Universität Braunschweig Institut für Betriebssysteme und Rechnerverbund Mühlenpfordtstr. 23, Raum 115 38106 Braunschweig Fon: +49 (531) 391 - 3264 Fax: +49 (531) 391 - 5936 E-Mail: [email protected] _______________________________________________ devel mailing list [email protected] https://lists.riot-os.org/mailman/listinfo/devel
