/*
*********************************************************************************************************
* uC/OS-II
* The Real-Time Kernel
* CORE FUNCTIONS
*
* (c) Copyright 1992-2006, Jean J. Labrosse, Weston, FL
* All Rights Reserved
*
* File : OS_CORE.C
* By : Jean J. Labrosse
* Version : V2.83
*********************************************************************************************************
*/
#ifndef OS_MASTER_FILE
#define OS_GLOBALS
#include <ucos_ii.h>
#include "app_cfg.h"
#endif
/*
*********************************************************************************************************
* 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)
*********************************************************************************************************
*/
#define ALL_IN_ROM ///侯立江修改
#ifndef ALL_IN_ROM
INT8U const OSUnMapTbl[256] = {
0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x00 to 0x0F */
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x10 to 0x1F */
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x20 to 0x2F */
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x30 to 0x3F */
6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x40 to 0x4F */
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x50 to 0x5F */
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x60 to 0x6F */
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x70 to 0x7F */
7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x80 to 0x8F */
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0x90 to 0x9F */
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1,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3, 0, 1, 0, 2, 0, 1, 0, /* 0xA0 to 0xAF */
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xB0 to 0xBF */
6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xC0 to 0xCF */
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xD0 to 0xDF */
5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, /* 0xE0 to 0xEF */
4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 /* 0xF0 to 0xFF */
};
#endif
/*$PAGE*/
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
static void OS_InitEventList(void);
static void OS_InitMisc(void);
static void OS_InitRdyList(void);
static void OS_InitTaskIdle(void);
#if OS_TASK_STAT_EN > 0
static void OS_InitTaskStat(void);
#endif
static void OS_InitTCBList(void);
static void OS_SchedNew(void);
/*$PAGE*/
/*
*********************************************************************************************************
* GET THE NAME OF A SEMAPHORE, MUTEX, MAILBOX or QUEUE
*
* Description: This function is used to obtain the name assigned to a semaphore, mutex, mailbox or queue.
*
* Arguments : pevent is a pointer to the event group. 'pevent' can point either to a semaphore,
* a mutex, a mailbox or a queue. Where this function is concerned, the actual
* type is irrelevant.
*
* pname is a pointer to an ASCII string that will receive the name of the semaphore,
* mutex, mailbox or queue. The string must be able to hold at least
* OS_EVENT_NAME_SIZE characters.
*
* err is a pointer to an error code that can contain one of the following values:
*
* OS_NO_ERR if the name was copied to 'pname'
* OS_ERR_EVENT_TYPE if 'pevent' is not pointing to the proper event
* control block type.
* OS_ERR_PNAME_NULL You passed a NULL pointer for 'pname'
* OS_ERR_PEVENT_NULL if you passed a NULL pointer for 'pevent'
*
* Returns : The length of the string or 0 if the 'pevent' is a NULL pointer.
*********************************************************************************************************
*/
#if OS_EVENT_EN && (OS_EVENT_NAME_SIZE > 1)
INT8U OSEventNameGet (OS_EVENT *pevent, INT8U *pname, INT8U *err)
{
INT8U len;
#if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
OS_CPU_SR cpu_sr = 0;
#endif
#if OS_ARG_CHK_EN > 0
if (err == (INT8U *)0) { /* Validate 'err' */
return (0);
}
if (pevent == (OS_EVENT *)0) { /* Is 'pevent' a NULL pointer? */
*err = OS_ERR_PEVENT_NULL;
return (0);
}
if (pname == (INT8U *)0) { /* Is 'pname' a NULL pointer? */
*err = OS_ERR_PNAME_NULL;
return (0);
}
#endif
switch (pevent->OSEventType) {
case OS_EVENT_TYPE_SEM:
case OS_EVENT_TYPE_MUTEX:
case OS_EVENT_TYPE_MBOX:
case OS_EVENT_TYPE_Q:
break;
default:
*err = OS_ERR_EVENT_TYPE;
return (0);
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
移植到AVRmega128上的ucos2.83 (102个子文件)
main_cof.aps 2KB
os_core.c 70KB
os_flag.c 54KB
os_task.c 48KB
os_tmr.c 45KB
os_q.c 37KB
os_mutex.c 35KB
os_mbox.c 25KB
os_sem.c 23KB
os_mem.c 19KB
os_cpu_c.c 14KB
os_dbg_r.c 11KB
t_lcd.c 11KB
os_time.c 10KB
app.c 7KB
command.c 4KB
uart.c 4KB
ds18b20.c 4KB
TGS.c 2KB
TGS822.c 2KB
alarm.c 2KB
ucos_ii.c 1KB
voice.c 943B
humidity.c 625B
os_core.o.d 1KB
command.o.d 1KB
humidity.o.d 1018B
ds18b20.o.d 1016B
TGS.o.d 1008B
uart.o.d 1004B
app.o.d 1002B
os_q.o.d 914B
alarm.o.d 875B
os_cpu_c.o.d 733B
os_dbg_r.o.d 667B
os_mutex.o.d 667B
os_mbox.o.d 665B
os_task.o.d 665B
os_flag.o.d 665B
os_time.o.d 665B
os_sem.o.d 658B
os_tmr.o.d 658B
os_mem.o.d 658B
main.eep 13B
main.elf 64KB
ucos_ii.h 70KB
alarm1.h 13KB
os_cfg.h 10KB
os_cpu.h 5KB
app_cfg.h 1KB
command.h 1KB
code.h 595B
error.h 193B
alarm.h 190B
main.hex 35KB
main.lss 310KB
os_core.lst 191KB
os_task.lst 110KB
os_q.lst 99KB
alarm.lst 80KB
os_cpu_a.lst 63KB
command.lst 56KB
os_time.lst 33KB
os_cpu_c.lst 30KB
ds18b20.lst 28KB
uart.lst 26KB
app.lst 26KB
TGS.lst 10KB
humidity.lst 4KB
os_dbg_r.lst 1KB
os_mutex.lst 1KB
os_flag.lst 1KB
os_mbox.lst 1KB
os_mem.lst 1KB
os_tmr.lst 1KB
os_sem.lst 1KB
Makefile 17KB
main.map 51KB
os_core.o 22KB
command.o 13KB
os_q.o 13KB
os_task.o 12KB
uart.o 9KB
app.o 9KB
alarm.o 8KB
os_time.o 8KB
ds18b20.o 8KB
os_cpu_c.o 7KB
TGS.o 6KB
humidity.o 5KB
os_dbg_r.o 5KB
os_mutex.o 5KB
os_flag.o 5KB
os_mbox.o 5KB
os_tmr.o 5KB
os_mem.o 5KB
os_sem.o 5KB
os_cpu_a.o 4KB
ucos2.pnproj 1KB
ucos2.pnps 252B
共 102 条
- 1
- 2
资源评论
- 悦美天2013-11-22试了,不能用,编译都没通过,不知道是不是方法的问题,深望楼主给一个详细的编译方法,期待您的回复。。。
alex_hou_88
- 粉丝: 2
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- date0425111111111111111111111
- 包含贪心算法的定义及python代码部分实现
- 自动驾驶-状态估计和定位之扩展卡尔曼滤波.pdf
- csdn之x-ca-key,x-ca-nonce,x-ca-signature与x-ca-signature-headers探索
- 基于TM1620数码显示芯片STM32单片机驱动程序软件源代码.zip
- 【tomcat6使用redis配置session共享】
- 包含杨辉三角的说明及java代码实现
- FDN371N-NL-VB一款SOT23封装N-Channel场效应MOS管
- AutomotiveSPICE-V4.0 中文版
- Java实现杨辉三角的生成和打印代码示例.md
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功