diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-26 12:55:46 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-26 12:55:46 +1000 |
| commit | 9763cc955c4f3b2c2af54b61c2c5ad77afef9603 (patch) | |
| tree | bdfef9f5685fac3088cf4d59400e888a1b0ffb8b /src/drivers/touchwheel.cpp | |
| parent | c124c8f94dbdb41a7e535b741fe2d2be8e7346c0 (diff) | |
| download | tangara-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.cpp | 5 |
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; } } |
