Merge pull request #3966 from andrew-moroz/t-watch-fix

t-watch-fix: Fully insulate T-Watch free text updates from other hardware platforms
This commit is contained in:
Thomas Göttgens 2024-05-24 08:57:37 +02:00 committed by GitHub
commit 9a38a4b024
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)) {