mirror of
https://gitee.com/cosyos/cosyos.git
synced 2026-08-17 16:52:27 +08:00
删除文件 System/sv_tick.c
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
/**************************************************************************//**
|
||||
* @item CosyOS-III Kernel
|
||||
* @file sv_tick.c
|
||||
* @brief 滴答服务
|
||||
* @details 仅在 SysTick中断 中调用并执行。
|
||||
* @author 迟凯峰
|
||||
* @version V2.3.5
|
||||
* @date 2026.06.10
|
||||
******************************************************************************/
|
||||
|
||||
#include "os_var.h"
|
||||
#include "sv_com.h"
|
||||
|
||||
/**
|
||||
@addtogroup 滴答服务
|
||||
@{
|
||||
*/
|
||||
|
||||
#if (SYSCFG_SEMAPHORE == __ENABLED__)
|
||||
/**
|
||||
\brief 获取计数信号量
|
||||
\param[in] hsem 计数信号量句柄
|
||||
\return 结果
|
||||
\retval false 失败
|
||||
\retval true 成功
|
||||
*/
|
||||
bool st_take_semaph(s_semaph_tsp hsem) MCUCFG_OSIT_ATTRIBUTE
|
||||
{
|
||||
s_semaph_t counter = hsem->counter;
|
||||
if(counter){
|
||||
hsem->counter = counter - 1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (SYSCFG_MSGQUEUE == __ENABLED__)
|
||||
/**
|
||||
\brief 接收消息
|
||||
\param[in] hque 队列句柄
|
||||
\return 消息指针
|
||||
\retval NULL 无消息
|
||||
*/
|
||||
void *st_recv_msg(s_msgque_tsp hque) MCUCFG_OSIT_ATTRIBUTE
|
||||
{
|
||||
void *msg = OS_NULL;
|
||||
hque->mutex = false;
|
||||
|
||||
if(hque->counter){
|
||||
if(hque->type == __DYNAMIC__){
|
||||
msg = sc_recv_msg_dynque((s_dynque_tsp)hque);
|
||||
}
|
||||
else{
|
||||
msg = sc_recv_msg_staque((s_staque_tsp)hque);
|
||||
}
|
||||
}
|
||||
|
||||
hque->mutex = true;
|
||||
return msg;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
Reference in New Issue
Block a user