910-FreeRTOS202212 ‐ ulTaskNotifyValueClear() 与 ulTaskNotifyValueClearIndexed()





#define ulTaskNotifyValueClear( xTask, ulBitsToClear ) \
	ulTaskGenericNotifyValueClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulBitsToClear ) )

#define ulTaskNotifyValueClearIndexed( xTask, uxIndexToClear, ulBitsToClear ) \
	ulTaskGenericNotifyValueClear( ( xTask ), ( uxIndexToClear ), ( ulBitsToClear ) )

/*-----------------------------------------------------------*/

#if ( configUSE_TASK_NOTIFICATIONS == 1 )

	uint32_t ulTaskGenericNotifyValueClear( 	TaskHandle_t 	xTask,			/* 要通知的任务的句柄 */
                                            	UBaseType_t 	uxIndexToClear,	/* 任务通知数组的索引值(任务通知相关数组下标) */
                                            	uint32_t 	ulBitsToClear )	/* 要在 xTask 的通知值中清除的位的位掩码 */
    	{
    		TCB_t * pxTCB;
        	uint32_t ulReturn;

        	/* If null is passed in here then it is the calling task that is having its notification state cleared. */
		/*如果在这里传递了null,那么它是正在清除通知状态的调用任务*/
        	pxTCB = prvGetTCBFromHandle( xTask );

        	taskENTER_CRITICAL();
        	{
            		/* Return the notification as it was before the bits were cleared, then clear the bit mask. */
			/*按清除位之前的状态返回通知,然后清除位掩码*/
            		ulReturn = pxTCB->ulNotifiedValue[ uxIndexToClear ];
            		pxTCB->ulNotifiedValue[ uxIndexToClear ] &= ~ulBitsToClear;
        	}
        	taskEXIT_CRITICAL();

        	return ulReturn;
    	}

#endif /* configUSE_TASK_NOTIFICATIONS */

  • 9
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值