Skip to main content
Associate III
November 11, 2023
Question

Issue using osThreadFlagsWait() function

Trying to use osThreadFlagsWait() in my command handler for command processing thread to save CPU utilization and seeing issue where system gets stall.
====================
while (1) {
  int cnt = getcmd();
  if (cnt >= 0) {
    process_command();
  } else {
    osThreadFlagsWait(0, osFlagsWaitAny, DELAY_TASK_10MS_TICKS);
  }
}
====================
without using osThreadFlagsWait() command line processing is ok, when osThreadFlagsWait() used to save CPU utilization system gets stalled.

@Tesla DeLorean 
I was wondering if there is anything special which needed to be taken care while using this function.

Thanks in advance for your support!

This topic has been closed for replies.