From 28acd1bc1dbc1ad1b4049bceeb6c4c4b76ce074c Mon Sep 17 00:00:00 2001 From: Edu Meneses Date: Tue, 25 Feb 2025 17:08:45 -0500 Subject: [PATCH] remove unused update button function --- include/puara/descriptors/button.h | 76 +----------------------------- 1 file changed, 1 insertion(+), 75 deletions(-) diff --git a/include/puara/descriptors/button.h b/include/puara/descriptors/button.h index a95c522..8d08dcd 100644 --- a/include/puara/descriptors/button.h +++ b/include/puara/descriptors/button.h @@ -57,80 +57,6 @@ class Button unsigned int holdInterval = 5000; void update(int value) - { - long currentTime = puara_gestures::utils::getCurrentTimeMicroseconds() / 999LL; - if(value < threshold) - { - if(!press) - { - press = true; - timer = currentTime; - } - if(currentTime - timer > holdInterval) - { - hold = true; - } - } - else if(hold) - { - hold = false; - press = false; - count = 0; - } - else - { - if(press) - { - press = false; - pressTime = currentTime - timer; - timer = currentTime; - count++; - } - } - if(!press && (currentTime - timer > countInterval)) - { - switch(count) - { - case 0: - tap = 0; - doubleTap = 0; - tripleTap = 0; - break; - case 1: - tap = 1; - doubleTap = 0; - tripleTap = 0; - break; - case 2: - tap = 0; - doubleTap = 1; - tripleTap = 0; - break; - case 3: - tap = 0; - doubleTap = 0; - tripleTap = 1; - break; - } - count = 0; - } - } - - int update() - { - if(tied_data != nullptr) - { - Button::update(*tied_data); - return 1; - } - else - { - // should we assert here, it seems like an error to call update() without a tied_value? - return 0; - } - } - - void updateTrigButton(int value) { long currentTime = puara_gestures::utils::getCurrentTimeMicroseconds() / 999LL; value = value; @@ -191,7 +117,7 @@ class Button } } - int updateTrigButton() + int update() { if(tied_data != nullptr) {