代码拉取完成,页面将自动刷新
同步操作将从 erickhuang/rtos 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "os.h"
#define OS_INT_ENABLE()
#define OS_INT_DISABLE()
static U16 int_cnt = 0;
#define VAL_XPSR 0
void os_stackreg_init(OS_StackReg *pStack, TASK_FUNC func)
{
pStack->XPSR = VAL_XPSR;
pStack->R0 = 0;
pStack->R1 = 0;
pStack->R2 = 0;
pStack->R3 = 0;
pStack->R4 = 0;
pStack->R5 = 0;
pStack->R6 = 0;
pStack->R7 = 0;
pStack->R8 = 0;
pStack->R9 = 0;
pStack->R10 = 0;
pStack->R11 = 0;
pStack->R12 = 0;
pStack->R13 = (U32)pStack;
pStack->R14 = (U32)os_task_selfdelete;
pStack->R15 = (U32)func;
}
Status_t os_int_lock(void)
{
if (NULL == cur_tcb)
return RET_SUCCESS;
if (RET_SUCCESS == MDS_RunInInt())
return RET_SUCCESS;
if (int_cnt == 0) {
OS_INT_DISABLE();
++int_cnt;
return RET_SUCCESS;
}
else if (int_cnt < 0xffff){
++int_cnt;
return RET_SUCCESS;
}
else {
return RET_FAILURE;
}
}
Status_t os_int_unlock(void)
{
if (NULL == cur_tcb)
return RET_SUCCESS;
if (RET_SUCCESS == MDS_RunInInt())
return RET_SUCCESS;
if (int_cnt > 0) {
--int_cnt;
if (int_cnt == 0) {
OS_INT_ENABLE();
}
return RET_SUCCESS;
}
else {
return RET_FAILURE;
}
}
void os_swi_trigger(void)
{
MDS_TaskOccurSwi();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。