Remove serial_init C code

This commit is contained in:
Greg Shuflin 2021-03-04 00:54:54 -08:00
parent fc45f65a52
commit 9015d9f8e0

View File

@ -55,7 +55,7 @@
# include <IOKit/serial/IOSerialKeys.h> # include <IOKit/serial/IOSerialKeys.h>
#endif #endif
static char *dev_path; //static char *dev_path;
static const unsigned char CMD_PRG[] = "PROGRAM"; static const unsigned char CMD_PRG[] = "PROGRAM";
static const unsigned char CMD_PRG2[] = "\2"; static const unsigned char CMD_PRG2[] = "\2";
@ -576,21 +576,6 @@ char *find_path(int vid, int pid)
// Connect to the specified device. // Connect to the specified device.
// Initiate the programming session. // Initiate the programming session.
// //
int serial_init(int vid, int pid)
{
dev_path = find_path(vid, pid);
if (!dev_path) {
if (trace_flag) {
fprintf(stderr, "Cannot find USB device %04x:%04x\n",
vid, pid);
}
return -1;
}
// Succeeded.
printf("Serial port: %s\n", dev_path);
return 0;
}
// //
// Send the command sequence and get back a response. // Send the command sequence and get back a response.
@ -612,7 +597,8 @@ static int send_recv(const unsigned char *cmd, int cmdlen,
} }
if (serial_write(cmd, cmdlen) < 0) { if (serial_write(cmd, cmdlen) < 0) {
fprintf(stderr, "%s: write error\n", dev_path); //fprintf(stderr, "%s: write error\n", dev_path);
fprintf(stderr, "serial write error\n");
exit(-1); exit(-1);
} }