Bug in cmsis_os layer

Report here problems in any of ChibiOS components. This forum is NOT for support.
josesimoes
Posts: 57
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 22 times
Been thanked: 14 times

Bug in cmsis_os layer

Postby josesimoes » Thu Aug 09, 2018 6:11 pm

In osMessageGet() the code setting the sysinterval_t timeout can't handle a TIME_IMIDIATE situation as it wrongly sets it to TIME_INFINITE if millisec is zero.
Suggest this fix @ line 525:

Code: Select all

  sysinterval_t timeout = (millisec == osWaitForever ?
                          TIME_INFINITE : (millisec == 0 ? 0 : TIME_MS2I(millisec)));

User avatar
FXCoder
Posts: 98
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 23 times
Been thanked: 22 times

Re: Bug in cmsis_os layer

Postby FXCoder » Sun Aug 12, 2018 7:29 am

The same bug is in osMessagePut(...), osSemaphoreWait(...), osSignalWait(...), osMutexWait(...) and osSignalWait(...)

Probably should use TIME_IMMEDIATE in fix rather than 0 for consistency with ChibiOS definitions...
sysinterval_t timeout = (millisec == osWaitForever ?
TIME_INFINITE : (millisec == 0 ? TIME_IMMEDIATE : TIME_MS2I(millisec)));


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest