T-Kernel 里有类似于 msleep() 的函数。

tk_slp_tsk ( TMO tmout ) ;

• TMO: Timeout time Time base 1 millisecond, 32-bit or higher signed integer (INT)

typedef INT TMO;

这里tk_slp_tsk可以指定tmout的值,表示睡眠的时间,单位是毫秒。

如果指定-1的话,必须有其他任务来唤醒该睡眠任务。

T-Kernel 里 sleep API_html

另外,下面函数也可以等待,但是是忙等。

参考:

http://www.t-engine.org/wp-content/themes/wp.vicuna/pdf/specifications/en_US/TEF020-S001-01.00.01_en.pdf

5.5.2    Micro wait
 - void WaitUsec( UINT usec )
    - void WaitNsec( UINT nsec )
        - usec   Wait time (microseconds)
        - nsec   Wait time (nanoseconds)
      Performs a micro wait for the specified interval.
      These waits occur in an ordinary busy loop, and as such are easily influenced by the runtime
      environment, such as execution in RAM, execution in ROM, memory cache on or off, etc. These
      wait times are therefore not very accurate.
      These waits are not the same as an OS WAIT state. The system state remains as RUN state.

相关的头文件参考:

tk/syslib.h

参考:http://monoist.atmarkit.co.jp/mn/articles/0608/08/news102_3.html