mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-19 19:42:32 +00:00
only ever emit the up/down action if we have actual messages stored
This commit is contained in:
parent
2ebaea317a
commit
4b7fbeca29
@ -144,15 +144,19 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
|||||||
|
|
||||||
bool validEvent = false;
|
bool validEvent = false;
|
||||||
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP)) {
|
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP)) {
|
||||||
|
if (this->messagesCount > 0) {
|
||||||
// LOG_DEBUG("Canned message event UP\n");
|
// LOG_DEBUG("Canned message event UP\n");
|
||||||
this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_UP;
|
this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_UP;
|
||||||
validEvent = true;
|
validEvent = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN)) {
|
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN)) {
|
||||||
|
if (this->messagesCount > 0) {
|
||||||
// LOG_DEBUG("Canned message event DOWN\n");
|
// LOG_DEBUG("Canned message event DOWN\n");
|
||||||
this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_DOWN;
|
this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_DOWN;
|
||||||
validEvent = true;
|
validEvent = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT)) {
|
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT)) {
|
||||||
LOG_DEBUG("Canned message event Select\n");
|
LOG_DEBUG("Canned message event Select\n");
|
||||||
// when inactive, call the onebutton shortpress instead. Activate Module only on up/down
|
// when inactive, call the onebutton shortpress instead. Activate Module only on up/down
|
||||||
|
Loading…
Reference in New Issue
Block a user