-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce new power management #6160
Changes from all commits
0194091
6150e27
92f6fc6
4291c1f
ac9b122
1b31fc7
ca7bf15
807a190
f42e538
3e365b8
040c6e9
52d53a9
fb46d57
8c8ce5a
062b907
fa9fbab
0fb66a0
066332d
db82367
662bec0
f0cf52f
c2b48ca
a8c5fcc
5798bec
9d1c5f0
51a86f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# import list of provided features | ||
-include $(RIOTBOARD)/$(BOARD)/Makefile.features | ||
-include $(RIOTCPU)/$(CPU)/Makefile.features | ||
|
||
DEFAULT_FEATURES += periph_pm | ||
|
||
# add available default features to required list | ||
FEATURES_REQUIRED += $(filter-out $(DISABLE_FEATURES), $(filter $(FEATURES_PROVIDED), $(DEFAULT_FEATURES))) | ||
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
#ifndef REBOOT_H_ | ||
#define REBOOT_H_ | ||
|
||
#include "periph/pm.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
@@ -28,7 +30,10 @@ | |
* | ||
* This function is used by core_panic() when the DEVELHELP macro is not defined. | ||
*/ | ||
void reboot(void); | ||
static inline void reboot(void) | ||
{ | ||
pm_reboot(); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: why don't we just throw out this file completely and use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just seen below, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I kept the interface for now in order to keep the PR small, and to maybe, have the option to hook in things, like a message, at a central spot. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm: I would like to say it with your words: don't leave stuff there because we might need it again at some point in the future, reintroduce once really needed :-) |
||
|
||
#ifdef __cplusplus | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, I think there is a conceptual error here:
FEATURES_REQUIRED != (FEATURES_PROVIDED - DISABLE_FEATURES)
FEATURES_REQUIRED
should filled by the dependency definitions in theMakefile.dep
s, e.g. theat86rf2xx
requiresperiph_gpio
andperiph_spi
.So I guess this should be something like
FEATURES_REAL
:=FEATURES_REQUIRED
+DEFAULT_FEATURES
-DISABLE_FEATURES
?!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FEATURES_REQUIRED
is being used to set the defines in riot_build.h.DEFAULT_FEATURES
is used to always include a feature, if available (e.g., always require periph_pm)DISABLE_FEATURES
can be used to overrideDEFAULT_FEATURES
(e.g., this time, build without periph/pm)The file adds all features from "default features" that are available, unless they are in "disabled features", to the required list.
So in set operations,
FEATURES_REQUIRED += (DEFAULT_FEATURES | FEATURES_PROVIDED) - DISABLED_FEATURES
. I think the last line in the file does that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in your last statement we have the problem:
FEATURES_REQUIRED
should be(DEFAULT_FEATURES & FEATURES_PROVIDED) - DISABLED_FEATURES
?!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hehe I think we need to define our operators. ;)
The make line adds all features from the default features that are provided and not disabled to the required features.
If during dependency processing other features are already in the required list, they stay in. Also, disabled_features does only disable default features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case everything is just fine. Good thing we talked about it :-)