Resolve Conflicts between PIN_BUtton and the Rotary Select and keep screen powered during plugin operation. Forward Port from 1.2 firmware fix.

This commit is contained in:
Thomas Göttgens
2022-03-25 12:27:14 +01:00
parent 8bfe277269
commit e320850707
6 changed files with 24 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
#include "configuration.h"
#include "CannedMessageModule.h"
#include "PowerFSM.h" // neede for button bypass
#include "MeshService.h"
#include "FSCommon.h"
#include "mesh/generated/cannedmessages.pb.h"
@@ -140,8 +141,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
if (event->inputEvent == static_cast<char>(InputEventChar_KEY_SELECT))
{
DEBUG_MSG("Canned message event Select\n");
this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT;
validEvent = true;
// when inactive, call the onebutton shortpress instead. Activate Module only on up/down
if ((this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED)) {
powerFSM.trigger(EVENT_PRESS);
}else{
this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT;
validEvent = true;
}
}
if (validEvent)