From 03b1e799ea39028b38e802c595ec54f6ca05e2a4 Mon Sep 17 00:00:00 2001 From: Wellington Castro Date: Tue, 17 Dec 2024 13:49:08 -0300 Subject: [PATCH] fix: read once per update hook if cmd_in frequency is higher than communication frequency this can result in an endless update hook --- tasks/Task.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/Task.cpp b/tasks/Task.cpp index 70cc056..3ca4c61 100644 --- a/tasks/Task.cpp +++ b/tasks/Task.cpp @@ -161,7 +161,7 @@ void Task::publishFault() } void Task::updateHook() { - while (_cmd_in.read(m_cmd_in) == RTT::NewData) { + if (_cmd_in.read(m_cmd_in) == RTT::NewData) { if (m_cmd_in.elements.size() != 1) { return exception(INVALID_COMMAND_SIZE); }