Keil Logo

RTX51: OS_WAIT DOESN'T DELAY FOR SPECIFIED TIME

QUESTION

I call an os_wait library routine as follows:

os_wait (K_TMO, 1000, NULL);

but it returns before the specified number of ticks have elapsed. What's going on?

ANSWER

The problem is that the 1000 is being implicitly cast to an 8-bit value. If you need to delay more than 255 ticks, you must use multiple calls to os_wait. You should replace your above code with the following:

os_wait (K_TMO, 250, NULL);
os_wait (K_TMO, 250, NULL);
os_wait (K_TMO, 250, NULL);
os_wait (K_TMO, 250, NULL);

This delays the task for 1000 ticks.

Last Reviewed: Monday, June 7, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.