t-watch-fix: Fully insulate T-Watch free text updates from other hardware platforms

This commit is contained in:
Andrew Moroz 2024-05-24 00:02:03 -04:00
parent 2f9dc813d3
commit 1d288414a5

View File

@ -75,9 +75,11 @@ int CannedMessageModule::splitConfiguredMessages()
String messages = cannedMessageModuleConfig.messages;
#ifdef T_WATCH_S3
String separator = messages.length() ? "|" : "";
messages = "[---- Free Text ----]" + separator + messages;
#endif
// collect all the message parts
strncpy(this->messageStore, messages.c_str(), sizeof(this->messageStore));
@ -141,6 +143,8 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
}
}
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT)) {
#ifdef T_WATCH_S3
if (this->currentMessageIndex == 0) {
this->runState = CANNED_MESSAGE_RUN_STATE_FREETEXT;
@ -150,6 +154,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
return 0;
}
#endif
// 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)) {