Simple example |
Top Previous Next |
This example shows how to load a file and automatically program it and display the result.
#include <system.h> #include <mprog.h>
void main() {
LoadProgram("test.hex", F_HEX, SubLevel(0, 0)); // load file "test.hex" that is an Intel HEX file // to buffer 0, sub-level 0 InsertTest = TRUE; // set testing of chip presence to "on" if (ExecFunction("Auto Programming") == EF_OK) // perform an automatic programming { if (ExecFunction("Verify", SubLevel(0, 0), 10) != EF_OK) // verify 10 times { printf("Verify failed: %s", LastErrorMessage); // display error message if verify failed return; // terminate script } printf("Verify ok."); // display Ok result } else printf("Programming failed: %s", LastErrorMessage); // display error message }
|