Skip to content

Commit

Permalink
remove unused update button function
Browse files Browse the repository at this point in the history
  • Loading branch information
edumeneses committed Feb 25, 2025
1 parent 6ca931a commit 28acd1b
Showing 1 changed file with 1 addition and 75 deletions.
76 changes: 1 addition & 75 deletions include/puara/descriptors/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -191,7 +117,7 @@ class Button
}
}

int updateTrigButton()
int update()
{
if(tied_data != nullptr)
{
Expand Down

0 comments on commit 28acd1b

Please sign in to comment.