📄 debugtask.h
字号:
/*
* description :
* Maker :
* Copyright : (C)2004,SEIKO EPSON Corp. All Rights Reserved.
*/
#ifndef DBG_TASK_H
#define DBG_TASK_H
#include "SPRDEF.h"
#include "OSCall.h"
/*
* Function prototype declaration
*/
// DEBUG Task task
#define TSK_EXINFO_DBG (NULL)
#define TSK_ATTRIBUTE_DBG (OS_TA_HLNG)
#define TSK_PRIORITY_DBG (3)
#define TSK_STACK_SIZE_DBG (1024*2)
#define TSK_STACK_ADD_DBG (0)
// DBG Task memory pool with fix length for use of transmitting message
#define MPF_ATTRIBUTE_DBG_MSG (OS_TA_TFIFO)
#define MPF_BLOCK_CNT_DBG_MSG (3)
//#define MPF_BLOCK_SIZE_DBG_MSG (100)
#define MPF_BLOCK_SIZE_DBG_MSG (300)
#define MPF_BLOCK_ADD_DBG_MSG (NULL)
// DBG Task mail box
#define MBX_ATTRIBUTE_DBG (OS_TA_TFIFO)
#define MBX_MAX_PRI_DBG (0)
#define MBX_PRI_ADD_DBG (NULL)
/*====================================*/
/* Define */
/*====================================*/
/* STR-MAX-LENGTH */
#define DBG_STR_MAX (82) // Max saving number for receiving string
/* PRINT MODE */
#define PRINT_DECIMAL_MODE (10) // Decimal output mode
#define PRINT_HEXA_MODE (16) // Hexadecimal output mode
/* DBG State */
#define DBG_STATE_INITIAL (00) // Inital state
#define DBG_STATE_WAIT_KEY_IN (01) // Waiting state for receiving string
#define DBG_STATE_STR_RCV (02) // Waiting state for receiving string
#define DBG_STATE_STR_ANALYSIS (03) // State of command analysis
#define DBG_STATE_CMD_PRACTICE (04) // State of command execution
#define DBG_STATE_KEY_INPUT (05) // Waiting state for keybord input
#define DBG_STATE_ERROR (99) // Error state
/* Store Area Size */
#define DBG_STORE_BYTE (01) // Byte
#define DBG_STORE_WORD (02) // Word
#define DBG_STORE_DWORD (04) // Double word
/* Watch Table Size */
#define DBG_WATCH_SIZE (20) // Max number of memory registration
/* Initial value for flow output ( current is FALSE ) */
#define DBG_FLOW_DEFAULT (TRUE) // Initial value for flow output
// #define DBG_FLOW_DEFAULT (FALSE) //Initial value for flow output
/* Command ID */
// Dump
#define DBG_CMDID_DUMP_BYTE (1) // Dump byte commmand
#define DBG_CMDID_DUMP_WORD (2) // Dump word commmand
#define DBG_CMDID_DUMP_DWORD (3) // Dump double word commmand
// Enter
#define DBG_CMDID_ENTER_BYTE (4) // Enter-byte command
#define DBG_CMDID_ENTER_WORD (5) // Enter-word command
#define DBG_CMDID_ENTER_DWORD (6) // Enter-bouble word command
// Watch
#define DBG_CMDID_WATCH (7) // Watch command
#define DBG_CMDID_WATCH_CLEAR (8) // Watch-clear command
// Flow
#define DBG_CMDID_FLOW (9) // Flow command
// Help
#define DBG_CMDID_HELP (10) // Help command
// IDE
#define DBG_CMDID_IDE_MODE (11) // IDE mode command ( hidden command )
// Information
#define DBG_CMDID_INFO (90) // Each command header information
/*** Debug Module Status Error Define ***/
/* Success */
#define DBG_STATUS_SUCCESS ( 0L )
/* No address inputted */
#define DBG_STATUS_NOADDRESS ( 1L )
/* No data inputted */
#define DBG_STATUS_NODATA ( 2L )
/* No input */
#define DBG_STATUS_NOINPUT ( 3L )
/* General error status */
#define DBG_STATUS_UNSUCCESSFUL ( -1L )
/* Invalid command error */
#define DBG_STATUS_INVALID_COMMAND ( -2L )
/* Invalid address error */
#define DBG_STATUS_INVALID_ADDRESS ( -3L )
/* Invalid deta error */
#define DBG_STATUS_INVALID_DATA ( -4L )
/* Parameter error */
#define DBG_STATUS_PARAM_ERROR ( -5L )
/* State error */
#define DBG_STATUS_STATE_ERROR ( -6L )
/* Specified port is not exist */
#define DBG_STATUS_NO_EXISTENCE_PORT ( -7L )
/*====================================*/
/* Typedef */
/*====================================*/
typedef LONG (*pfnCmdProc) (LONG add); // Function be called
/* Table for watch registration */
typedef struct _DBG_WATCH_DATA
{
int iSetCnt; // Registration number of watches
struct
{
CHAR name[DBG_STR_MAX]; // Watch name to specify
UCHAR size; // Watch size to specify
UCHAR* address; // Watch address to specify
} watchMember [DBG_WATCH_SIZE];
} DBG_WATCH_DATA;
/* Command information table */
typedef struct _TBL_CMD_INFO
{
CHAR* pString; /* Command string */
USHORT cmdId; /* Command ID */
pfnCmdProc cCmdProc; /* Function be called*/
CHAR* info1; /* Additional information1 */
CHAR* info2; /* Additional information2 */
} TBL_CMD_INFO;
/* Message header */
typedef struct _MSG_DBG_HEAD{ /* Message common header */
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 */
}MSG_DBG_HEAD, *PMSG_DBG_HEAD;
typedef struct _DBG_MSG{ /* DBG task mail box */
MSG_DBG_HEAD head; /* Message header part */
CHAR pMsgData[DBG_STR_MAX]; /* Message data part */
} DBG_MSG, *PDBG_MSG;
/*====================================*/
/* Function prototype */
/*====================================*/
extern void DebugTask( void );
// Debug Task Application proguraminng Interface
LONG WatchSetData( const UCHAR* pName, UCHAR size, const UCHAR* pAddress);
LONG FlowStrPrint( CHAR* pString , UCHAR level);
LONG FlowValPrint( UCHAR printType, UCHAR dataSize, LONG value , UCHAR level);
LONG FlowPrint( CHAR* pString, UCHAR printType, UCHAR dataSize, LONG value , UCHAR level);
LONG FlowGetStrCmp( const UCHAR* pString, USHORT dataSize, OS_TMO tmout ); // Waiting for string input including comparison
LONG FlowGetStr( CHAR* pString, USHORT* pDataSize, OS_TMO tmout ); // Waiting for string input.
// Added for analog evaluation.
LONG FlowKeyHit( CALLBACK_PROC pfnCallback );
#define DBG_WatchSetData(a,b,c) WatchSetData(a,b,c)
#define DBG_FlowStrPrint(a,b) FlowStrPrint(a,b )
#define DBG_FlowValPrint( a,b,c,d ) FlowValPrint(a,b,c,d)
#define DBG_FlowPrint( a,b,c,d,e ) FlowPrint(a,b,c,d,e)
#define DBG_FlowGetStrCmp( a, b, c ) FlowGetStrCmp( a, b, c );
#define DBG_FlowGetStr( a, b, c ) FlowGetStr( a, b, c );
/* Functions be called */
LONG FuncCmdProcDB( LONG add );
LONG FuncCmdProcDW( LONG add );
LONG FuncCmdProcDD( LONG add );
LONG FuncCmdProcEB( LONG add );
LONG FuncCmdProcEW( LONG add );
LONG FuncCmdProcED( LONG add );
LONG FuncCmdProcWT( LONG add );
LONG FuncCmdProcWTC( LONG add );
LONG FuncCmdProcFlow( LONG add );
LONG FuncCmdProcHelp( LONG add );
LONG FuncCmdProcIDEMode( LONG add );
#endif /* DBG_TASK_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -