ATMEL全套MP3设计资料

源代码在线查看: scheduler.h

软件大小: 18143 K
上传用户: 狼狈
关键词: ATMEL MP3 设计资料
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*H**************************************************************************
				* $RCSfile: scheduler.h,v $
				*----------------------------------------------------------------------------
				* Copyright (c) 2002 Atmel.
				*----------------------------------------------------------------------------
				* RELEASE:      $Name: DEMO_FAT_1_9_9 $      
				* REVISION:     $Revision: 1.3 $     
				* FILE_CVSID:   $Id: scheduler.h,v 1.3 2002/06/06 15:33:00 ffosse Exp $       
				*----------------------------------------------------------------------------
				* PURPOSE:
				* This file contains the scheduler definition and the task function to be
				* executed by the scheduler
				*
				* NOTE:
				* SCHEDULER_TICK & FPER are defined in config.h
				*
				*****************************************************************************/
				
				#ifndef _SCHEDULER_H_
				#define _SCHEDULER_H_
				
				/*_____ I N C L U D E S ____________________________________________________*/
				
				#include "..\mode\mode_task.h"              /* mode task definition */
				#include "..\mem\mem_task.h"                /* memory task definition */
				#include "..\display\disp_task.h"           /* display task definition */
				#include "..\kbd\kbd_task.h"                /* memory task definition */
				#include "..\mass\usb_task.h"               /* usb task definition */
				
				
				/*_____ M A C R O S ________________________________________________________*/
				
				/*----- Scheduler Types -----*/
				#define SCH_TIMED       0
				#define SCH_TASK        1
				#define SCH_FREE        2
				
				/*----- Scheduler Timer -----*/
				#define SCH_TIMER0      0
				#define SCH_TIMER1      1
				#define SCH_TIMER2      2
				
				
				/*----- Scheduler Configuration -----*/
				#define SCH_TYPE        SCH_FREE        /* SCH_TIMED, SCH_TASK, SCH_FREE */
				#define SCH_TIMER       SCH_TIMER0      /* SCH_TIMER0, SCH_TIMER1, SCH_TIMER2 */
				
				/*----- Scheduler Timer Configuration -----*/
				#define TIM_ADJUST      (Byte)4         /* to be modified for timing adjustment */
				#define TIM_LOW         LOW(65536 - (SCHEDULER_TICK * (FPER / 6)) + TIM_ADJUST)
				#define TIM_HIGH        HIGH(65536 - (SCHEDULER_TICK * (FPER / 6)))
				
				/*----- Task Definitions -----*/
				#define Task_1_init()   mode_task_init()
				#define Task_2_init()   usb_task_init()
				#define Task_3_init()   mem_task_init()
				#define Task_4_init()   kbd_task_init()
				#define Task_5_init()   disp_task_init()
				#define Task_6_init()
				#define Task_7_init()
				#define Task_8_init()
				#define Task_9_init()
				#define Task_10_init()
				
				#define Task_1_fct()    mode_task()
				#define Task_2_fct()    usb_task()
				#define Task_3_fct()    mem_task()
				#define Task_4_fct()    kbd_task()
				#define Task_5_fct()    disp_task()
				#define Task_6_fct()
				#define Task_7_fct()
				#define Task_8_fct()
				#define Task_9_fct()
				#define Task_10_fct()
				
				
				/*_____ D E F I N I T I O N ________________________________________________*/
				
				
				/*_____ D E C L A R A T I O N ______________________________________________*/
				
				void    sch_scheduler_init(void);
				void    sch_scheduler(void);
				void    sch_default_fct (void);
				
				#if (SCH_TYPE == SCH_FREE)
				  #define Sch_new_schedule()
				  #define Sch_call_next_task()
				#elif (SCH_TYPE == SCH_TIMED)
				  #define Sch_new_schedule()      while (!sch_tick_flag); sch_tick_flag = FALSE
				  #define Sch_call_next_task()
				#elif (SCH_TYPE == SCH_TASK)
				  #define Sch_new_schedule()
				  #define Sch_call_next_task()    while (!sch_tick_flag); sch_tick_flag = FALSE
				#endif
				
				#endif /* _SCHEDULER_H_ */
							

相关资源