From 08b63ac5d8b8392a8535b043ac0d204792b7ded9 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: Wed, 17 Apr 2024 13:49:35 +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 | 188 -------------------------------------------- 1 file changed, 188 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 8a232c8..0000000 --- a/System/sv_int_loc.c +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************//** - * @item CosyOS-II Kernel - * @file sv_int_loc.c - * @brief 中断本地服务(仅在用户中断中调用,并在本地执行) - * @author 迟凯峰 - * @version V2.1.1 - * @date 2024.04.04 - ******************************************************************************/ - -#include "os_var.h" -#include "os_api.h" - -#if SYSCFG_MCUCORE == 8051 -#pragma NOAREGS -#endif - - - -/* - * 任务调度 - */ - -void si_task_schedule(void) -{ - s_sign_schedule_all = true; - s_sign_schedule = true; - mPendSV_Set; -} - - - -/* - * 二值信号量 - */ -#if SYSCFG_BINARY == __ENABLED__ -/* 获取 */ -s_bool_t si_take_binary(s_binary_tsp bin) -{ - if(bin->binary){ - bin->binary = false; - return true; - } - return false; -} - -#endif - - - -/* - * 飞信 - */ -#if SYSCFG_FETION == __ENABLED__ -/* 接收飞信 */ -m_fetion_t si_recv_fetion(s_fetion_tsp fet) -{ - m_fetion_t fetion = fet->fetion; - fet->fetion = false; - return fetion; -} - -#endif - - - -/* - * 消息邮箱(接收邮件) - */ -#if SYSCFG_MAILBOX == __ENABLED__ - -#if SYSCFG_MCUCORE == 8051 - -s_bool_t si_can_read_gmbox(s_mailbox_tsp gm) -{ - if(s_sign_write_mbox_accessor - || s_mbox_accessor == OS_NULL || s_mbox_accessor->gm != gm){ - return true; - } - return false; -} - -#if SYSCFG_MAILBOX_ACCESSMECHANISM == 1 - -s_bool_t si_can_read_lmbox(void) -{ - if(!s_mbox_accessor->lf) return false; - s_mbox_accessor->lf = false; - return true; -} - -void *si_get_lmbox(void) -{ - return s_mbox_accessor->lm; -} - -#endif - -#else - -s_bool_t si_recv_mail(void *lm, s_mailbox_tsp gm, size_t size) MCUCFG_251_REENTRANT -{ - if(s_mbox_accessor == OS_NULL || s_mbox_accessor->gm != gm){ - if(gm->gf){ - gm->gf = false; - s_memcpy(lm, &gm->mail0, size); - return true; - } - return false; - } - #if SYSCFG_MAILBOX_ACCESSMECHANISM == 1 - else if(s_mbox_accessor->lf){ - s_mbox_accessor->lf = false; - s_memcpy(lm, s_mbox_accessor->lm, size); - return true; - } - #endif - return false; -} - -#endif - -#endif - - - -/* - * 消息队列(接收消息) - */ -#if SYSCFG_MSGQUEUE == __ENABLED__ - -#if SYSCFG_MCUCORE == 8051 - -s_bool_t si_can_access_queue(s_queue_tsp queue) -{ - if(!queue->mutex) goto __RET_FALSE; - queue->mutex = false; - if(queue->type == __DYNAMIC__){ - #if SYSCFG_DEBUGGING == __ENABLED__ - s_fault.error_recvmsg_int = true; - #endif - goto __BACK_MUTEX; - } - if(!queue->counter) goto __BACK_MUTEX; - return true; - -__BACK_MUTEX: - queue->mutex = true; - -__RET_FALSE: - return false; -} - -static void *_recv_msg_(s_bool_t _OBJ_MEM_ *mut, void *msg) -{ - *mut = true; - return msg; -} - -void *si_recv_msg(s_queue_tsp queue) -{ - void *msg; - sRecvMsg_Static(msg); - return _recv_msg_((s_bool_t *)&queue->mutex, msg); -} - -#else - -void *si_recv_msg(s_queue_tsp queue) -{ - void *msg = OS_NULL; - if(!queue->mutex) return OS_NULL; - queue->mutex = false; - if(queue->type == __DYNAMIC__){ - #if SYSCFG_DEBUGGING == __ENABLED__ - s_fault.error_recvmsg_int = true; - #endif - } - else if(!queue->counter); - else{ - sRecvMsg_Static(msg); - } - queue->mutex = true; - return msg; -} - -#endif - -#endif