-
-
Notifications
You must be signed in to change notification settings - Fork 984
/
Copy pathSettingShakeThreshold.h
52 lines (42 loc) · 1.43 KB
/
SettingShakeThreshold.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <cstdint>
#include <lvgl/lvgl.h>
#include "displayapp/screens/Screen.h"
namespace Pinetime::Controllers {
class Settings;
class MotionController;
}
namespace Pinetime::System {
class SystemTask;
}
namespace Pinetime {
namespace Applications {
namespace Screens {
class SettingShakeThreshold : public Screen {
public:
SettingShakeThreshold(Pinetime::Controllers::Settings& settingsController,
Controllers::MotionController& motionController,
System::SystemTask& systemTask);
~SettingShakeThreshold() override;
void Refresh() override;
void UpdateSelected(lv_obj_t* object, lv_event_t event);
private:
Controllers::Settings& settingsController;
Controllers::MotionController& motionController;
System::SystemTask& systemTask;
enum class CalibrationStep {
NotCalibrated = 0,
GettingReady = 1,
Calibrating = 2,
// Special case for disabled calibration due to sleep mode
Disabled = 255,
};
CalibrationStep currentCalibrationStep = CalibrationStep::NotCalibrated;
bool oldWakeupModeShake = false;
uint32_t vDecay = 0, vCalTime = 0;
lv_obj_t *positionArc = nullptr, *animArc = nullptr, *calButton = nullptr, *calLabel = nullptr;
lv_task_t* refreshTask = nullptr;
};
}
}
}