URL
https://opencores.org/ocsvn/eco32/eco32/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 45 |
Rev 49 |
Line 112... |
Line 112... |
printf("connected\n");
|
printf("connected\n");
|
}
|
}
|
|
|
|
|
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
|
char *serialPort;
|
char *loadName;
|
char *loadName;
|
unsigned char b;
|
unsigned char b;
|
unsigned char cmd;
|
unsigned char cmd;
|
char line[LINE_SIZE];
|
char line[LINE_SIZE];
|
int n, i;
|
int n, i;
|
|
|
if (argc != 3) {
|
if (argc != 3) {
|
printf("Usage: %s <serial port> <file to be loaded>\n", argv[0]);
|
printf("Usage: %s <serial port> <file to be loaded>\n", argv[0]);
|
exit(1);
|
exit(1);
|
}
|
}
|
|
serialPort = argv[1];
|
loadName = argv[2];
|
loadName = argv[2];
|
loadFile = fopen(loadName, "rt");
|
loadFile = fopen(loadName, "rt");
|
if (loadFile == NULL) {
|
if (loadFile == NULL) {
|
error("cannot open file to be loaded '%s'", loadName);
|
error("cannot open file to be loaded '%s'", loadName);
|
}
|
}
|
/* open serial interface */
|
/* open serial interface */
|
serialOpen(argv[1]);
|
serialOpen(serialPort);
|
/* wait for client to connect */
|
/* wait for client to connect */
|
printf("Waiting for client...\n");
|
printf("Waiting for client...\n");
|
while (1) {
|
while (1) {
|
if (serialRcv(&b) && b == SYN) {
|
if (serialRcv(&b) && b == SYN) {
|
break;
|
break;
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.