From 55865c7962590fdead6796b8d256cac69bc4ac75 Mon Sep 17 00:00:00 2001 From: Luis Venancio Date: Fri, 27 Sep 2024 17:46:57 +0100 Subject: [PATCH] Sensors/Microstrain3DMGX3: Fix for writing calibration parameters to device. --- src/Sensors/Microstrain3DMGX3/Task.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Sensors/Microstrain3DMGX3/Task.cpp b/src/Sensors/Microstrain3DMGX3/Task.cpp index bad885abe1..25027f0670 100644 --- a/src/Sensors/Microstrain3DMGX3/Task.cpp +++ b/src/Sensors/Microstrain3DMGX3/Task.cpp @@ -308,6 +308,13 @@ namespace Sensors m_uart->setMinimumRead(max_data); } + bool + resetUart() + { + delete(m_uart); + return onConnect(); + } + void consume(const IMC::MagneticField* msg) { @@ -484,6 +491,7 @@ namespace Sensors setEntityState(IMC::EntityState::ESTA_NORMAL, Status::CODE_CALIBRATING); inf(DTR("resetting device")); poll(CMD_DEVICE_RESET, CMD_DEVICE_RESET_SIZE, 0, 0); + resetUart(); } } }