From 1ff28233bd6a64fab97c56861477e122e4c3eac6 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 7 Aug 2024 12:09:23 +1000 Subject: Recalibrate the touchwheel after unlocking Also power it down whilst we're locked. This saves about half a milliamp. --- src/drivers/touchwheel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/drivers/touchwheel.cpp') diff --git a/src/drivers/touchwheel.cpp b/src/drivers/touchwheel.cpp index 5d55c6f2..402b839d 100644 --- a/src/drivers/touchwheel.cpp +++ b/src/drivers/touchwheel.cpp @@ -137,8 +137,12 @@ TouchWheelData TouchWheel::GetTouchWheelData() const { return data_; } -auto TouchWheel::PowerDown() -> void { - WriteRegister(LOW_POWER, 0); +auto TouchWheel::Recalibrate() -> void { + WriteRegister(CALIBRATE, 1); +} + +auto TouchWheel::LowPowerMode(bool en) -> void { + WriteRegister(LOW_POWER, en ? 0 : 1); } } // namespace drivers -- cgit v1.2.3