ARM Technical Support Knowledge Articles

OS_WAIT DOESN'T DELAY FOR SPECIFIED TIME

Applies to: RTX51 Real-time Kernel

Answer

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.

Article last edited on: 2004-06-07 09:09:30

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential