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

📄 includes.h

📁 tms320c6201下的UCOS
💻 H
字号:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
*                                           MASTER INCLUDE FILE
*********************************************************************************************************
*/
#ifndef OS_MASTER_FILE
#include    "OS_CFG.H"
#include    "..\source\OS_CPU.H"

#include    "ucos_II.h"

#include <math.h>
#include <stdlib.h>
#include <time.h>
#include  "errormsg.h"







/*
*********************************************************************************************************
*                                              CONSTANTS, structs, typedefs
*********************************************************************************************************
*/

#define CPU_FREQUENCY 133000000
#define CLOCK_PER_SEC (CPU_FREQUENCY / 4) /* Depends on the CPU frequency, used by the timers */

#ifndef TRUE
#define  TRUE     ( 1 == 1)
#define  FALSE    ( !TRUE )
#endif

#define  NULL     0
#define  WAIT_ETERNALY     0
#define  NO_DATA_POINTER   0


#define _STR(x)   __STR(x)
#define __STR(x)  #x



typedef enum {
/* SYSTEM TASKS */
    SYSTEM_SUPERVISOR_PRIORITY     = 10 ,
    CLOCK_TASK_PRIORITY                 ,     
	TASK_ONE_PRIORITY,
	TASK_TWO_PRIORITY,
	TASK_THREE_PRIORITY,
	TASK_FOUR_PRIORITY,
	TASK_FIVE_PRIORITY,


	IDLE_TASK_PRIORITY              = 63
}
TASK_PRIORITIES;







/* DEBUG_VERSION 0 means no debug facilities */

#define DEBUG_VERSION	 0x0
#define PRINT_DBG        0

#define Min(a,b) ((a)<(b))?(a):(b)
#define Max(a,b) ((a)>(b))?(a):(b)

#define TIMEOUT_OF_ONE_MILLISECOND 1
typedef struct
{

INT32U            UnderflowValue,
				 *StackBuffer,        
				 LowBoundaryValue,
				 HighBoundaryValue,
				 StackDepth,
				 RoomLeftInStack;

} TASK_DATA ;

typedef struct
{
  TASK_DATA 

                 ForClock           		  ,         
				 ForSystemSupervisor		  ,
				 ForTaskOne,
				 ForTaskTwo,
				 ForTaskThree,
				 ForTaskFour,
				 ForTaskFive;

} TASK_STACK_S ;


#define QUEUE_MAX_SIZE   15

typedef struct
{
OS_EVENT          *Event;
void              *QueueElement[QUEUE_MAX_SIZE];
} QUEUE_DATA ;

typedef struct
{
  QUEUE_DATA 
                 ForMessageHandler_Input		  ,        /* Host Communication                           */
                 ForMessagesToHost		          ;        /* Host Communication                           */
				 

} QUEUE_S ;





/* OS_MAX_EVENTS : Maximum number of event control blocks in your application   is in ucos.h */


typedef struct
{
  OS_EVENT        *ForTheClockInterrupt,                          /* Pointer to Clock mailbox                   */
                  *ForTheHostPortInterrupt,
                  *ForCommunicationBetweenTask4_And_5 ;
} MAILBOX_S ;

typedef struct
{
  OS_EVENT    
				  *ForTaskThree;
} SEMAPHORE_S ;

typedef struct
{
  TASK_STACK_S Stack;
  SEMAPHORE_S  Semaphore ;
  MAILBOX_S    MailBox ;
  QUEUE_S      Queue   ;
} KERNEL_S ;

extern KERNEL_S     KERNEL;
extern SEMAPHORE_S  *Semaphore ;
extern MAILBOX_S    *MailBox   ;
extern QUEUE_S      *Queue     ;

#define CLOCK_TASK_STACK_SIZE     			 300          
#define SYSTEM_SUPERVISOR_TASK_STACK_SIZE	 300
#define TASK_ONE_STACK_SIZE  				 300
#define TASK_TWO_STACK_SIZE  				 300
#define TASK_THREE_STACK_SIZE  				 300
#define TASK_FOUR_STACK_SIZE  				 300
#define TASK_FIVE_STACK_SIZE  				 300













/*
*********************************************************************************************************
*                                             DATA TYPES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                              VARIABLES
*********************************************************************************************************
*/

extern volatile unsigned int Volatile_Value_Of_Illegal_Interrupt ;


/*
*********************************************************************************************************
*                                         FUNCTION PROTOTYPES
*********************************************************************************************************
*/

int ReturnCurrentDP( void )  ;



#endif

⌨️ 快捷键说明

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