使用计数型信号量设计
2,相关函数的API
一、队列:文章来源:https://www.toymoban.com/news/detail-798630.html
osMessageQueueId_t osMessageQueueNew (uint32_t msg_count, uint32_t msg_size,
const osMessageQueueAttr_t *attr);
osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr,
uint8_t msg_prio, uint32_t timeout);
osStatus_t osMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t
*msg_prio, uint32_t timeout);
osSemaphoreId_t osSemaphoreNew (uint32_t max_count, uint32_t initial_count,
const osSemaphoreAttr_t *attr);
osStatus_t osSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t timeout);
osStatus_t osSemaphoreRelease (osSemaphoreId_t semaphore_id);
osMutexId_t osMutexNew(const osMutexAttr_t *attr);
attr :互斥量的属性。文章来源地址https://www.toymoban.com/news/detail-798630.html
osStatus_t osMutexAcquire(osMutexId_t mutex_id, uint32_t timeout);
osStatus_t osMutexRelease(osMutexId_t mutex_id);
osEventFlagsId_t osEventFlagsNew(const osEventFlagsAttr_t *attr);
uint32_t osEventFlagsSet(osEventFlagsId_t ef_id, uint32_t flags)
uint32_t osEventFlagsWait(osEventFlagsId_t ef_id, uint32_t flags, uint32_t
options, uint32_t timeout);
到了这里,关于1.15 作业的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!