diff options
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/include/nvs.hpp | 10 | ||||
| -rw-r--r-- | src/drivers/relative_wheel.cpp | 1 | ||||
| -rw-r--r-- | src/drivers/touchwheel.cpp | 8 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/drivers/include/nvs.hpp b/src/drivers/include/nvs.hpp index 3e37c49e..46a3d154 100644 --- a/src/drivers/include/nvs.hpp +++ b/src/drivers/include/nvs.hpp @@ -44,6 +44,16 @@ class NvsStorage { auto HasShownOnboarding() -> bool; auto HasShownOnboarding(bool) -> bool; + enum class InputModes : uint8_t { + kButtonsOnly = 0, + kButtonsWithWheel = 1, + kDirectionalWheel = 2, + kRotatingWheel = 3, + }; + + auto PrimaryInput() -> InputModes; + auto PrimaryInput(InputModes) -> bool; + explicit NvsStorage(nvs_handle_t); ~NvsStorage(); diff --git a/src/drivers/relative_wheel.cpp b/src/drivers/relative_wheel.cpp index 859f69e3..b944b47b 100644 --- a/src/drivers/relative_wheel.cpp +++ b/src/drivers/relative_wheel.cpp @@ -23,7 +23,6 @@ RelativeWheel::RelativeWheel(TouchWheel& touch) last_angle_(0) {} auto RelativeWheel::Update() -> void { - touch_.Update(); TouchWheelData d = touch_.GetTouchWheelData(); is_clicking_ = d.is_button_touched; diff --git a/src/drivers/touchwheel.cpp b/src/drivers/touchwheel.cpp index aabc5787..cad3433d 100644 --- a/src/drivers/touchwheel.cpp +++ b/src/drivers/touchwheel.cpp @@ -99,10 +99,10 @@ uint8_t TouchWheel::ReadRegister(uint8_t reg) { void TouchWheel::Update() { // Read data from device into member struct - // bool has_data = !gpio_get_level(kIntPin); - // if (!has_data) { - // return; - // } + bool has_data = !gpio_get_level(kIntPin); + if (!has_data) { + return; + } uint8_t status = ReadRegister(Register::DETECTION_STATUS); if (status & 0b10000000) { // Still calibrating. |
