Skip to content

Commit

Permalink
fix: read once per update hook
Browse files Browse the repository at this point in the history
if cmd_in frequency is higher than communication frequency this can result
in an endless update hook
  • Loading branch information
wvmcastro committed Dec 17, 2024
1 parent 9b57973 commit 03b1e79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 03b1e79

Please sign in to comment.