static int buspirate_serial_setspeed(int fd, speed_t speed);
static int buspirate_serial_write(int fd, char *buf, int size);
static int buspirate_serial_read(int fd, char *buf, int size);
+static void buspirate_serial_close(int fd);
static void buspirate_print_buffer(char *buf, int size);
static int buspirate_speed(int speed)
buspirate_jtag_set_speed(buspirate_fd, SERIAL_NORMAL);
buspirate_jtag_reset(buspirate_fd);
+
+ buspirate_serial_close(buspirate_fd);
+
if (buspirate_port) {
free(buspirate_port);
buspirate_port = NULL;
return len;
}
+static void buspirate_serial_close(int fd)
+{
+ close(fd);
+}
+
#define LINE_SIZE 81
#define BYTES_PER_LINE 16
static void buspirate_print_buffer(char *buf, int size)