Bug in cmsis_os layer Topic is solved

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

Bug in cmsis_os layer  Topic is solved

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: 135
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 37 times
Been thanked: 36 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)));

User avatar
Giovanni
Site Admin
Posts: 11385
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 430 times
Been thanked: 362 times
Contact:

Re: Bug in cmsis_os layer

Postby Giovanni » Sun Aug 26, 2018 9:18 am

Hi,

Fixed as bug #975.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest