Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ Testing/Temporary/
#build files
src/nRF5_SDK_15.3.0_59ac345
src/arm-none-eabi

# clangd
.cache/
4 changes: 4 additions & 0 deletions src/components/ble/MotionService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ void MotionService::UnsubscribeNotification(uint16_t connectionHandle, uint16_t
else if (attributeHandle == motionValuesHandle)
motionValuesNoficationEnabled = false;
}

bool MotionService::IsMotionNotificationSubscribed() const {
return motionValuesNoficationEnabled;
}
1 change: 1 addition & 0 deletions src/components/ble/MotionService.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Pinetime {

void SubscribeNotification(uint16_t connectionHandle, uint16_t attributeHandle);
void UnsubscribeNotification(uint16_t connectionHandle, uint16_t attributeHandle);
bool IsMotionNotificationSubscribed() const;

private:
Pinetime::System::SystemTask& system;
Expand Down
4 changes: 4 additions & 0 deletions src/components/motion/MotionController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ void MotionController::Init(Pinetime::Drivers::Bma421::DeviceTypes types) {
void MotionController::SetService(Pinetime::Controllers::MotionService* service) {
this->service = service;
}

Pinetime::Controllers::MotionService* MotionController::GetService() const {
return this->service;
}
3 changes: 2 additions & 1 deletion src/components/motion/MotionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ namespace Pinetime {

void Init(Pinetime::Drivers::Bma421::DeviceTypes types);
void SetService(Pinetime::Controllers::MotionService* service);
Pinetime::Controllers::MotionService* GetService() const;

private:
uint32_t nbSteps;
Expand All @@ -69,4 +70,4 @@ namespace Pinetime {
uint32_t lastShakeTime = 0;
};
}
}
}
3 changes: 2 additions & 1 deletion src/systemtask/SystemTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ void SystemTask::UpdateMotion() {
}

if (state == SystemTaskState::Sleeping && !(settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist) ||
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake))) {
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake) ||
motionController.GetService()->IsMotionNotificationSubscribed())) {
return;
}

Expand Down