Some fixes

This commit is contained in:
jpirnay
2026-04-27 13:52:55 +02:00
parent e1d623bd9c
commit adc0a52af1
10 changed files with 236 additions and 90 deletions
+11 -1
View File
@@ -16,6 +16,7 @@
#include <esp_ota_ops.h>
#include <cstring>
#include <vector>
#include "ButtonEventManager.h"
#include "CrossPointSettings.h"
@@ -388,6 +389,8 @@ void loop() {
using BA = CrossPointSettings::BUTTON_ACTION;
using B = MappedInputManager::Button;
ButtonEventManager::ButtonEvent ev;
std::vector<ButtonEventManager::ButtonEvent> defaultEvents;
defaultEvents.reserve(8);
while (buttonEventManager.consumeEvent(ev)) {
auto actionFor = [&](B btn) -> uint8_t {
switch (btn) {
@@ -468,7 +471,10 @@ void loop() {
};
const uint8_t action = actionFor(ev.button);
if (action == BA::BTN_DEFAULT) continue;
if (action == BA::BTN_DEFAULT) {
defaultEvents.push_back(ev);
continue;
}
switch (static_cast<BA>(action)) {
case BA::BTN_PAGE_FORWARD:
@@ -525,6 +531,10 @@ void loop() {
break;
}
}
for (auto it = defaultEvents.rbegin(); it != defaultEvents.rend(); ++it) {
buttonEventManager.pushEventFront(it->button, it->type);
}
}
const unsigned long activityStartTime = millis();