[riot-notifications] [RIOT-OS/RIOT] pm: adds a c/file-based power management configuration to select required implementations (#7648)

Kaspar Schleiser notifications at github.com
Thu Sep 28 09:11:36 CEST 2017


This might be nicer than the submodule version.
Some thoughts:

1. There are a lot of "pm_conf.h" which just include "pm_conf_common.h". If I'm not mistaken, "pm_conf.h" either does that *or* defines all needed values. I think we should be able to rely on the include path order here (first cpu/specific/include, then cpu/family_common/include, ...), and just rename all "pm_conf_common.h" to "pm_conf.h". If the order is not deterministic, we should fix that (in another PR) anyways.

2. the defines get veeery long. IMO we can shorten them. Maybe drop "PERIPH_PM" prefix, and drop "COMMON", which should turn into sufficiently unique names. E.g.: "PERIPH_PM_NEEDS_ARM7_COMMON_FALLBACK_REBOOT" -> "NEEDS_ARM7_PM_REBOOT".

3. Some functions are guarded by both general and specific defines, e.g., "NEEDS_PM_FALLBACK | NEEDS_PM_FALBACK_OFF". Please, if possible, bundle the generic selection into one ifdef block (at the top of the file?), and keep only one condition at the function definition:

```
#ifdef NEEDS_PM_FALLBACK
#define NEEDS_PM_OFF_FALLBACK
#define NEEDS_PM_SET_LOWEST_FALLBACK
...
#endif
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/7648#issuecomment-332748647
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20170928/b40a0823/attachment.html>


More information about the notifications mailing list