Signed-off-by: Michal Demin <michaldemin@gmail.com>
static void buspirate_jtag_get_adcs(int);
/* low level HW communication interface */
static void buspirate_jtag_get_adcs(int);
/* low level HW communication interface */
-static int buspirate_serial_setspeed(int fd, speed_t speed);
+static int buspirate_serial_open(char *port);
+static int buspirate_serial_setspeed(int fd, char 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 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);
return ERROR_JTAG_INIT_FAILED;
}
return ERROR_JTAG_INIT_FAILED;
}
- buspirate_fd = open(buspirate_port, O_RDWR | O_NOCTTY);
+ buspirate_fd = buspirate_serial_open(buspirate_port);
if (buspirate_fd == -1) {
LOG_ERROR("Could not open serial port.");
return ERROR_JTAG_INIT_FAILED;
}
if (buspirate_fd == -1) {
LOG_ERROR("Could not open serial port.");
return ERROR_JTAG_INIT_FAILED;
}
- buspirate_serial_setspeed(buspirate_fd, B115200);
+ buspirate_serial_setspeed(buspirate_fd, SERIAL_NORMAL);
buspirate_jtag_enable(buspirate_fd);
buspirate_jtag_enable(buspirate_fd);
int ret;
char tmp[2];
char ack[2];
int ret;
char tmp[2];
char ack[2];
- speed_t baudrate = B115200;
ack[0] = 0xAA;
ack[1] = 0x55;
ack[0] = 0xAA;
ack[1] = 0x55;
buspirate_jtag_command(fd, tmp, 2);
/* here the adapter changes speed, we need follow */
buspirate_jtag_command(fd, tmp, 2);
/* here the adapter changes speed, we need follow */
- if (speed == SERIAL_FAST)
- baudrate = B1000000;
-
- buspirate_serial_setspeed(fd, baudrate);
+ buspirate_serial_setspeed(fd, speed);
buspirate_serial_write(fd, ack, 2);
ret = buspirate_serial_read(fd, tmp, 2);
buspirate_serial_write(fd, ack, 2);
ret = buspirate_serial_read(fd, tmp, 2);
/* low level serial port */
/* TODO add support for WIN32 and others ! */
/* low level serial port */
/* TODO add support for WIN32 and others ! */
-static int buspirate_serial_setspeed(int fd, speed_t speed)
+static int buspirate_serial_open(char *port)
+{
+ int fd;
+ fd = open(buspirate_port, O_RDWR | O_NOCTTY | O_NDELAY);
+ return fd;
+}
+
+static int buspirate_serial_setspeed(int fd, char speed)
+ speed_t baud = (speed == SERIAL_FAST) ? B1000000 : B115200;
/* set the serial port parameters */
fcntl(fd, F_SETFL, 0);
tcgetattr(fd, &t_opt);
/* set the serial port parameters */
fcntl(fd, F_SETFL, 0);
tcgetattr(fd, &t_opt);
- cfsetispeed(&t_opt, speed);
- cfsetospeed(&t_opt, speed);
+ cfsetispeed(&t_opt, baud);
+ cfsetospeed(&t_opt, baud);
t_opt.c_cflag |= (CLOCAL | CREAD);
t_opt.c_cflag &= ~PARENB;
t_opt.c_cflag &= ~CSTOPB;
t_opt.c_cflag |= (CLOCAL | CREAD);
t_opt.c_cflag &= ~PARENB;
t_opt.c_cflag &= ~CSTOPB;
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)