Watchdog Timers Calls
wd***()函数
WDOG_ID wdCreate (void) 创建一个看门狗定时器
返回值:如果成功则返回该看门狗定时器的ID, 否则返回ERROR。
wd***()函数
STATUS wdStart ( WDOG_ID wdId, int delay, FUNCPTR pRoutine, int parameter)
STATUS msgQSend ( MSG_Q_ID msgQId, char * buffer, UINT nBytes, int timeout, int priority)
发送一个消息到消息队列 msgQId :接收消息的队列ID buffer:待发送消息存放的缓存 nBytes:消息长度(字节) timeout:任务期望等待的tick数
将写全局和变量的代码作为临界区,使用互斥 机制进行保护。
Task Variables
任务间通信
共享数据结构 互斥机制 信号量 消息队列 管道 基于网络的任务间通信 信号
共享数据结构
Global variables Pointers Linear buffers Ring buffers Linked lists
抢占锁
Less restrictive form of mutual exclusion. 除ISR外,任务调度被禁止。 在调用taskLock()的函数离开临界区前,任何
其他任务都不能执行,除非该任务进入等待态。
信号量
VxWorks提供的最快速的任务间通信机制。 存在3类信号量:
- Binary - Mutual exclusion - Counting
A subroutine is reentrant if a single copy of the routine can be called from several task contexts simultaneously without conflict.