From 9763cc955c4f3b2c2af54b61c2c5ad77afef9603 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 26 Jun 2023 12:55:46 +1000 Subject: 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 --- src/drivers/touchwheel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/drivers/touchwheel.cpp') 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; } } -- cgit v1.2.3