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

📄 ts_configuration.h

📁 freescale的基于802.15.4的无线通讯例程
💻 H
字号:
/*****************************************************************************
* This file contains Task_Scheduler configuration information defined by the
* user. 
*
*             
* (c) Copyright 2006, Freescale, Inc. All rights reserved.
*
* Freescale Semiconductor Confidential Proprietary
*
* No part of this document must be reproduced in any form - including copied,
* transcribed, printed or by any electronic means - without specific written
* permission from Freescale Semiconductor Denmark A/S.
*****************************************************************************/

#ifndef _TS_CONFIGURATION_
#define _TS_CONFIGURATION_

#ifndef gMacStandAlone_d
#define gMacStandAlone_d 0
#endif /* gMacStandAlone_d */

#include "EmbeddedTypes.h"
#include "TS_Interface.h"

/*Include header file for task prototype*/
#if (gMacStandAlone_d == 1)
#include "NwkMacInterface.h" /*for MAC task prototype*/
#else
#include "ZdoApsInterface.h" /*for APS task prototype*/
#include "NwkMacInterface.h" /*for MAC task prototype*/
#include "ZdoNwkInterface.h" /*for NWK task prototype*/
#include "AppAfInterface.h" /*for AF task prototype*/
#include "AppZdoInterface.h"      /*for ZDO task prototype*/
#endif /* gMacStandAlone_d */
#include "TMR_Interface.h" /*for TMR task prototype and TMR_Main prototye*/
#include "UART_Interface.h" /*for UART task prototype and UART_Main prototye*/

/*****************************************************************************
******************************************************************************
* Public macros
******************************************************************************
*****************************************************************************/
/*Note: added to avoid warnings*/ 
 
#ifndef gZtcIncluded_d
#define gZtcIncluded_d 0
#endif
/*****************************/
	
/*****************************************************************************
* Task Scheduler configuration
*****************************************************************************/
/*
* gHighestTaskID_c must be set to highest priority in the enum.
* currently TMR_Task is set with highest priority.
* gTimerTaskPriority_c is set from the priority enum taskPriority_tag.
* Do not edit this macro.
*/
#define gHighestTaskID_c     (gTimerTaskPriority_c)

#if (gSchedulerIntegration_d == 1)

/*****************************************************************************
* TSPollTimerTask() is called everytime by the scheduler to check for
* timeout.
* Note: Poll timer will support only one timeout per task.
* Light sleep must not be used in poll timer mode.
*****************************************************************************/
#if (gPolledTimers_d == 1)
  #define TSPollTimerTask() TMR_Main()
#else
  #define TSPollTimerTask() 
#endif

/*****************************************************************************
* TS_TaskCreate
*
* User may update this macro based on number of tasks based on 
* application requirement.
*
* Priority value 255 is highest priority and priority value 1 is low priority.
* Note: Priority 0 is used by TS_IdleTask.
*														
* Interface assumptions:
*
* Arguments:
* void
*
* Return value:
* No return value provided. 
*
* Revison history:
* date     Author   Comments
* ------   -------  --------
* 14092005 LS       Created
*****************************************************************************/

#if (gMacStandAlone_d == 1)
#define TS_TaskCreate		 \
    TS_Create(gIdleTaskPriority_c, TS_IdleTask); /*Do not change this line*/\
    TS_Create(gMacTaskPriority_c, Mlme_Main);	\
    TS_Create(gZAppTaskIDPriority_c, AppTask);\
    TS_Create(gUartTaskIDPriotity_c, UART_Main);  \
    TS_Create(gTimerTaskPriority_c, TMR_Task);
#else
#define TS_TaskCreate		 \
    TS_Create(gIdleTaskPriority_c, TS_IdleTask); /*Do not change this line*/\
    TS_Create(gZdoTaskPriority_c, Zdo_Main);	\
    TS_Create(gZdoStateMachineTaskPriority_c, ZDO_StateMachine);	\
    TS_Create(gAfTaskPriority_c, AF_Main);	\
    TS_Create(gApsTaskPriority_c, Aps_Main);	\
    TS_Create(gNwkTaskPriority_c, NwkLayer_Main);	\
    TS_Create(gMacTaskPriority_c, Mlme_Main);	\
    TS_Create(gZAppTaskIDPriority_c, ZAppTask);\
    TS_Create(gUartTaskIDPriotity_c, UART_Main);  \
    TS_Create(gTimerTaskPriority_c, TMR_Task);
#endif /* gMacStandAlone_d */ 

  
#endif /* gSchedulerIntegration_d */

/*****************************************************************************
******************************************************************************
* Public type definitions
******************************************************************************
*****************************************************************************/

/* Symbolic representation for task priority. User may change the enum names
   with the application task names. Task priority depends on the position in
   following enum.
*/
typedef enum {
  gIdleTaskPriority_c = 0,  /*Do not change this line*/
 
  /***************************************************************************
  * Application Tasks Priority are defined here *
  ***************************************************************************/
  gZAppTaskIDPriority_c,
  gZTCTaskIDPriotity_c, 
  gUartTaskIDPriotity_c,
  /****************************************************************************
  *  Following are BeeStack Tasks. Do not change task priority for following 
  *  tasks. These tasks must have priority more than other tasks. Do not add 
  *  any task after this, Timer Task must have highest priority.
  ****************************************************************************/  
  gAfTaskPriority_c,
  gZdoTaskPriority_c,
  gZdoStateMachineTaskPriority_c,
  gApsTaskPriority_c,
  gNwkTaskPriority_c, 
  gMacTaskPriority_c,
  gTimerTaskPriority_c  /* HIGHEST Priority */
}taskPriority_tag;

/* typedef for task priority. */
typedef taskPriority_tag taskPriority_t;
 
/*****************************************************************************
******************************************************************************
* Public prototypes
******************************************************************************
*****************************************************************************/

/*****************************************************************************
* TS_IdleTask will execute when there is no other task in the READY queue.
* Applcation may decide the usage of TS_IdleTask.
*
* NVM write operations, Power managements etc. are few features recommended
* from TS_IdleTask.
* 
* When Idle tasks scheduled for execution it can process all the events 
* received.
*
* TS_IdleTask is owned by application.
*
* Caution: TS_IdleTask tassk prototype and task name should not be changed.
*****************************************************************************/
extern void TS_IdleTask(event_t events);
extern void AppTask(event_t events);

#if (gSchedulerIntegration_d == 1)
/*****************************************************************************
* Following are User tasks or Application tasks. 
* Task scheduler users may change the task names based on applications.
*
* When application tasks scheduled for execution it cam process all the 
* events received.
*****************************************************************************/

extern void ZAppTask(event_t events);

#endif /*gSchedulerIntegration_d*/
/*****************************************************************************
* Task Create is used to introduce user or application tasks to the task 
* scheduler.
* 
* Task Create will update the task control block with the user task 
* information.
*
* Assumptions:
* TS_Create is intented to use only from TS_Configuration.h in TS_TaskCreate 
* macro.
* 
* Return value:
* None
*
* Revison history:
* date   Author Comments
* ------ ------ --------
* 201005  LS     Created
******************************************************************************/
void TS_Create(taskPriority_t taskPri,void(*pftaskEntryPoint)(event_t events));

#endif /*_TS_CONFIGURATION_*/

⌨️ 快捷键说明

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