From 16a6d7efe057c1b7dea4e7f8bfaf24e2ce54534e Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 27 Jul 2016 21:58:35 -0700 Subject: [PATCH] Touch: Adjust thresholds and parameters for new scan. --- firmware/application/touch.hpp | 4 ++-- firmware/application/ui_touch_calibration.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/application/touch.hpp b/firmware/application/touch.hpp index 6f0895d7f..bc451e36e 100644 --- a/firmware/application/touch.hpp +++ b/firmware/application/touch.hpp @@ -218,9 +218,9 @@ private: TouchDetected, }; - static constexpr float r_touch_threshold = 0x1000; + static constexpr float r_touch_threshold = 640; static constexpr size_t touch_count_threshold { 3 }; - static constexpr uint32_t touch_stable_bound { 16 }; + static constexpr uint32_t touch_stable_bound { 8 }; // Ensure filter length is equal or less than touch_count_threshold, // or coordinates from the last touch will be in the initial averages. diff --git a/firmware/application/ui_touch_calibration.cpp b/firmware/application/ui_touch_calibration.cpp index fe11d8901..6fe200270 100644 --- a/firmware/application/ui_touch_calibration.cpp +++ b/firmware/application/ui_touch_calibration.cpp @@ -185,7 +185,7 @@ void TouchCalibrationView::on_frame_sync() { const auto x = metrics.x * 1024; const auto y = metrics.y * 1024; - if( metrics.r < 1000.0f ) { + if( metrics.r < 640.0f ) { if( samples_count > 0 ) { average.x = ((average.x * 7) + x) / 8; average.y = ((average.y * 7) + y) / 8;