📄 sampletask.h
字号:
/*
* description : Sample Task Definitions
* Maker : Shuichi Yanagihara
* Copyright : (C)2005,SEIKO EPSON Corp. All Rights Reserved.
*/
#ifndef SAMPLE_TSK_H
#define SAMPLE_TSK_H
#include "SPRDEF.h"
#include "OSCall.h"
#include "wrapTPS.h"
//--------------------------------------------------------------------------
// Task setting value
//--------------------------------------------------------------------------
#define TSK_EXINFO_SAMPLE (NULL)
#define TSK_ATTRIBUTE_SAMPLE (OS_TA_HLNG)
#define TSK_PRIORITY_SAMPLE (3)
#define TSK_STACK_SIZE_SAMPLE (1024)
#define TSK_STACK_ADD_SAMPLE (0)
//--------------------------------------------------------------------------
// Memory pool with fix length used for message transmitting
//--------------------------------------------------------------------------
#define MPF_ATTRIBUTE_SAMPLE_MSG (OS_TA_TFIFO) // Attribute
#define MPF_BLOCK_CNT_SAMPLE_MSG (8) // Number of blocks
#define MPF_BLOCK_SIZE_SAMPLE_MSG (44 + TMSGSIZE) // Block size
#define MPF_BLOCK_ADD_SAMPLE_MSG (NULL) // Block address
//--------------------------------------------------------------------------
// Mail box
//--------------------------------------------------------------------------
#define MBX_ATTRIBUTE_SAMPLE (OS_TA_TFIFO) // Attribute
#define MBX_MAX_PRI_SAMPLE (1) // Max value of priority
#define MBX_PRI_ADD_SAMPLE (NULL) // Address of message queue header
#define MSG_SAMPLE_DATASIZE (32) // Size of message data part
// Structure decalaration of mail box header
typedef struct _MSGHEAD{ /* Message common header */
OS_T_MSG header; /* Area for OS use */
OS_ID useMpfId; /* Memory pool ID to use */
OS_ID msgSndTskId; /* Task ID of transmitter*/
USHORT msgNo; /* Message number */
USHORT msgLength; /* Message data length */
}MSGHEAD, *PMSGHEAD;
// Mail box structure decalaration
typedef struct _SAMPLE_MSG{ /* HostSample task mail box */
MSGHEAD msgHead; /* Message header part */
UCHAR msgData[MSG_SAMPLE_DATASIZE]; /* Message data part */
} SAMPLE_MSG, *PSAMPLE_MSG;
//--------------------------------------------------------------------------
// Sample event flag
//--------------------------------------------------------------------------
#define FLG_ATTRIBUTE_SAMPLE (OS_TA_TFIFO) // Attribute
#define FLG_PATTERN_SAMPLE (0) // Initial value of bit pattern
// Event flag bit definition
#define FLG_EVENT_FORCE_SAMPLE 0x80000000 // ( bit31 ) forced process event
#define FLG_EVENT_INT_SAMPLE 0x08000000 // ( bit27 ) interrupt process event
#define FLG_EVENT_MSG_SAMPLE 0x00000001 // ( bit0 ) message process event
/* Synchronization flag between API and Task */
#define FLG_EVENT_HOSDEVSEL_SAMPLE 0x00010000 // ( bit16 ) USB action start process event
// Event flag waiting pattern
#define FLG_WAIT_PTN_SAMPLE ( FLG_EVENT_FORCE_SAMPLE | FLG_EVENT_INT_SAMPLE | FLG_EVENT_MSG_SAMPLE | FLG_EVENT_HOSDEVSEL_SAMPLE )
/*
* Function prototype declaration
*/
extern void SampleTask( void );
#endif /* SAMPLE_TSK_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -