This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

os_mbx_wait get how long has sleep

Hello

How can I know how many ticks the os_mbx_wait function slept before the message has been received? So when the return code is OS_R_MBX, how can I calculate the wait period?

Regards

Parents
  • What is your reason for needing to know?

    I normally always design in an uptime counter in my applications, so I know how long since last reboot. It might be a two-level construct with one 32-bit counter keeping track of seconds and another keeping time in maybe 10ms resolution. Or I may peek at a running timer to get us or better resolution.

    With a two-level construct, you have to be a bit careful so you don't get a turn-over of the fast value in between sampling the two values.

Reply
  • What is your reason for needing to know?

    I normally always design in an uptime counter in my applications, so I know how long since last reboot. It might be a two-level construct with one 32-bit counter keeping track of seconds and another keeping time in maybe 10ms resolution. Or I may peek at a running timer to get us or better resolution.

    With a two-level construct, you have to be a bit careful so you don't get a turn-over of the fast value in between sampling the two values.

Children