OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [monitor/] [loadserv/] [loadserv.c] - Diff between revs 45 and 49

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;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.