/*
*********************************************************************************************************
* uC/OS-II
* The Real-Time Kernel
*
* Copyright 1992-2021 Silicon Laboratories Inc. www.silabs.com
*
* SPDX-License-Identifier: APACHE-2.0
*
* This software is subject to an open source license and is distributed by
* Silicon Laboratories Inc. pursuant to the terms of the Apache License,
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* CORE FUNCTIONS
*
* Filename : os_core.c
* Version : V2.93.01
*********************************************************************************************************
*/
#ifndef OS_CORE_C
#define OS_CORE_C
#define MICRIUM_SOURCE
#ifndef OS_MASTER_FILE
#define OS_GLOBALS
#include <ucos_ii.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)
*********************************************************************************************************
*/
INT8U const OSUnMapTbl[256] = {
0u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x00 to 0x0F */
4u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x10 to 0x1F */
5u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x20 to 0x2F */
4u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x30 to 0x3F */
6u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x40 to 0x4F */
4u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x50 to 0x5F */
5u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x60 to 0x6F */
4u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x70 to 0x7F */
7u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x80 to 0x8F */
4u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0x90 to 0x9F */
5u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0xA0 to 0xAF */
4u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0xB0 to 0xBF */
6u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0xC0 to 0xCF */
4u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0xD0 to 0xDF */
5u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, /* 0xE0 to 0xEF */
4u, 0u, 1u, 0u, 2u, 0u, 1u, 0u, 3u, 0u, 1u, 0u, 2u, 0u, 1u, 0u /* 0xF0 to 0xFF */
};
/*
*********************************************************************************************************
* 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 > 0u
static void OS_InitTaskStat(void);
#endif
static void OS_InitTCBList(void);
static void OS_SchedNew(void);
/*
*********************************************************************************************************
* 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 a pointer to an ASCII string that will receive the name of the semaphore,
* mutex, mailbox or queue.
*
* perr is a pointer to an error code that can contain one of the following values:
*
* OS_ERR_NONE 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'
* OS_ERR_NAME_GET_ISR if you are trying to call this function from an ISR
*
* Returns : The length of the string or 0 if the 'pevent' is a NULL pointer.
*********************************************************************************************************
*/
#if (OS_EVENT_EN) && (OS_EVENT_NAME_EN > 0u)
INT8U OSEventNameGet(OS_EVENT *pevent,
INT8U **pname,
INT8U *perr)
{
INT8U len;
#if OS_CRITICAL_METHOD == 3u /* Allocate storage for CPU status register */
OS_CPU_SR cpu_sr = 0u;
#endif
#ifdef OS_SAFETY_CRITICAL
if (perr == (INT8U *)0)
{
OS_SAFETY_CRITICAL_EXCEPTION();
return (0u);
}
#endif
#if OS_ARG_CHK_EN > 0u
if (pevent == (OS_EVENT *)0) /* Is 'pevent' a NULL pointer? */
{
*perr = OS_ERR_PEVENT_NULL;
return (0u);
}
if (pname == (INT8U **)0) /* Is 'pname' a NULL pointer? */
{
*perr = OS_ERR_PNAME_NULL;
return (0u);
}
#endif
if (OSIntNesting > 0u) /* See if trying to call from an ISR */
{
*perr = OS_ERR_NAME_GET_ISR;
return (0u);
}
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:
*perr = OS_ERR_EVENT_TYPE;
return (0u);
}
OS_ENTER_CRITICAL();
*pname = pevent->OSEventName;
len = OS_StrLen(*pname);
OS_EXIT_CRITICAL();
*perr = OS_ERR_NONE;
return (len);
}
#endif
/*
*********************************************************************************************************
* ASSIGN A NAME TO A SEMAPHORE, MUTEX, MAILBOX or QUEUE
*
* Description: This function assigns a name 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, it doesn't
* matter the actual type.
*
* pname is a pointer to an ASCII string that will be used as the name of the semaphore,
* mutex, mailbox or queue.
*
* perr is a pointer to an error code that can contain one of the following values:
*
* OS_ERR_NONE if the requested task is resumed
* 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'
* OS_ERR_NAME_SET_ISR if you ca
没有合适的资源?快使用搜索试试~ 我知道了~
UCOS V2.9.3 DSP28335
共204个文件
obj:43个
c:39个
h:37个
需积分: 10 4 下载量 72 浏览量
2022-09-04
17:07:19
上传
评论
收藏 558KB RAR 举报
温馨提示
UCOS V2.9.3 DSP28335 移植成功
资源详情
资源评论
资源推荐
收起资源包目录
UCOS V2.9.3 DSP28335 (204个子文件)
os_cpu_a.asm 11KB
os_cpu_i.asm 6KB
DSP2833x_CodeStartBranch.asm 3KB
DSP2833x_usDelay.asm 3KB
DSP2833x_CSMPasswords.asm 3KB
DSP2833x_DisInt.asm 2KB
DSP2833x_ADC_cal.asm 2KB
DSP2833x_DBGIER.asm 1005B
os_core.c 81KB
os_task.c 59KB
os_flag.c 56KB
DSP2833x_SWPrioritizedDefaultIsr.c 51KB
os_tmr.c 44KB
os_q.c 42KB
os_mutex.c 39KB
DSP2833x_DefaultIsr.c 33KB
os_mbox.c 31KB
os_sem.c 30KB
DSP2833x_DMA.c 25KB
os_mem.c 20KB
DSP2833x_ECan.c 16KB
os_cpu_c.c 15KB
DSP2833x_Mcbsp.c 14KB
os_dbg.c 13KB
os_dbg_r.c 13KB
DSP2833x_SysCtrl.c 11KB
DSP2833x_EPwm.c 11KB
os_time.c 11KB
DSP2833x_SWPrioritizedPieVect.c 10KB
DSP2833x_Xintf.c 9KB
app_hooks.c 9KB
DSP2833x_GlobalVariableDefs.c 9KB
DSP2833x_ECap.c 8KB
DSP2833x_PieVect.c 7KB
DSP2833x_EQep.c 6KB
DSP2833x_Sci.c 6KB
DSP2833x_sci_io.c 5KB
DSP2833x_Spi.c 4KB
DSP2833x_CpuTimers.c 4KB
DSP2833x_Gpio.c 3KB
DSP2833x_I2C.c 2KB
DSP2833x_Adc.c 2KB
DSP2833x_PieCtrl.c 2KB
ucos_ii.c 1KB
DSP2833x_MemCopy.c 1KB
board.c 1KB
start.c 1KB
.ccsproject 567B
TargetConfiguration.ccxml 2KB
DSP2833x_Headers_nonBIOS.cmd 8KB
28335_RAM_lnk.cmd 7KB
.cproject 24KB
DSP2833x_sci_io.d 8KB
start.d 6KB
DSP2833x_DefaultIsr.d 5KB
DSP2833x_CpuTimers.d 5KB
DSP2833x_PieCtrl.d 5KB
DSP2833x_SysCtrl.d 5KB
DSP2833x_PieVect.d 5KB
DSP2833x_Mcbsp.d 5KB
DSP2833x_Xintf.d 5KB
DSP2833x_ECan.d 5KB
DSP2833x_Gpio.d 5KB
DSP2833x_EPwm.d 5KB
DSP2833x_EQep.d 5KB
DSP2833x_ECap.d 5KB
DSP2833x_I2C.d 5KB
DSP2833x_Spi.d 5KB
DSP2833x_Adc.d 5KB
DSP2833x_DMA.d 5KB
DSP2833x_Sci.d 5KB
board.d 5KB
DSP2833x_GlobalVariableDefs.d 4KB
DSP2833x_MemCopy.d 4KB
app_hooks.d 2KB
os_cpu_c.d 2KB
os_dbg.d 2KB
os_mutex.d 2KB
os_flag.d 2KB
os_time.d 2KB
os_mbox.d 2KB
os_task.d 2KB
os_core.d 2KB
os_tmr.d 2KB
os_mem.d 2KB
os_sem.d 2KB
os_q.d 2KB
f28335.gel 22KB
DSP2833x_SWPrioritizedIsrLevels.h 133KB
ucos_ii.h 79KB
DSP2833x_ECan.h 44KB
DSP2833x_Mcbsp.h 31KB
DSP2833x_Gpio.h 15KB
DSP2833x_EPwm.h 14KB
DSP2833x_DMA.h 13KB
DSP2833x_SysCtrl.h 13KB
os_cfg.h 11KB
os_trace.h 10KB
DSP2833x_Adc.h 10KB
os_cpu.h 9KB
共 204 条
- 1
- 2
- 3
gardenhill
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0