mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-27 08:46:01 -04:00
touchscreen threshold (sensitivity) auto detect (#2306)
* gui * worked but slow * not do the auto detect * worked * remove debug thing * format * remove uneeded thing * fix hackrf submodule bump * clean up * format * format * format * remve batt * add hint text and eta * code clean up by @HTotoo * work around to resolve not clear enough * correct comments
This commit is contained in:
parent
7d28e495c2
commit
8e945024c5
8 changed files with 197 additions and 9 deletions
|
@ -85,7 +85,7 @@ static bool touch_update() {
|
|||
case IO::TouchPinsConfig::SensePressure: {
|
||||
const auto z1 = samples.xp - samples.xn;
|
||||
const auto z2 = samples.yp - samples.yn;
|
||||
const auto touch_raw = (z1 > touch::touch_threshold) || (z2 > touch::touch_threshold);
|
||||
const auto touch_raw = (z1 > portapack::touch_threshold) || (z2 > portapack::touch_threshold);
|
||||
touch_debounce = (touch_debounce << 1) | (touch_raw ? 1U : 0U);
|
||||
touch_detected = ((touch_debounce & touch_debounce_mask) == touch_debounce_mask);
|
||||
if (!touch_detected && !touch_cycle) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue