⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ucos_ii.bak

📁 这是一个修改ucos的操作系统
💻 BAK
📖 第 1 页 / 共 4 页
字号:

#ifndef OS_MBOX_EN
#error  "OS_CFG.H, Missing OS_MBOX_EN: Enable (1) or Disable (0) code generation for MAILBOXES"
#else
	 #ifndef OS_MBOX_ACCEPT_EN
	 #error  "OS_CFG.H, Missing OS_MBOX_ACCEPT_EN: Include code for OSMboxAccept()"
	 #endif

	 #ifndef OS_MBOX_DEL_EN
	 #error  "OS_CFG.H, Missing OS_MBOX_DEL_EN: Include code for OSMboxDel()"
	 #endif

	 #ifndef OS_MBOX_POST_EN
	 #error  "OS_CFG.H, Missing OS_MBOX_POST_EN: Include code for OSMboxPost()"
	 #endif

	 #ifndef OS_MBOX_POST_OPT_EN
	 #error  "OS_CFG.H, Missing OS_MBOX_POST_OPT_EN: Include code for OSMboxPostOpt()"
	 #endif

	 #ifndef OS_MBOX_QUERY_EN
	 #error  "OS_CFG.H, Missing OS_MBOX_QUERY_EN: Include code for OSMboxQuery()"
	 #endif
#endif

/*
*********************************************************************************************************
*                                           MEMORY MANAGEMENT
*********************************************************************************************************
*/

#ifndef OS_MEM_EN
#error  "OS_CFG.H, Missing OS_MEM_EN: Enable (1) or Disable (0) code generation for MEMORY MANAGER"
#else
	 #ifndef OS_MAX_MEM_PART
	 #error  "OS_CFG.H, Missing OS_MAX_MEM_PART: Max. number of memory partitions"
	 #else
		  #if     OS_MAX_MEM_PART == 0
		  #error  "OS_CFG.H, OS_MAX_MEM_PART must be > 0"
		  #endif
		  #if     OS_MAX_MEM_PART > 255
		  #error  "OS_CFG.H, OS_MAX_MEM_PART must be <= 255"
		  #endif
	 #endif

	 #ifndef OS_MEM_QUERY_EN
	 #error  "OS_CFG.H, Missing OS_MEM_QUERY_EN: Include code for OSMemQuery()"
	 #endif
#endif

/*
*********************************************************************************************************
*                                       MUTUAL EXCLUSION SEMAPHORES
*********************************************************************************************************
*/

#ifndef OS_MUTEX_EN
#error  "OS_CFG.H, Missing OS_MUTEX_EN: Enable (1) or Disable (0) code generation for MUTEX"
#else
	 #ifndef OS_MUTEX_ACCEPT_EN
	 #error  "OS_CFG.H, Missing OS_MUTEX_ACCEPT_EN: Include code for OSMutexAccept()"
	 #endif

	 #ifndef OS_MUTEX_DEL_EN
	 #error  "OS_CFG.H, Missing OS_MUTEX_DEL_EN: Include code for OSMutexDel()"
	 #endif

	 #ifndef OS_MUTEX_QUERY_EN
	 #error  "OS_CFG.H, Missing OS_MUTEX_QUERY_EN: Include code for OSMutexQuery()"
	 #endif
#endif

/*
*********************************************************************************************************
*                                              MESSAGE QUEUES
*********************************************************************************************************
*/

#ifndef OS_Q_EN
#error  "OS_CFG.H, Missing OS_Q_EN: Enable (1) or Disable (0) code generation for QUEUES"
#else
	 #ifndef OS_MAX_QS
	 #error  "OS_CFG.H, Missing OS_MAX_QS: Max. number of queue control blocks"
	 #else
		  #if     OS_MAX_QS == 0
		  #error  "OS_CFG.H, OS_MAX_QS must be > 0"
		  #endif
		  #if     OS_MAX_QS > 255
		  #error  "OS_CFG.H, OS_MAX_QS must be <= 255"
		  #endif
	 #endif

	 #ifndef OS_Q_ACCEPT_EN
	 #error  "OS_CFG.H, Missing OS_Q_ACCEPT_EN: Include code for OSQAccept()"
	 #endif

	 #ifndef OS_Q_DEL_EN
	 #error  "OS_CFG.H, Missing OS_Q_DEL_EN: Include code for OSQDel()"
	 #endif

	 #ifndef OS_Q_FLUSH_EN
	 #error  "OS_CFG.H, Missing OS_Q_FLUSH_EN: Include code for OSQFlush()"
	 #endif

	 #ifndef OS_Q_POST_EN
	 #error  "OS_CFG.H, Missing OS_Q_POST_EN: Include code for OSQPost()"
	 #endif

	 #ifndef OS_Q_POST_FRONT_EN
	 #error  "OS_CFG.H, Missing OS_Q_POST_FRONT_EN: Include code for OSQPostFront()"
	 #endif

	 #ifndef OS_Q_POST_OPT_EN
	 #error  "OS_CFG.H, Missing OS_Q_POST_OPT_EN: Include code for OSQPostOpt()"
	 #endif

	 #ifndef OS_Q_QUERY_EN
	 #error  "OS_CFG.H, Missing OS_Q_QUERY_EN: Include code for OSQQuery()"
	 #endif
#endif

/*
*********************************************************************************************************
*                                              SEMAPHORES
*********************************************************************************************************
*/

#ifndef OS_SEM_EN
#error  "OS_CFG.H, Missing OS_SEM_EN: Enable (1) or Disable (0) code generation for SEMAPHORES"
#else
	 #ifndef OS_SEM_ACCEPT_EN
	 #error  "OS_CFG.H, Missing OS_SEM_ACCEPT_EN: Include code for OSSemAccept()"
	 #endif

	 #ifndef OS_SEM_DEL_EN
	 #error  "OS_CFG.H, Missing OS_SEM_DEL_EN: Include code for OSSemDel()"
	 #endif

	 #ifndef OS_SEM_QUERY_EN
	 #error  "OS_CFG.H, Missing OS_SEM_QUERY_EN: Include code for OSSemQuery()"
	 #endif
#endif

/*
*********************************************************************************************************
*                                             TASK MANAGEMENT
*********************************************************************************************************
*/

#ifndef OS_MAX_TASKS
#error  "OS_CFG.H, Missing OS_MAX_TASKS: Max. number of tasks in your application"
#else
	 #if     OS_MAX_TASKS == 0
	 #error  "OS_CFG.H,         OS_MAX_TASKS must be >= 2"
	 #endif
	 #if     OS_MAX_TASKS > 63
	 #error  "OS_CFG.H,         OS_MAX_TASKS must be <= 63"
	 #endif
#endif

#ifndef OS_TASK_IDLE_STK_SIZE
#error  "OS_CFG.H, Missing OS_TASK_IDLE_STK_SIZE: Idle task stack size"
#endif

#ifndef OS_TASK_STAT_EN
#error  "OS_CFG.H, Missing OS_TASK_STAT_EN: Enable (1) or Disable(0) the statistics task"
#endif

#ifndef OS_TASK_STAT_STK_SIZE
#error  "OS_CFG.H, Missing OS_TASK_STAT_STK_SIZE: Statistics task stack size"
#endif

#ifndef OS_TASK_CHANGE_PRIO_EN
#error  "OS_CFG.H, Missing OS_TASK_CHANGE_PRIO_EN: Include code for OSTaskChangePrio()"
#endif

#ifndef OS_TASK_CREATE_EN
#error  "OS_CFG.H, Missing OS_TASK_CREATE_EN: Include code for OSTaskCreate()"
#endif

#ifndef OS_TASK_CREATE_EXT_EN
#error  "OS_CFG.H, Missing OS_TASK_CREATE_EXT_EN: Include code for OSTaskCreateExt()"
#endif

#ifndef OS_TASK_DEL_EN
#error  "OS_CFG.H, Missing OS_TASK_DEL_EN: Include code for OSTaskDel()"
#endif

#ifndef OS_TASK_SUSPEND_EN
#error  "OS_CFG.H, Missing OS_TASK_SUSPEND_EN: Include code for OSTaskSuspend() and OSTaskResume()"
#endif

#ifndef OS_TASK_QUERY_EN
#error  "OS_CFG.H, Missing OS_TASK_QUERY_EN: Include code for OSTaskQuery()"
#endif

/*
*********************************************************************************************************
*                                             TIME MANAGEMENT
*********************************************************************************************************
*/

#ifndef OS_TICKS_PER_SEC
#error  "OS_CFG.H, Missing OS_TICKS_PER_SEC: Sets the number of ticks in one second"
#endif

#ifndef OS_TIME_DLY_HMSM_EN
#error  "OS_CFG.H, Missing OS_TIME_DLY_HMSM_EN: Include code for OSTimeDlyHMSM()"
#endif

#ifndef OS_TIME_DLY_RESUME_EN
#error  "OS_CFG.H, Missing OS_TIME_DLY_RESUME_EN: Include code for OSTimeDlyResume()"
#endif

#ifndef OS_TIME_GET_SET_EN
#error  "OS_CFG.H, Missing OS_TIME_GET_SET_EN: Include code for OSTimeGet() and OSTimeSet()"
#endif

/*
*********************************************************************************************************
*                                            MISCELLANEOUS
*********************************************************************************************************
*/

#ifndef OS_MAX_EVENTS
#error  "OS_CFG.H, Missing OS_MAX_EVENTS: Max. number of event control blocks in your application"
#else
	 #if     OS_MAX_EVENTS == 0
	 #error  "OS_CFG.H, OS_MAX_EVENTS must be > 0"
	 #endif
	 #if     OS_MAX_EVENTS > 255
	 #error  "OS_CFG.H, OS_MAX_EVENTS must be <= 255"
	 #endif
#endif

#ifndef OS_LOWEST_PRIO
#error  "OS_CFG.H, Missing OS_LOWEST_PRIO: Defines the lowest priority that can be assigned"
#endif

#ifndef OS_ARG_CHK_EN
#error  "OS_CFG.H, Missing OS_ARG_CHK_EN: Enable (1) or Disable (0) argument checking"
#endif

#ifndef OS_CPU_HOOKS_EN
#error  "OS_CFG.H, Missing OS_CPU_HOOKS_EN: uC/OS-II hooks are found in the processor port files when 1"
#endif

#ifndef OS_SCHED_LOCK_EN
#error  "OS_CFG.H, Missing OS_SCHED_LOCK_EN: Include code for OSSchedLock() and OSSchedUnlock()"
#endif



#if RM_TASK_EN > 0
//==============================================================================================================================

/*
*************************************************************************************************
*                       rm.h                                                                    *
*                                                                                               *
*************************************************************************************************
*/

/*
**********************************************************************************************************
*                                      RM_TASK MISCELLANEOUS
**********************************************************************************************************
*/

#define RM_NO_ERR      2000
#define RM_NO_MORE_TCB 2001
#define RMTASK_FAILED  2002
#define RM_TASK_MAX    10

OS_EXT  OS_TCB           *RMOSTCBList;
OS_EXT  RM_TCB           *RMTCBFreeList;                      /* 指向空闲RMTCB控制块的指针           */
OS_EXT  RM_TCB           *RMTCBWaitList;                      /* 指向等待RM任务的指针                */
OS_EXT  RM_TCB           *RMTCBRunList;                      /* 指向等待RM任务的指针                */
OS_EXT  RM_TCB           RMTCBTbl[RM_TASK_MAX];
//OS_EXT  RM_TCB         *RMTCBPerioTbl[HIGHEST_PERIO + 1];   /* Table of pointers to created RM TCBs    */
											 /*定义RM任务的最大数目为10*/



/**********************************************************************************
*
*
*********************************************************************************
*/
INT8U  RMTaskCreate (void (*task)(void *pd),
							void *pdata,
							OS_STK *ptos,
							INT16U RMTASKStartTime,
							INT16U RMTASKInitTime,
							INT16U RMTASKPeriods,
							INT16U RMTASKInitPeriodsNum
						  );

INT8U  RMOS_TCBInit (OS_STK *ptos, OS_STK *pbos, INT16U id, INT32U stk_size, void *pext, INT16U opt , INT16U RMTASKPeriods, RM_TCB *prmtcb);

INT8U  RM_TCBInit (  INT16U RMTASKStartTime,
							INT16U RMTASKInitTime,
							INT16U RMTASKPeriods,
							INT16U RMTASKInitPeriodsNum,
							RM_TCB *prmtcb
							);

void prio();
static  void  OS_InitRMTCBList (void);
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -