D-Bug12 Customization Data
Customization Data Area
M68HC12A4EVB Evaluation Board — Rev. 1
User’s Manual
MOTOROLA
D-Bug12 Customization Data
139
table. The table consists of an array of
CmdTblEntry
s
.
Each
CmdTblEntry
in the auxiliary command table has this structure:
typedef struct {
const char *CommandStr;
/* pointer to the command */
/* string */
int (*ExecuteCmd)(int argC, char *argV[]);/* pointer to function that*/
/* implements the command */
} CmdTblEntry, * CmdTblEntryP;
As the
typedef
shows, the first field is a character pointer pointing to a null
terminated character array containing the command name. The command name
string must be in upper case. The second field, a function pointer, points to a
function that implements the new D-Bug12 command. The first parameter to
this function is a count of the number of command line arguments that the
command line interpreter found on the command line. This count includes the
command name itself. The command line may contain no more than a total of
10 parameters. The second function parameter is a pointer to an array of
char
*
. Each
char *
points to one of the command line parameters parsed by the
command line interpreter.
The function implementing the new command can report any error conditions
to the user in one of two ways.
•
If the error condition can be described by one of the error messages in the
enumerated constant list here, the user-defined command should return
the appropriate constant.
•
If some other message text needs to be conveyed to the user, the
command should communicate the error message directly to the user by
using the
printf()
function which is one of the available user callable
functions. In this case, the user-defined command should return an error
code of
noErr
.
enum Error {
noErr = 0 /* Define No Error */
WrongNumArgs = 6, /* Wrong Number of Arguments */
BadStartAddress = 7, /* Invalid Starting Address */
BadEndAddress = 8, /* Invalid Ending Address */
StartEndError = 9, /* Start Address Greater Than End Address */
BadHexData = 10, /* Invalid Hex Data */
DataSizeError = 11, /* Data Out Of Range */
NoTargetWrite = 12, /* Can't Write Target Memory */
};
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..
AR
CH
IVE
D B
Y F
RE
ES
CA
LE
SE
MI
CO
ND
UC
TO
R,
IN
C.