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

Query about K_TMO

Hi

I am using Rtxtiny-51 & stuck in problem regarding K_TMO.

I used following code with INT_CLOCK=10000, TIMESHARING=1

job0 () _task_ 0 {

while (1) { /* endless loop */

while(counter0<0x50) // 5 ms loop

counter0++;

os_wait (K_TMO, 1, 0); /* wait for timeout: 5 ticks */

counter0=0; //make counter0=0 again }
}

According to defination when I use os_wait(K_TMO), control should come back after 10 ms. However it also counts 5 ms loop( in which conter0 is incremented) & control return back after 5ms to make counter0=0.

Again if I change 5ms loop to 6ms then agter os_wait control come back after 4ms to make counter0=0.

0