From 73ae151971b39d7fa1611e6b38188ce20e423dba Mon Sep 17 00:00:00 2001 From: Jm Date: Sat, 16 Jan 2021 22:39:28 -0800 Subject: [PATCH] Added serialplugin_timeout to SerialPlugin --- src/plugins/SerialPlugin.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/SerialPlugin.cpp b/src/plugins/SerialPlugin.cpp index bded71c75..236b29f94 100644 --- a/src/plugins/SerialPlugin.cpp +++ b/src/plugins/SerialPlugin.cpp @@ -80,7 +80,15 @@ int32_t SerialPlugin::runOnce() } else { Serial2.begin(SERIALPLUGIN_BAUD, SERIAL_8N1, RXD2, TXD2); } - Serial2.setTimeout(SERIALPLUGIN_TIMEOUT); // Number of MS to wait to set the timeout for the string. + + if (radioConfig.preferences.serialplugin_timeout) { + Serial2.setTimeout( + radioConfig.preferences.serialplugin_timeout); // Number of MS to wait to set the timeout for the string. + + } else { + Serial2.setTimeout(SERIALPLUGIN_TIMEOUT); // Number of MS to wait to set the timeout for the string. + } + Serial2.setRxBufferSize(SERIALPLUGIN_RX_BUFFER); serialPluginRadio = new SerialPluginRadio();