From c851b789faf71d0ef2092ae7d8cd3190c13d85c9 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 3 Oct 2023 15:00:28 +1100 Subject: Write up the new input modes to NVS and settings --- src/ui/encoder_input.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ui/encoder_input.cpp') diff --git a/src/ui/encoder_input.cpp b/src/ui/encoder_input.cpp index f6f74aaf..9aa5d29a 100644 --- a/src/ui/encoder_input.cpp +++ b/src/ui/encoder_input.cpp @@ -40,7 +40,8 @@ EncoderInput::EncoderInput(drivers::IGpios& gpios, drivers::TouchWheel& wheel) raw_wheel_(wheel), relative_wheel_(std::make_unique(wheel)), scroller_(std::make_unique()), - mode_(drivers::NvsStorage::InputModes::kRotatingWheel) { + mode_(drivers::NvsStorage::InputModes::kRotatingWheel), + is_locked_(false) { lv_indev_drv_init(&driver_); driver_.type = LV_INDEV_TYPE_ENCODER; driver_.read_cb = encoder_read; @@ -50,6 +51,10 @@ EncoderInput::EncoderInput(drivers::IGpios& gpios, drivers::TouchWheel& wheel) } auto EncoderInput::Read(lv_indev_data_t* data) -> void { + if (is_locked_) { + return; + } + raw_wheel_.Update(); relative_wheel_->Update(); // GPIOs updating is handled by system_fsm. -- cgit v1.2.3