任務通知

任務通知
configUSE_TASK_NOTIFICATIONS=1//開啓
ulNotifiedValue
任務通知只有一個任務
接收任務會進入阻塞,發送任務不會因發送失敗而進入阻塞
發送任務通知
xTaskNotify()//ulValue
xTaskNotifyGive()//xTaskToNotify The handle of the task being notified
xTaskNotifyAndQuery()//pulPreviousNotificationValue被修改前的值

ulTaskNotifyTake()//獲取任務通知
xClearCountOnExit=pdFALSE,通知值減1
xClearCountOnExit!=pdFALSE通知值爲0
xTicksToWait;在阻塞態的最大時間,任務通知值大於0
xTaskNotifyWait()//獲取
ulBitsToClearOnEntry:任務檢查是否通知被掛起,在調用任務的通知值,bits會清除,
設置爲ULONG_MAX,置通知值爲0
設置爲0,通知值不變
ulBitsToClearOnExit:
當函數退出時
設置爲ULONG_MAX,置通知值爲0
設置爲0,通知值不變
pulNotificationValue:
xTicksToWait//阻塞時間

typedef enum
{
	eNoAction = 0,				/* Notify the task without updating its notify value. */
	eSetBits,					/* Set bits in the task's notification value. */
	eIncrement,					/* Increment the task's notification value. */
	eSetValueWithOverwrite,		/* Set the task's notification value to a specific value even if the previous value has not yet been read by the task. */
	eSetValueWithoutOverwrite	/* Set the task's notification value if the previous value has been read by the task. */
} eNotifyAction;

#define taskNOT_WAITING_NOTIFICATION	( ( uint8_t ) 0 )
#define taskWAITING_NOTIFICATION		( ( uint8_t ) 1 )
#define taskNOTIFICATION_RECEIVED		( ( uint8_t ) 2 )

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章