change chainbutton to index instead of color

This commit is contained in:
2020-12-25 13:28:49 +01:00
parent 4c9ee88508
commit 009903ec17
3 changed files with 36 additions and 23 deletions

View File

@@ -63,6 +63,19 @@ bool buttonIsPressed(e_ledcolor index)
}
}
bool buttonIsPressed(uint16_t index)
{
c_button *thisbutton = getButton(index);
if (thisbutton == NULL)
{
return false;
}
else
{
return thisbutton->isPressed();
}
}
bool buttonWasPressed(e_ledcolor index)
{
c_button *thisbutton = getButton(index);