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:
Davis Mosenkovs 2024-06-30 19:16:04 +03:00
parent f8f8993fac
commit b2e2690adf

View file

@ -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;
} }