kopia lustrzana https://github.com/meshtastic/firmware
Canned message bugfixes.
rodzic
772dfe39dc
commit
fbd5b8b721
|
@ -20,16 +20,19 @@ int CannedMessagePlugin::handleInputEvent(const InputEvent *event)
|
|||
bool validEvent = false;
|
||||
if (event->inputEvent == INPUT_EVENT_UP)
|
||||
{
|
||||
DEBUG_MSG("Canned message event UP\n");
|
||||
this->action = CANNED_MESSAGE_ACTION_UP;
|
||||
validEvent = true;
|
||||
}
|
||||
if (event->inputEvent == INPUT_EVENT_DOWN)
|
||||
{
|
||||
DEBUG_MSG("Canned message event DOWN\n");
|
||||
this->action = CANNED_MESSAGE_ACTION_DOWN;
|
||||
validEvent = true;
|
||||
}
|
||||
if (event->inputEvent == INPUT_EVENT_SELECT)
|
||||
{
|
||||
DEBUG_MSG("Canned message event Select\n");
|
||||
this->action = CANNED_MESSAGE_ACTION_SELECT;
|
||||
validEvent = true;
|
||||
}
|
||||
|
@ -63,6 +66,7 @@ void CannedMessagePlugin::sendText(NodeNum dest,
|
|||
|
||||
int32_t CannedMessagePlugin::runOnce()
|
||||
{
|
||||
DEBUG_MSG("Check status\n");
|
||||
if (this->sendingState == SENDING_STATE_ACTIVE)
|
||||
{
|
||||
// TODO: might have some feedback of sendig state
|
||||
|
|
|
@ -30,6 +30,8 @@ RotaryEncoderInterruptBase::RotaryEncoderInterruptBase(
|
|||
attachInterrupt(this->_pinB, onIntB, CHANGE);
|
||||
this->rotaryLevelA = digitalRead(this->_pinA);
|
||||
this->rotaryLevelB = digitalRead(this->_pinB);
|
||||
DEBUG_MSG("Rotary initialized (%d, %d, %d)\n",
|
||||
this->_pinA, this->_pinB, pinPress);
|
||||
}
|
||||
|
||||
int32_t RotaryEncoderInterruptBase::runOnce()
|
||||
|
@ -42,12 +44,14 @@ int32_t RotaryEncoderInterruptBase::runOnce()
|
|||
}
|
||||
else if (this->action == ROTARY_ACTION_CW)
|
||||
{
|
||||
DEBUG_MSG("Rotary event CW\n");
|
||||
InputEvent e;
|
||||
e.inputEvent = this->_eventCw;
|
||||
this->notifyObservers(&e);
|
||||
}
|
||||
else if (this->action == ROTARY_ACTION_CCW)
|
||||
{
|
||||
DEBUG_MSG("Rotary event CW\n");
|
||||
InputEvent e;
|
||||
e.inputEvent = this->_eventCcw;
|
||||
this->notifyObservers(&e);
|
||||
|
@ -90,9 +94,10 @@ void RotaryEncoderInterruptBase::intAHandler()
|
|||
{
|
||||
this->rotaryStateCCW = ROTARY_EVENT_OCCURRED;
|
||||
if ((this->action == ROTARY_ACTION_NONE)
|
||||
|| (this->action == ROTARY_ACTION_CCW))
|
||||
|| (this->action == ROTARY_ACTION_CW))
|
||||
{
|
||||
this->action = ROTARY_ACTION_CW;
|
||||
this->action = ROTARY_ACTION_CCW;
|
||||
DEBUG_MSG("Rotary action CCW\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -124,6 +129,7 @@ void RotaryEncoderInterruptBase::intBHandler()
|
|||
|| (this->action == ROTARY_ACTION_CCW))
|
||||
{
|
||||
this->action = ROTARY_ACTION_CW;
|
||||
DEBUG_MSG("Rotary action CW\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,18 +13,17 @@ RotaryEncoderInterruptImpl1::RotaryEncoderInterruptImpl1(
|
|||
RotaryEncoderInterruptImpl1::handleIntB,
|
||||
RotaryEncoderInterruptImpl1::handleIntPressed)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RotaryEncoderInterruptImpl1::handleIntA()
|
||||
{
|
||||
|
||||
rotaryEncoderInterruptImpl1->intAHandler();
|
||||
}
|
||||
void RotaryEncoderInterruptImpl1::handleIntB()
|
||||
{
|
||||
|
||||
rotaryEncoderInterruptImpl1->intBHandler();
|
||||
}
|
||||
void RotaryEncoderInterruptImpl1::handleIntPressed()
|
||||
{
|
||||
|
||||
rotaryEncoderInterruptImpl1->intPressHandler();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue