初级会员

- 积分
- 198
- 金钱
- 198
- 注册时间
- 2018-10-30
- 在线时间
- 60 小时
|

楼主 |
发表于 2018-12-18 09:51:17
|
显示全部楼层
这个函数是ST封装的:
/**
* @brief Release a Semaphore token
* @param semaphore_id semaphore object referenced with \ref osSemaphore.
* @retval status code that indicates the execution status of the function.
* @note MUST REMAIN UNCHANGED: \b osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
*/
osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)
{
osStatus result = osOK;
portBASE_TYPE taskWoken = pdFALSE;
if (inHandlerMode()) {
if (xSemaphoreGiveFromISR(semaphore_id, &taskWoken) != pdTRUE) {
return osErrorOS;
}
portEND_SWITCHING_ISR(taskWoken);
}
else {
if (xSemaphoreGive(semaphore_id) != pdTRUE) {
result = osErrorOS;
}
}
return result;
} |
|