3 Creating Application Software
3.1 Rules for Creating Program Source Code
3-1
HW1484528
HW1484528
3 Creating Application Software
3.1 Rules for Creating Program Source Code
Be sure to observe the following rules when creating the source code.
Refer to “YRC1000micro OPTIONS INSTRUCTIONS Programmer’s
Manual For New Language Environment MotoPlus (HW1484526)” for
detailed information on programming configuration, files to be included,
and sample programs.
Please remember that the source code should follow ANSI-C syntax. The
only exception is that users should not define a “main (…)” function. This
is replaced by “mpUsrRoot(…)”.
1. Up to 32 one-byte characters can be used for a file name. Up to 16
two-byte characters can also be used. File names are case-sensitive.
Set “.c” as the extension.
2. Put “#include<MotoPlus.h>” at the top of each source code file. When
“MotoPlus.h” is included, the information of all services provided by
MotoPlus is included.
3. The application entry point is the function which is called from the
system software when the YRC1000micro is started. This function
must be described as:
void mpUsrRoot (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6,
int arg7, int arg8, int arg9, int arg10)
Be sure to describe mpExitUserRoot at the end of the mpUserRoot
function.
void mpUsrRoot (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6,
int arg7, int arg8, int arg9, int arg10)
{
/* 10 parameters from arg1 to arg10*/
·
mpExitUsrRoot;// End of mpUsrRoot program (End of the task)
}
e.g. filename: abc.c
* The original argument of arg1 to arg10 is mpUsrRoot. arg1 to arg10
are prepared to receive arguments in the future.
At present, arg1 is the function name of the user entry, and arg2 to
arg 10 are reserved for the manufacturer (if referenced, all of them
are “0”).