Made calibration window enable Accel wakeups for setting and calibration even when wake mode is inactive.

This commit is contained in:
Tim Keller 2021-11-08 02:00:35 +00:00
parent 92b1e83e3e
commit f86c71b2bb
2 changed files with 9 additions and 1 deletions

View file

@ -63,13 +63,20 @@ SettingShakeThreshold::SettingShakeThreshold(DisplayApp* app,
vDecay = xTaskGetTickCount(); vDecay = xTaskGetTickCount();
calibrating = false; calibrating = false;
if(!settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake)){
EnableForCal = true;
settingsController.setWakeUpMode(Pinetime::Controllers::Settings::WakeUpMode::Shake,true);
}
refreshTask = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); refreshTask = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
} }
SettingShakeThreshold::~SettingShakeThreshold() { SettingShakeThreshold::~SettingShakeThreshold() {
settingsController.SetShakeThreshold(lv_arc_get_value(positionArc)); settingsController.SetShakeThreshold(lv_arc_get_value(positionArc));
if(EnableForCal){
settingsController.setWakeUpMode(Pinetime::Controllers::Settings::WakeUpMode::Shake,false);
EnableForCal = false;
}
lv_task_del(refreshTask); lv_task_del(refreshTask);
settingsController.SaveSettings(); settingsController.SaveSettings();
lv_obj_clean(lv_scr_act()); lv_obj_clean(lv_scr_act());

View file

@ -26,6 +26,7 @@ namespace Pinetime {
Controllers::MotionController& motionController; Controllers::MotionController& motionController;
System::SystemTask& systemTask; System::SystemTask& systemTask;
uint8_t calibrating; uint8_t calibrating;
bool EnableForCal;
uint32_t vDecay,vCalTime; uint32_t vDecay,vCalTime;
lv_obj_t *positionArc, *animArc,*calButton, *calLabel; lv_obj_t *positionArc, *animArc,*calButton, *calLabel;
lv_task_t* refreshTask; lv_task_t* refreshTask;