Skip to content

Commit a08eb06

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 f7c87a7 commit a08eb06

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/systemtask/SystemTask.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ namespace Pinetime {
8585
return nimbleController;
8686
};
8787

88+
Pinetime::Controllers::NotificationManager& GetNotificationManager() {
89+
return notificationManager;
90+
};
91+
92+
Pinetime::Controllers::Settings& GetSettings() {
93+
return settingsController;
94+
};
95+
8896
bool IsSleeping() const {
8997
return state != SystemTaskState::Running;
9098
}

0 commit comments

Comments
 (0)