Skip to main content
Visitor II
August 16, 2020
Question

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

  • August 16, 2020
  • 1 reply
  • 619 views

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;

  }

 }

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    August 17, 2020

    Hi @AWood.1​ ,

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

    -Amel