资源简介
一款免费并开源的嵌入式实时多任务操作系统,最小系统内核小于1KB。
具有高度可裁剪性,支持优先级抢占和时间片轮转两种任务调度机制,自适应任务调度算法,中断延时时间几乎为0,可检测堆栈溢出,支持信号量、邮箱、队列、事件标志、互斥等多种同步通信方式。
CoOS还支持ICCARM、ARMCC、GCC多种编译器,故不仅可以在CoIDE中通过勾选直接使用,还能独立应用于MDK和IAR中。官网提供了大量可直接使用的示例及应用代码。
代码片段和文件信息
/**
*******************************************************************************
* @file core.c
* @version V1.1.4
* @date 2011.04.20
* @brief Core implementation code of CooCox CoOS kernel.
*******************************************************************************
* @copy
*
* INTERNAL FILEDON‘T PUBLIC.
*
* © COPYRIGHT 2009 CooCox
*******************************************************************************
*/
/*---------------------------- Include ---------------------------------------*/
#include
/*---------------------------- Variable Define -------------------------------*/
volatile U8 OSIntNesting = 0; /*!< Use to indicate interrupt nesting level*/
volatile U8 OSSchedLock = 0; /*!< Task Switch lock. */
volatile BOOL TaskSchedReq = Co_FALSE;
/**
*******************************************************************************
* @brief Enter a ISR.
* @param[in] None
* @param[out] None
* @retval None
*
* @par Description
* @details This function is called to notify OS when enter to an ISR.
*
* @note When you call API in ISRyou must call CoEnterISR() before your
* interrupt handler codeand call CoExitISR() after your handler
* code and before exiting from ISR.
*******************************************************************************
*/
void CoEnterISR(void)
{
Inc8(&OSIntNesting); /* OSIntNesting increment */
}
/**
*******************************************************************************
* @brief Exit a ISR.
* @param[in] None
* @param[out] None
* @retval None
*
* @par Description
* @details This function is called when exit from a ISR.
*
* @note
*******************************************************************************
*/
void CoExitISR(void)
{
Dec8(&OSIntNesting); /* OSIntNesting decrease */
if( OSIntNesting == 0) /* Is OSIntNesting == 0? */
{
if(TaskSchedReq == Co_TRUE)
{
OSSchedLock++;
Schedule(); /* Call task schedule */
OSSchedLock--;
}
}
}
/**
*******************************************************************************
* @brief Unlock schedule
* @param[in] None
* @param[out] None
* @retval None
*
* @par Description
* @details This function is called to unlock schedule(i.e.enable schedule again)
*
* @note
*******************************************************************************
*/
void OsSchedUnlock(void)
{
if(OSSchedLock == 1) /* Is OSSchedLock == 0? */
{
#if CFG_TASK_WAITTING_EN > 0
if(IsrReq == Co_TRUE)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-04-29 10:00 CoOS\
目录 0 2010-11-04 16:32 CoOS\Document\
文件 23640 2010-10-22 10:43 CoOS\Document\CooCox CoOS‘s TERMS AND CONDITIONS.pdf
文件 1415680 2010-11-04 16:32 CoOS\Document\CooCox CoOS用户手册英文完整版.doc
文件 749166 2010-09-09 08:44 CoOS\Document\CooCox_CoOS_User_Guide.pdf
文件 1411072 2010-11-04 16:32 CoOS\Document\CoOS_User_Guide_CH.doc
文件 896 2010-04-29 10:00 CoOS\Document\readme.txt
目录 0 2011-04-20 11:10 CoOS\kernel\
文件 1357 2011-04-20 10:46 CoOS\kernel\coocox.h
文件 9052 2011-04-20 10:57 CoOS\kernel\CoOS.h
文件 8099 2011-04-20 10:46 CoOS\kernel\core.c
文件 16663 2011-04-20 10:46 CoOS\kernel\event.c
文件 23980 2011-04-20 10:46 CoOS\kernel\flag.c
文件 1714 2011-04-20 10:46 CoOS\kernel\hook.c
文件 16387 2011-04-20 10:46 CoOS\kernel\kernelHeap.c
文件 10737 2011-04-20 10:46 CoOS\kernel\mbox.c
文件 9884 2011-04-20 10:46 CoOS\kernel\mm.c
文件 12062 2011-04-20 10:46 CoOS\kernel\mutex.c
文件 6802 2011-04-20 10:46 CoOS\kernel\OsConfig.h
文件 685 2011-04-20 10:46 CoOS\kernel\OsCore.h
文件 2077 2011-04-20 10:46 CoOS\kernel\OsError.h
文件 2566 2011-04-20 10:46 CoOS\kernel\OsEvent.h
文件 2011 2011-04-20 10:46 CoOS\kernel\OsFlag.h
文件 1149 2011-04-20 10:46 CoOS\kernel\OsKernelHeap.h
文件 936 2011-04-20 10:46 CoOS\kernel\OsMM.h
文件 2045 2011-04-20 10:46 CoOS\kernel\OsMutex.h
文件 1284 2011-04-20 10:46 CoOS\kernel\OsQueue.h
文件 1271 2011-04-20 10:46 CoOS\kernel\OsServiceReq.h
文件 4189 2011-04-20 10:46 CoOS\kernel\OsTask.h
文件 1098 2011-04-20 10:46 CoOS\kernel\OsTime.h
文件 2116 2011-04-20 10:46 CoOS\kernel\OsTimer.h
............此处省略20个文件信息
- 上一篇:直升机空气动力学基础.pdf
- 下一篇:两个VRML虚拟现实校园漫游
相关资源
- 华南理工大学操作系统试卷含英文版
- 基于嵌入式Linux_ARM远程无线监控系统
- AutoSar多核操作系统
- GeekOS操作系统课程设计project0-4讲解
- 操作系统实验完整版川大计科
- 计算机操作系统原理汤子瀛第二版.
- H.264视频监控最佳指导
- DOS画画_操作系统课程设计_操作系统图
- 全球第一本ROS开源书中文版--机器人操
- 操作系统课程设计报告-单用户多级文
- OV5640寄存器设置中文版
- 计算机操作系统第四版复习资料。重
- 实验一 嵌入式Linux开发环境的搭建及
- 操作系统大作业(银行家算法)
- 操作系统综合课程设计_小学期
- 弹球游戏设计与实现
- 高质量嵌入式LinuxC编程_试读版PDF电子
- [英]操作系统概念第7版+代码课件所有
- 现代操作系统第四版205471
- stm32_fft_AD9220.zip
- 操作系统 哲学家进餐进程算法
- Pintos 西电操作系统课程设计3 报告+代
- 安徽大学操作系统试卷.zip
- 计算机三级嵌入式基本知识点
- 现代操作系统英文原版第四版Modern
- 操作系统进程管理实验含源代码
- 2011蓝桥杯天华杯模拟赛题设计源代码
- 操作系统精髓与设计原理 第六版 习题
- 嵌入式笔试面试题汇总(超强汇总!
- 操作系统原理第三版
评论
共有 条评论