Fixed button hold handling

This commit is contained in:
2022-09-08 22:27:47 +02:00
parent a7242a4a7d
commit 61fddd0724
8 changed files with 15 additions and 3 deletions

View File

@ -110,6 +110,7 @@ void buttonReleasedCommon(espgui::Button button)
void BobbyButtons::rawButtonPressed(uint8_t button)
{
ESP_LOGI(TAG, "%hhu", button);
//Base::rawButtonPressed(button);
if (const auto translated = translateRawButton(button))
buttonPressed(*translated);
@ -117,6 +118,7 @@ void BobbyButtons::rawButtonPressed(uint8_t button)
void BobbyButtons::rawButtonReleased(uint8_t button)
{
ESP_LOGI(TAG, "%hhu", button);
//Base::rawButtonReleased(button);
if (const auto translated = translateRawButton(button))
buttonReleased(*translated);

View File

@ -48,5 +48,6 @@ void BobbyChangeValueDisplay<Tvalue>::buttonPressed(espgui::Button button)
template<typename Tvalue>
void BobbyChangeValueDisplay<Tvalue>::buttonReleased(espgui::Button button)
{
//Base::buttonReleased(button);
Base::buttonReleased(button);
buttonReleasedCommon(button);
}

View File

@ -26,4 +26,5 @@ void BobbyDisplayWithTitle::buttonPressed(espgui::Button button)
void BobbyDisplayWithTitle::buttonReleased(espgui::Button button)
{
//Base::buttonReleased(button);
buttonReleasedCommon(button);
}

View File

@ -38,7 +38,7 @@ void BobbyGraphDisplay<COUNT>::rawButtonReleased(uint8_t button)
template<size_t COUNT>
void BobbyGraphDisplay<COUNT>::buttonPressed(espgui::Button button)
{
Base::buttonPressed(button);
//Base::buttonPressed(button);
buttonPressedCommon(button);
}
@ -46,4 +46,5 @@ template<size_t COUNT>
void BobbyGraphDisplay<COUNT>::buttonReleased(espgui::Button button)
{
//Base::buttonReleased(button);
buttonReleasedCommon(button);
}

View File

@ -26,6 +26,6 @@ void BobbyMenuDisplay::buttonPressed(espgui::Button button)
void BobbyMenuDisplay::buttonReleased(espgui::Button button)
{
//Base::buttonReleased(button);
Base::buttonReleased(button);
buttonReleasedCommon(button);
}

View File

@ -26,4 +26,5 @@ void BobbyPopupDisplay::buttonPressed(espgui::Button button)
void BobbyPopupDisplay::buttonReleased(espgui::Button button)
{
//Base::buttonReleased(button);
buttonReleasedCommon(button);
}

View File

@ -46,5 +46,6 @@ template<std::size_t COUNT0, std::size_t COUNT1>
void BobbySplitGraphDisplay<COUNT0, COUNT1>::buttonReleased(espgui::Button button)
{
//Base::buttonReleased(button);
buttonReleasedCommon(button);
}

View File

@ -3,6 +3,9 @@
// system includes
#include <array>
// esp-idf includes
#include <esp_log.h>
// Arduino includes
#include <esp32-hal-gpio.h>
#include <esp32-hal-misc.h>
@ -19,6 +22,8 @@
#include "bobbybuttons.h"
namespace {
static const constexpr char TAG[] = "DPAD";
template<pin_t OUT, pin_t IN1, pin_t IN2, pin_t IN3, pin_t IN4>
class Helper
{