mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-30 02:15:41 +00:00
Guard serial module
This commit is contained in:
parent
3328a84856
commit
685a478797
@ -43,7 +43,10 @@
|
|||||||
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||||
#include "motion/AccelerometerThread.h"
|
#include "motion/AccelerometerThread.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \
|
||||||
|
!defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||||
#include "SerialModule.h"
|
#include "SerialModule.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
AdminModule *adminModule;
|
AdminModule *adminModule;
|
||||||
bool hasOpenEditTransaction;
|
bool hasOpenEditTransaction;
|
||||||
@ -833,11 +836,14 @@ bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
|||||||
break;
|
break;
|
||||||
case meshtastic_ModuleConfig_serial_tag:
|
case meshtastic_ModuleConfig_serial_tag:
|
||||||
LOG_INFO("Set module config: Serial");
|
LOG_INFO("Set module config: Serial");
|
||||||
|
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52) || defined(ARCH_RP2040)) && !defined(CONFIG_IDF_TARGET_ESP32S2) && \
|
||||||
|
!defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||||
if (!SerialModule::isValidConfig(c.payload_variant.serial)) {
|
if (!SerialModule::isValidConfig(c.payload_variant.serial)) {
|
||||||
LOG_ERROR("Invalid serial config");
|
LOG_ERROR("Invalid serial config");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
disableBluetooth(); // Disable Bluetooth to prevent interference during Serial configuration
|
disableBluetooth(); // Disable Bluetooth to prevent interference during Serial configuration
|
||||||
|
#endif
|
||||||
moduleConfig.has_serial = true;
|
moduleConfig.has_serial = true;
|
||||||
moduleConfig.serial = c.payload_variant.serial;
|
moduleConfig.serial = c.payload_variant.serial;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user