队列创建成功与否的判断
在freertos源码中:发现创建队列的例子中,是这样来判断有没有创建成功。
if( xQueue1 == 0 ){
// Queue was not created and must not be used.
}
而在其他,比如信号量创建是这样判断的:
if( xSemaphore != NULL )
{
// The semaphore was created successfully.
// The semaphore can now be used.
}
也看硬汉的代码中队列也是按照源码的方式来判断的。在C 中 NULL 与0 两者是等价的。那么源码中这么判断的区别是什么?
一样。
页:
[1]