如题。
在一些外设的驱动程序中,需要延时的情况很常见。我主要是担心主进程会被 Task_Sleep() 阻塞,连蓝牙服务都会受到影响。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
会阻塞,查看下面的说明:
Name: Task_sleep
Prototype: Void Task_sleep( UInt32 nticks );
Description:
Delay execution of the current task
Task_sleep changes the current task's mode from Mode_RUNNING to Mode_BLOCKED, and delays its execution
for nticks increments of the system clock. The actual time delayed can be up to 1 system clock tick less than
nticks due to granularity in system timekeeping and the time elapsed per tick is determined by Clock_tickPeriod.