File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed
Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -120,3 +120,7 @@ void MotionService::UnsubscribeNotification(uint16_t attributeHandle) {
120120 else if (attributeHandle == motionValuesHandle)
121121 motionValuesNoficationEnabled = false ;
122122}
123+
124+ bool MotionService::IsMotionNotificationSubscribed () const {
125+ return motionValuesNoficationEnabled;
126+ }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ namespace Pinetime {
2121
2222 void SubscribeNotification (uint16_t attributeHandle);
2323 void UnsubscribeNotification (uint16_t attributeHandle);
24+ bool IsMotionNotificationSubscribed () const ;
2425
2526 private:
2627 NimbleController& nimble;
Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ namespace Pinetime {
6262 this ->service = service;
6363 }
6464
65+ Pinetime::Controllers::MotionService* GetService () const {
66+ return service;
67+ }
68+
6569 private:
6670 uint32_t nbSteps = 0 ;
6771 uint32_t currentTripSteps = 0 ;
Original file line number Diff line number Diff line change @@ -417,9 +417,9 @@ void SystemTask::UpdateMotion() {
417417 return ;
418418 }
419419
420- if (state == SystemTaskState::Sleeping &&
421- !( settingsController.isWakeUpModeOn (Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist ) ||
422- settingsController. isWakeUpModeOn (Pinetime::Controllers::Settings::WakeUpMode::Shake) || bleController. IsConnected ())) {
420+ if (state == SystemTaskState::Sleeping && !(settingsController. isWakeUpModeOn (Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist) ||
421+ settingsController.isWakeUpModeOn (Pinetime::Controllers::Settings::WakeUpMode::Shake ) ||
422+ motionController. GetService ()-> IsMotionNotificationSubscribed ())) {
423423 return ;
424424 }
425425
You can’t perform that action at this time.
0 commit comments