From 8a3ee7ae2be5563abd33120b1a9d65ce7010144a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B6=E4=B8=AD=E6=96=AD=E5=BB=B6=E8=BF=9F=E7=9A=84RTOS?= Date: Sat, 4 Jul 2026 11:52:06 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20System/s?= =?UTF-8?q?v=5Fint=5Floc.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/sv_int_loc.c | 144 -------------------------------------------- 1 file changed, 144 deletions(-) delete mode 100644 System/sv_int_loc.c diff --git a/System/sv_int_loc.c b/System/sv_int_loc.c deleted file mode 100644 index 619ab13d..00000000 --- a/System/sv_int_loc.c +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************//** - * @item CosyOS-III Kernel - * @file sv_int_loc.c - * @brief 中断本地服务 - * @details 在用户中断中调用并直接在本地执行。 - * @author 迟凯峰 - * @version V2.4.1 - * @date 2026.06.24 - ******************************************************************************/ - -#include "os_var.h" -#include "sv_com.h" - -#if (SYSCFG_MCUCORE == 8051) -#pragma NOAREGS /* 相对寄存器访问 for C51 */ -#endif - -/** - @addtogroup 中断本地服务 - @{ - */ - -#if (SYSCFG_BINARY == __ENABLED__) -/** - \brief 获取二值信号量 - \param[in] hbin 二值信号量句柄 - \return 结果 [true:成功,false:失败] - */ -bool si_take_binary(s_binary_tsp hbin) -{ - if(hbin->binary){ - hbin->binary = false; - return true; - } - return false; -} -#endif - -#if (SYSCFG_FETION == __ENABLED__) -/** - \brief 接收飞信 - \param[in] htbox 信箱句柄 - \return 飞信数据 [false:失败] - */ -m_fetion_t si_recv_fetion(s_tionbox_tsp htbox) -{ - m_fetion_t tion = htbox->tion; - htbox->tion = false; - return tion; -} -#endif - -#if (SYSCFG_MAILBOX == __ENABLED__) -/** - \brief 接收邮件 - \param[in] hmbox 邮箱句柄 - \return 邮件指针 [NULL:失败] - */ -void *si_recv_mail(s_mailbox_tsp hmbox) -{ - if(hmbox->flag){ - hmbox->flag = false; - return hmbox->mail; - } - return OS_NULL; -} -#endif - -#if (SYSCFG_MSGQUEUE == __ENABLED__) && (SYSCFG_MSGQUEUE_INTRECV == __ENABLED__) -#if (SYSCFG_MCUCORE == 8051) -/** - \brief 获取队列互斥量 - \details 获取队列访问权限 for C51接收消息。 - \param[in] hque 队列句柄 - \return 结果 [true:成功,false:失败] - */ -bool si_take_quemut(s_msgque_tsp hque) -{ - if(!hque->mutex) return false; - hque->mutex = false; - - if(hque->type == __DYNAMIC__){ - #if (SYSCFG_DEBUGGING == __ENABLED__) - s_fault.error_recvmsg_int = true; - #endif - } - else if(!hque->counter); - else return true; - - hque->mutex = true; - return false; -} - -/** - \brief 归还并返回 - \details 归还队列互斥量并返回消息指针 for C51接收消息。 - \param[out] mut 队列互斥量指针 - \param[in] msg 消息指针 - \return 消息指针 [NULL:失败] - */ -static void *_back_ret_(bool _STATIC_MEM_ *mut, void *msg) -{ - *mut = true; - return msg; -} - -/** - \brief C51接收消息 - \param[in] hque 队列句柄 - \return 消息指针 [NULL:失败] - */ -void *si_recv_msg_c51(s_msgque_tsp hque) -{ - void *msg = sc_recv_msg_staque((s_staque_tsp)hque); - return _back_ret_((bool *)&hque->mutex, msg); -} -#else -/** - \brief 非51接收消息 - \param[in] hque 队列句柄 - \return 消息指针 [NULL:失败] - */ -void *si_recv_msg_n51(s_msgque_tsp hque) -{ - void *msg = OS_NULL; - if(!hque->mutex) return OS_NULL; - hque->mutex = false; - - if(hque->type == __DYNAMIC__){ - #if (SYSCFG_DEBUGGING == __ENABLED__) - s_fault.error_recvmsg_int = true; - #endif - } - else if(hque->counter){ - msg = sc_recv_msg_staque((s_staque_tsp)hque); - } - - hque->mutex = true; - return msg; -} -#endif -#endif - -/** @} */