Fix rotary glitch.

This commit is contained in:
Balazs Kelemen 2022-01-05 15:52:08 +01:00
parent b3ddf16d64
commit 6eb2b33124

View File

@ -74,8 +74,7 @@ int32_t CannedMessagePlugin::runOnce()
&& (this->currentMessageIndex == -1)) && (this->currentMessageIndex == -1))
{ {
this->currentMessageIndex = 0; this->currentMessageIndex = 0;
DEBUG_MSG("First touch. Current message:%s\n", DEBUG_MSG("First touch.\n");
this->getCurrentMessage());
} }
else if (this->action == ACTION_PRESSED) else if (this->action == ACTION_PRESSED)
{ {
@ -90,14 +89,14 @@ int32_t CannedMessagePlugin::runOnce()
else if (this->action == ACTION_UP) else if (this->action == ACTION_UP)
{ {
this->currentMessageIndex = getPrevIndex(); this->currentMessageIndex = getPrevIndex();
DEBUG_MSG("MOVE UP. Current message:%s\n", DEBUG_MSG("MOVE UP. Current message:%ld\n",
this->getCurrentMessage()); millis());
} }
else if (this->action == ACTION_DOWN) else if (this->action == ACTION_DOWN)
{ {
this->currentMessageIndex = this->getNextIndex(); this->currentMessageIndex = this->getNextIndex();
DEBUG_MSG("MOVE DOWN. Current message:%s\n", DEBUG_MSG("MOVE DOWN. Current message:%ld\n",
this->getCurrentMessage()); millis());
} }
if (this->action != ACTION_NONE) if (this->action != ACTION_NONE)
{ {
@ -111,6 +110,7 @@ int32_t CannedMessagePlugin::runOnce()
void CannedMessagePlugin::select() void CannedMessagePlugin::select()
{ {
this->action = ACTION_PRESSED; this->action = ACTION_PRESSED;
runned(millis());
setInterval(20); setInterval(20);
} }
@ -152,7 +152,8 @@ void CannedMessagePlugin::directionA()
this->rotaryStateCCW = EVENT_CLEARED; this->rotaryStateCCW = EVENT_CLEARED;
} }
#endif #endif
setInterval(30); runned(millis());
setInterval(50);
} }
void CannedMessagePlugin::directionB() void CannedMessagePlugin::directionB()
@ -184,5 +185,6 @@ void CannedMessagePlugin::directionB()
this->rotaryStateCW = EVENT_CLEARED; this->rotaryStateCW = EVENT_CLEARED;
} }
#endif #endif
setInterval(30); runned(millis());
setInterval(50);
} }