mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 23:21:53 +02:00
Expose SystemTask dependency controllers
Expose NotificationManager and Settings for use by the feature in next commit. This is a memory efficient way for accessing SystemTask dependencies from controllers that have SystemTask injected as a dependency. Looks like each direct dependency injection uses 4 bytes RAM. As InfiniTime is close to running out of RAM (using 16 more bytes causes build to fail with "ld: region RAM overflowed with stack") it might be helpful to use this approach more.
This commit is contained in:
parent
f8f8993fac
commit
b2e2690adf
|
@ -90,6 +90,14 @@ namespace Pinetime {
|
||||||
return nimbleController;
|
return nimbleController;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Pinetime::Controllers::NotificationManager& GetNotificationManager() {
|
||||||
|
return notificationManager;
|
||||||
|
};
|
||||||
|
|
||||||
|
Pinetime::Controllers::Settings& GetSettings() {
|
||||||
|
return settingsController;
|
||||||
|
};
|
||||||
|
|
||||||
bool IsSleeping() const {
|
bool IsSleeping() const {
|
||||||
return state == SystemTaskState::Sleeping || state == SystemTaskState::WakingUp;
|
return state == SystemTaskState::Sleeping || state == SystemTaskState::WakingUp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue