Skip to content

Commit b2e2690

Browse files
committed
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.
1 parent f8f8993 commit b2e2690

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/systemtask/SystemTask.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ namespace Pinetime {
9090
return nimbleController;
9191
};
9292

93+
Pinetime::Controllers::NotificationManager& GetNotificationManager() {
94+
return notificationManager;
95+
};
96+
97+
Pinetime::Controllers::Settings& GetSettings() {
98+
return settingsController;
99+
};
100+
93101
bool IsSleeping() const {
94102
return state == SystemTaskState::Sleeping || state == SystemTaskState::WakingUp;
95103
}

0 commit comments

Comments
 (0)