mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-21 12:38:34 +00:00
All Canned All the time
This commit is contained in:
parent
4317d477b9
commit
c67a0103ab
@ -243,15 +243,9 @@ void ExpressLRSFiveWay::shutdown()
|
|||||||
shutdownAtMsec = millis() + 3000;
|
shutdownAtMsec = millis() + 3000;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emulate user button, or canned message SELECT
|
|
||||||
// This is necessary as canned message module doesn't translate SELECT to user button presses if the module is disabled
|
|
||||||
// Contained as one method for easier remapping of buttons by user
|
|
||||||
void ExpressLRSFiveWay::click()
|
void ExpressLRSFiveWay::click()
|
||||||
{
|
{
|
||||||
if (!moduleConfig.canned_message.enabled)
|
sendKey(INPUT_BROKER_SELECT);
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
|
||||||
else
|
|
||||||
sendKey(INPUT_BROKER_SELECT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpressLRSFiveWay *expressLRSFiveWayInput = nullptr;
|
ExpressLRSFiveWay *expressLRSFiveWayInput = nullptr;
|
||||||
|
@ -793,7 +793,6 @@ void NodeDB::installDefaultModuleConfig()
|
|||||||
moduleConfig.external_notification.nag_timeout = 60;
|
moduleConfig.external_notification.nag_timeout = 60;
|
||||||
#endif
|
#endif
|
||||||
moduleConfig.has_canned_message = true;
|
moduleConfig.has_canned_message = true;
|
||||||
moduleConfig.canned_message.enabled = true;
|
|
||||||
#if USERPREFS_MQTT_ENABLED && !MESHTASTIC_EXCLUDE_MQTT
|
#if USERPREFS_MQTT_ENABLED && !MESHTASTIC_EXCLUDE_MQTT
|
||||||
moduleConfig.mqtt.enabled = true;
|
moduleConfig.mqtt.enabled = true;
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,20 +48,15 @@ CannedMessageModule *cannedMessageModule;
|
|||||||
CannedMessageModule::CannedMessageModule()
|
CannedMessageModule::CannedMessageModule()
|
||||||
: SinglePortModule("canned", meshtastic_PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("CannedMessage")
|
: SinglePortModule("canned", meshtastic_PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("CannedMessage")
|
||||||
{
|
{
|
||||||
if (moduleConfig.canned_message.enabled || CANNED_MESSAGE_MODULE_ENABLE) {
|
this->loadProtoForModule();
|
||||||
this->loadProtoForModule();
|
if ((this->splitConfiguredMessages() <= 0) && (cardkb_found.address == 0x00) && !INPUTBROKER_MATRIX_TYPE &&
|
||||||
if ((this->splitConfiguredMessages() <= 0) && (cardkb_found.address == 0x00) && !INPUTBROKER_MATRIX_TYPE &&
|
!CANNED_MESSAGE_MODULE_ENABLE) {
|
||||||
!CANNED_MESSAGE_MODULE_ENABLE) {
|
LOG_INFO("CannedMessageModule: No messages are configured. Module is disabled");
|
||||||
LOG_INFO("CannedMessageModule: No messages are configured. Module is disabled");
|
|
||||||
this->runState = CANNED_MESSAGE_RUN_STATE_DISABLED;
|
|
||||||
disable();
|
|
||||||
} else {
|
|
||||||
LOG_INFO("CannedMessageModule is enabled");
|
|
||||||
this->inputObserver.observe(inputBroker);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this->runState = CANNED_MESSAGE_RUN_STATE_DISABLED;
|
this->runState = CANNED_MESSAGE_RUN_STATE_DISABLED;
|
||||||
disable();
|
disable();
|
||||||
|
} else {
|
||||||
|
LOG_INFO("CannedMessageModule is enabled");
|
||||||
|
this->inputObserver.observe(inputBroker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static bool returnToCannedList = false;
|
static bool returnToCannedList = false;
|
||||||
@ -832,8 +827,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Normal module disable/idle handling
|
// Normal module disable/idle handling
|
||||||
if (((!moduleConfig.canned_message.enabled) && !CANNED_MESSAGE_MODULE_ENABLE) ||
|
if ((this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) || (this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE)) {
|
||||||
(this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) || (this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE)) {
|
|
||||||
temporaryMessage = "";
|
temporaryMessage = "";
|
||||||
return INT32_MAX;
|
return INT32_MAX;
|
||||||
}
|
}
|
||||||
@ -1020,9 +1014,6 @@ const char *CannedMessageModule::getNodeName(NodeNum node)
|
|||||||
|
|
||||||
bool CannedMessageModule::shouldDraw()
|
bool CannedMessageModule::shouldDraw()
|
||||||
{
|
{
|
||||||
if (!moduleConfig.canned_message.enabled && !CANNED_MESSAGE_MODULE_ENABLE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (currentMessageIndex != -1) || (this->runState != CANNED_MESSAGE_RUN_STATE_INACTIVE);
|
return (currentMessageIndex != -1) || (this->runState != CANNED_MESSAGE_RUN_STATE_INACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user