TI中文支持网
TI专业的中文技术问题搜集分享网站

TI-RTOS问题

由于以前没对TI-RTOS进行过深入研究,为了更清晰一些,现在想到了几个问题应该都比较简单:

1.TI-RTOS的任务是时间片来执行的吧?

2.当任务都处于阻塞时,会运行一个空闲任务?

3.如果一个低优先级任务正在运行,此时一个高优先级任务已经准备好,那么会产生抢占吗?

YiKai Chen:

參考一下 training.ti.com/ti-rtos-workshop-series-1-10-welcome

Alvin Chen:

Task_yield() – this is used to give up execution to another Task AT THE SAME PRIORITY. If
you had four Tasks at priority 3, named Task A-D, Task A could yield to Task B and Task B could
yield to Task C, etc., thus creating a “round-robin” execution between Tasks at the same priority.

static1.squarespace.com/…/MA_TIRTOS_Kernel_Workshop_Student_Guide_Rev3.2.pdf

user4959119:

回复 Alvin Chen:

给力的,意思是在运行过程当前任务可以创建另一个任务,根据条件还可以删除任务是吧。如果我有个主任务A,在A任务里创建了RF收发任务B,如果此时删除任务B,那么RF内核里的指令会随之删除吗,还是得自己清除?

Alvin Chen:

回复 user4959119:

yield不会删除是让出控制权,如果你主任务(最高优先级)创建了RF收发任务,当你想打断主任务时使用Task_yield() 会让权给RF Task。 想要删除一个Task或者销毁使用: Void Task_delete(Task_Handle *handleP); // Finalize and free this previously allocated instance object, setting the referenced handle to NULL Void Task_destruct(Task_Struct *structP); // Finalize the instance object inside the provided structure

Task_yield() 只能在同等优先级使用。当其他任务抢占后,会重新回到原来的task

Task_yield() will only yield to tasks of the same priority as the task that called Task_yield(). If there are no other tasks at the same priority, then the task that called Task_yield() will continue running again.Lower priority tasks that are ready to run are NOT allowed to run when Task_yield() is called from a higher priority task.And, by definition, if a higher priority task is ready to run, then it IS running (unless task scheduling has been disabled).

user4959119:

回复 Alvin Chen:

Task_yield()后主任务就不再执行了吗?

Alvin Chen:

回复 user4959119:

已更新上面回复。具体还是以我贴出来那个user guide 为准。

user4959119:

回复 Alvin Chen:

如果有多个同优先级的任务,不用Task_yield()其他任务还执行不了了?

user4959119:

回复 user4959119:

Alvin Chen:

回复 user4959119:

相同优先级Task之间,假如一个task 忙碌,同等优先级无法打断。

user4959119:

回复 Alvin Chen:

恩,目前我想实现这样的功能:用两个引脚来切换模块的4种工作模式

帮忙看看用咱们的模块好实现吗?在任务安排和引脚配置方面。

赞(0)
未经允许不得转载:TI中文支持网 » TI-RTOS问题
分享到: 更多 (0)