cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: cmsis_os.c The implementation of osMessagePut() does not agree with description

AWood.1
Associate

The comments for osMessagePut() match osMessageGet() and note that

* @param millisec timeout value or 0 in case of no time-out.

However

osMessagePut() does not return immediately when millisec ==0. The code that is in osMessageGet() to handle this case is missing from osMessagePut()

Suggest replacing:

 ticks = millisec / portTICK_PERIOD_MS;

 if (ticks == 0) {

  ticks = 1;

 }

with same code as the Get():

ticks = 0;

 if (millisec == osWaitForever) {

   ticks = portMAX_DELAY;

 }

 else if (millisec != 0) {

  ticks = millisec / portTICK_PERIOD_MS;

  if (ticks == 0) {

   ticks = 1;

  }

 }

1 REPLY 1
Amel NASRI
ST Employee

Hi @AWood.1​ ,

Thanks for sharing your proposal, I submitted your request to our development team for farther checks.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.