资源简介
一款免费并开源的嵌入式实时多任务操作系统,最小系统内核小于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虚拟现实校园漫游
相关资源
- 升腾Win终端系统升级方法新版.doc
- Micrium.RTOS.1.0.0.pack
- ISE_14.7_license.lic
- stm32f103c8t6 4 oled.rar
- Uninstall_Cortana_WINCLIENT.CN.rar
- mpu6050+hmc5883L.rar
- 嵌入式图形界面MiniGUI的示例程序9例
- STM32基于rt_thread操作系统的SDHC卡文件
- 操作系统 LRU算法 实验报告 及 程序代
- [免费]车载CE6.0操作系统
- 分页系统模拟实验 操作系统 课程设
- 模拟段页式虚拟存储管理中地址转换
- ARM嵌入式项目实战
- 操作系统实验——虚存管理实验
- 广工操作系统实验
- 广东工业大学操作系统实验四文件系
- Bochs入门教程[操作系统第一步]
- 操作系统课程设计完整版
- 磁盘调度算法的模拟实现及对比
- 模拟一个文件管理系统
- 二级文件系统(操作系统)
- uCOS编译环境建立 BC45 TASM
- Linux 操作系统实验(全)
- 操作系统实验综合设计【附代码】
- 操作系统共享内存实验
- stm32 用SPI 方式读写 SDHC
- 操作系统循环首次适应算法
- 操作系统课程设计实现可变分区存储
- 基于GTK的Linux环境下的简易任务管理器
- 操作系统课程设计 二级文件管理系统
评论
共有 条评论