summaryrefslogtreecommitdiff
path: root/src/drivers/include
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-06-26 12:55:46 +1000
committerjacqueline <me@jacqueline.id.au>2023-06-26 12:55:46 +1000
commit9763cc955c4f3b2c2af54b61c2c5ad77afef9603 (patch)
treebdfef9f5685fac3088cf4d59400e888a1b0ffb8b /src/drivers/include
parentc124c8f94dbdb41a7e535b741fe2d2be8e7346c0 (diff)
downloadtangara-fw-9763cc955c4f3b2c2af54b61c2c5ad77afef9603.tar.gz
Improve encoder driver
It actually works and clicks now! Still a bit rough though. Need to dive into lvgl internals to work out what it's doing with enc_diff
Diffstat (limited to 'src/drivers/include')
-rw-r--r--src/drivers/include/relative_wheel.hpp5
-rw-r--r--src/drivers/include/touchwheel.hpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/drivers/include/relative_wheel.hpp b/src/drivers/include/relative_wheel.hpp
index da4f9e3d..8d74d551 100644
--- a/src/drivers/include/relative_wheel.hpp
+++ b/src/drivers/include/relative_wheel.hpp
@@ -32,12 +32,13 @@ class RelativeWheel {
auto Update() -> void;
- auto is_pressed() -> bool;
+ auto is_clicking() -> bool;
auto ticks() -> std::int_fast16_t;
private:
TouchWheel* touch_;
- bool is_pressed_;
+ bool is_clicking_;
+ bool was_clicking_;
bool is_first_read_;
std::int_fast16_t ticks_;
uint8_t last_angle_;
diff --git a/src/drivers/include/touchwheel.hpp b/src/drivers/include/touchwheel.hpp
index 1468fc65..5c3442d2 100644
--- a/src/drivers/include/touchwheel.hpp
+++ b/src/drivers/include/touchwheel.hpp
@@ -17,7 +17,8 @@
namespace drivers {
struct TouchWheelData {
- bool is_touched = false;
+ bool is_wheel_touched = false;
+ bool is_button_touched = false;
uint8_t wheel_position = -1;
};