interruptcalls.h

来自「freescale最新的16位单片机」· C头文件 代码 · 共 59 行

H
59
字号
/******************************************************************************
*
* Freescale Semiconductor Inc.
* (c) Copyright 2004-2006 Freescale Semiconductor, Inc.
* ALL RIGHTS RESERVED.
*
******************************************************************************!
*
* @file      interruptcalls.h
*
* @author    R89994
* 
* @version   1.0.3.0
* 
* @date      Apr-20-2006
* 
* @brief     definitions they are used in interruptcalls.c
*******************************************************************************/


typedef void (* far TaskFunction)();

typedef union {
  unsigned char counter ;
  unsigned char suspend ;
}Parameter    ;

typedef struct{
  TaskFunction pFunc      ;   // pointer to the handler
  Parameter spec          ;		// suspend task | tasks repeats
  int delay               ;
  char priority           ;
  char *name              ;   // Task name
  unsigned char *fm_action;
}TaskIdentifier;
/**********************************************************************************
*                             public functions                                    *
***********************************************************************************/
void EnableTask (char *taskName, char cycles);
void DisableTask (char *taskName);
void RunFunctions(char priority);
/******************************************************************************
*
*                   Macros and definitions
*
*******************************************************************************/
#define TASK_ARRAY_SIZE   32
#define MIN_PRIORITY      1
#define LOW_PRIORITY      2
#define MID_PRIOROTY      3
#define HIGH_PRIORITY     4

#define TASK_TABLE_BEGIN(id) TaskIdentifier TaskStructure1[] = {
#define TASK_TABLE_BODY(Fname, priority, cycnr, delnr, name) {(TaskFunction)(#Fname), Parameter cycnr, int delnr, char priority, char "#name"},
#define TASK_TABLE_END  };
#define CYCLES(cnr)     (cnr)
#define DELAY(dnr)      (dnr)
#define TASKNAME(name)  ("#name")
/******************************************************************************/

⌨️ 快捷键说明

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