summaryrefslogtreecommitdiff
path: root/src/drivers/touchwheel.cpp
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/touchwheel.cpp
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/touchwheel.cpp')
-rw-r--r--src/drivers/touchwheel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/drivers/touchwheel.cpp b/src/drivers/touchwheel.cpp
index 576b6dad..84d4d67c 100644
--- a/src/drivers/touchwheel.cpp
+++ b/src/drivers/touchwheel.cpp
@@ -105,8 +105,9 @@ void TouchWheel::Update() {
}
if (status & 0b1) {
// Key detect. Note that the touchwheel keys also trigger this.
- // TODO(daniel): Do something with this.
- // bool centre_key = ReadRegister(Register::KEY_STATUS_A) & 0b1000;
+ uint8_t reg = ReadRegister(Register::KEY_STATUS_A);
+ data_.is_button_touched = reg & 0b1000;
+ data_.is_wheel_touched = reg & 0b111;
}
}