/*
*********************************************************************************************************
* uC/OS-II
* The Real-Time Kernel
* CORE FUNCTIONS
*
* (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
* All Rights Reserved
*
* V2.00
*
* File : OS_CORE.C
* By : Jean J. Labrosse
*********************************************************************************************************
*/
#ifndef OS_MASTER_FILE
#define OS_GLOBALS
#include "includes.h"
#endif
/*
*********************************************************************************************************
* LOCAL GLOBAL VARIABLES
*********************************************************************************************************
*/
static INT8U OSIntExitY; /* Variable used by 'OSIntExit' to prevent using locals */
//static OS_STK OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE]; /* Idle task stack */
extern OS_STK OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE]; /* Idle task stack */
#if OS_TASK_STAT_EN
static OS_STK OSTaskStatStk[OS_TASK_STAT_STK_SIZE]; /* Statistics task stack */
#endif
static OS_TCB OSTCBTbl[OS_MAX_TASKS + OS_N_SYS_TASKS]; /* Table of TCBs */
/*$PAGE*/
/*
*********************************************************************************************************
* MAPPING TABLE TO MAP BIT POSITION TO BIT MASK
*
* Note: Index into table is desired bit position, 0..7
* Indexed value corresponds to bit mask
*********************************************************************************************************
*/
INT8U const OSMapTbl[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
/*
*********************************************************************************************************
* PRIORITY RESOLUTION TABLE
*
* Note: Index into table is bit pattern to resolve highest priority
* Indexed value corresponds to highest priority bit position (i.e. 0..7)
*********************************************************************************************************
*/
INT8U const OSUnMapTbl[] = {
0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
};
/*$PAGE*/
/*
*********************************************************************************************************
* MAKE TASK READY TO RUN BASED ON EVENT OCCURING
*
* Description: This function is called by other uC/OS-II services and is used to ready a task that was
* waiting for an event to occur.
*
* Arguments : pevent is a pointer to the event control block corresponding to the event.
*
* msg is a pointer to a message. This pointer is used by message oriented services
* such as MAILBOXEs and QUEUEs. The pointer is not used when called by other
* service functions.
*
* msk is a mask that is used to clear the status byte of the TCB. For example,
* OSSemPost() will pass OS_STAT_SEM, OSMboxPost() will pass OS_STAT_MBOX etc.
*
* Returns : none
*
* Note : This function is INTERNAL to uC/OS-II and your application should not call it.
*********************************************************************************************************
*/
#if (OS_Q_EN && (OS_MAX_QS >= 2)) || OS_MBOX_EN || OS_SEM_EN
void OSEventTaskRdy (OS_EVENT *pevent, void *msg, INT8U msk)
{
OS_TCB *ptcb;
INT8U x;
INT8U y;
INT8U bitx;
INT8U bity;
INT8U prio;
y = OSUnMapTbl[pevent->OSEventGrp]; /* Find highest prio. task waiting for message */
bity = OSMapTbl[y];
x = OSUnMapTbl[pevent->OSEventTbl[y]];
bitx = OSMapTbl[x];
prio = (INT8U)((y << 3) + x); /* Find priority of task getting the msg */
if ((pevent->OSEventTbl[y] &= ~bitx) == 0) { /* Remove this task from the waiting list */
pevent->OSEventGrp &= ~bity;
}
ptcb = OSTCBPrioTbl[prio]; /* Point to this task's OS_TCB */
ptcb->OSTCBDly = 0; /* Prevent OSTimeTick() from readying task */
ptcb->OSTCBEventPtr = (OS_EVENT *)0; /* Unlink ECB from this task */
#if (OS_Q_EN && (OS_MAX_QS >= 2)) || OS_MBOX_EN
ptcb->OSTCBMsg = msg; /* Send message directly to waiting task */
#else
msg = msg; /* Prevent compiler warning if not used */
#endif
ptcb->OSTCBStat &= ~msk; /* Clear bit associated with event type */
if (ptcb->OSTCBStat == OS_STAT_RDY) { /* See if task is ready (could be susp'd) */
OSRdyGrp |= bity; /* Put task in the ready to run list */
OSRdyTbl[y] |= bitx;
}
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
* MAKE TASK WAIT FOR EVENT TO OCCUR
*
* Description: This function is called by other uC/OS-II services to suspend a task because an event has
* not occurred.
*
* Arguments : pevent is a pointer to the event control block for which the task will be waiting for.
*
* Returns : none
*
* Note : This function is INTERNAL to uC/OS-II and your application should not call it.
*********************************************************************************************************
*/
#if (OS_Q_EN && (OS_MAX_QS >= 2)) || OS_MBOX_EN || OS_SEM_EN
void OSEventTaskWait (OS_EVENT *pevent)
{
OSTCBCur->OSTCBEventPtr = pevent; /* Store pointer to event control block in TCB */
if ((OSRdyTbl[OSTCBCur->OSTCBY] &= ~OSTCBCur->OSTCBBitX) == 0) { /* Task no longer ready */
OSRdyGrp &= ~OSTCBCur->OSTCBBitY;
}
pevent->OSEventTbl[OSTCBCur->OSTCBY] |= OSTCBCur->OSTCBBitX; /* Put task in waiting list */
pevent->OSEventGrp |= OSTCBCur->OSTCBBitY;
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
* MAKE TASK READY TO RUN BASED ON EVENT TIMEOUT
*
* Description: This function is called by other uC/OS-II services to make a task ready to run because a
* timeout occurred.
*
* Arguments : pevent is a pointer to the event control block which is readying a task.
*
* Returns : none
没有合适的资源?快使用搜索试试~ 我知道了~
ucos.rar_TMS320F2812_dsp ucos_dsp ucos-ii_ucos_ucos dsp
共133个文件
c:30个
asm:27个
h:23个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 113 浏览量
2022-09-23
08:50:34
上传
评论
收藏 347KB RAR 举报
温馨提示
ucos在F2812 DSP上的移植.希望对大家有用
资源推荐
资源详情
资源评论
收起资源包目录
ucos.rar_TMS320F2812_dsp ucos_dsp ucos-ii_ucos_ucos dsp (133个子文件)
UCOS_II.asm 109KB
DSP28_GlobalVariableDefs.asm 107KB
DSP28_GlobalVariableDefs.asm 107KB
UCOS_II.asm 91KB
DSP28_DefaultIsr.asm 56KB
DSP28_DefaultIsr.asm 56KB
EX1L.asm 27KB
DSP28_PieVect.asm 20KB
DSP28_PieVect.asm 20KB
EX1L.asm 14KB
OS_CPU_C.asm 13KB
OS_CPU_C.asm 12KB
DSP28_SysCtrl.asm 9KB
DSP28_SysCtrl.asm 9KB
DSP28_PieCtrl.asm 6KB
DSP28_PieCtrl.asm 6KB
OS_CPU_A.ASM 4KB
DSP28_Spi.asm 1KB
DSP28_Spi.asm 1KB
DSP28_CodeStartBranch.asm 1KB
OS_IntSw.asm 1KB
OS_Sw.asm 1KB
OS_GlobalStack.asm 1006B
DSP28_usDelay.asm 818B
OS_TickISR.asm 457B
OS_StartHighRdy.asm 350B
DSP28_DBGIER.asm 296B
OS_CORE.C.bak 39KB
OS_CORE.C 39KB
DSP28_SWPrioritizedDefaultIsr.c 35KB
OS_TASK.C 35KB
DSP28_DefaultIsr.c 25KB
OS_Q.C 20KB
OS_MBOX.C 12KB
OS_SEM.C 11KB
OS_MEM.C 11KB
DSP28_SWPrioritizedPieVect.c 9KB
OS_TIME.C 9KB
EX1L.C 9KB
OS_CPU_C.C 8KB
Example_28xSpi_FFDLB.c 6KB
DSP28_Xintf.c 6KB
DSP28_PieVect.c 5KB
DSP28_CpuTimers.c 5KB
DSP28_SysCtrl.c 4KB
DSP28_GlobalVariableDefs.c 4KB
DSP28_Adc.c 2KB
DSP28_PieCtrl.c 2KB
DSP28_InitPeripherals.c 2KB
DSP28_Gpio.c 2KB
DSP28_Sci.c 1KB
DSP28_Spi.c 1KB
DSP28_XIntrupt.c 1KB
DSP28_Mcbsp.c 1KB
DSP28_ECan.c 1KB
DSP28_Ev.c 1KB
UCOS_II.C 1003B
OS_GlobalStack.c 575B
F2812.cmd 9KB
F2810.cmd 8KB
EzDSP_RAM_lnk.cmd 6KB
EzDSP_RAM_lnk_bak.cmd 6KB
FOXUSER.DBF 0B
FOXUSER.FPT 0B
DSP28_SWPrioritizedIsrLevels.h 143KB
DSP28_ECan.h 46KB
DSP28_Mcbsp.h 34KB
DSP28_Gpio.h 29KB
UCOS_II.H 22KB
DSP28_Ev.h 21KB
DSP28_SysCtrl.h 10KB
DSP28_Sci.h 8KB
DSP28_Adc.h 7KB
DSP28_PieVect.h 6KB
DSP28_Spi.h 6KB
DSP28_CpuTimers.h 6KB
DSP28_PieCtrl.h 6KB
OS_CPU.H 5KB
DSP28_DefaultIsr.h 5KB
DSP28_Device.h 4KB
DSP28_Xintf.h 4KB
OS_CFG.H 3KB
DSP28_DevEmu.h 2KB
DSP28_XIntrupt.h 2KB
DSP28_GlobalPrototypes.h 1KB
INCLUDES.H 641B
OS_GlobalStack.h 428B
_desktop.ini 10B
_desktop.ini 10B
_desktop.ini 10B
_desktop.ini 10B
_desktop.ini 10B
_desktop.ini 10B
_desktop.ini 10B
_desktop.ini 10B
_desktop.ini 10B
Debug.lkf 710B
Debug.lkv 710B
cc_build_Debug.log 188B
DSP28_GlobalVariableDefs.lst 223KB
共 133 条
- 1
- 2
资源评论
Kinonoyomeo
- 粉丝: 76
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功