36
"C" Programming Guide For Optimus S/R
LoadProgram
Purpose
To download a user program (.SHX) to flash memory.
Syntax
void LoadProgram (int Prog);
int Prog; /* 1 ~ 6, represents one of the 6 resident locations */
Example
LoadProgram (3); /* load the user program to location #3 */
Description
Upon calling this routine, the system exists the user application and enters the
Program Manager menu > Download page immediately.
Simply choose "Download Via" and then "Baud Rate" in order to download the
user program to the specified location.
Return
None
See Also
ActivateProgram, ProgramInfo, ProgramManager
ProgramInfo
Purpose
To list program information.
Syntax
int ProgramInfo (int slot, char *programtype, char *programname);
int slot; /* 1 ~ 6, represents one of the 6 resident locations */
char *programtype; /* pointer to a buffer where program type is stored */
char *programname; /* pointer to a buffer where program name is stored */
Example
val = ProgramInfo (2, typebuffer, namebuffer);
Description
This routine retrieves program information including its size and name.
The program size, in kilo-bytes, depends on how many memory banks one
program occupies.
The program name is the same one as shown in the menu of Program
Manager.
The file type will be returned with a small letter: "c" for a C program, "b"
for a BASIC program, and "f" for a font file.
Since one bank is 64 KB, the return value will be 64, 128, ..., etc.
Return
If successful, it returns the bank size of program.
Otherwise, it returns 0 to indicate the program does not exist.
See Also
ActivateProgram, LoadProgram, ProgramManager
ProgramManager
Purpose
To enter the kernel and bring up the menu of Program Manager.
Syntax
void ProgramManager (void);
Example
ProgramManager(); /* jump to the menu of Program Manager */
Summary of Contents for Optimus R
Page 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Page 6: ......
Page 8: ...2 C Programming Guide For Optimus S R...
Page 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Page 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Page 24: ...18 C Programming Guide For Optimus S R...
Page 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...