rlink: fix indentation errors
Indentation was inconsistent and some lines not indented at all. Quickfix using Eclipse's auto-indentation. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
parent
827057f560
commit
068c9f266e
|
@ -135,14 +135,14 @@ ep1_generic_commandl(
|
||||||
usb_buffer_p,
|
usb_buffer_p,
|
||||||
0,
|
0,
|
||||||
sizeof(usb_buffer) - (usb_buffer_p - usb_buffer)
|
sizeof(usb_buffer) - (usb_buffer_p - usb_buffer)
|
||||||
);
|
);
|
||||||
|
|
||||||
usb_ret = usb_bulk_write(
|
usb_ret = usb_bulk_write(
|
||||||
pHDev_param,
|
pHDev_param,
|
||||||
USB_EP1OUT_ADDR,
|
USB_EP1OUT_ADDR,
|
||||||
(char *)usb_buffer, sizeof(usb_buffer),
|
(char *)usb_buffer, sizeof(usb_buffer),
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
return(usb_ret);
|
return(usb_ret);
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ ep1_memory_read(
|
||||||
usb_buffer + 4,
|
usb_buffer + 4,
|
||||||
0,
|
0,
|
||||||
sizeof(usb_buffer) - 4
|
sizeof(usb_buffer) - 4
|
||||||
);
|
);
|
||||||
|
|
||||||
remain = length;
|
remain = length;
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -188,7 +188,7 @@ ep1_memory_read(
|
||||||
pHDev, USB_EP1OUT_ADDR,
|
pHDev, USB_EP1OUT_ADDR,
|
||||||
usb_buffer, sizeof(usb_buffer),
|
usb_buffer, sizeof(usb_buffer),
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
if (usb_ret < sizeof(usb_buffer)) {
|
if (usb_ret < sizeof(usb_buffer)) {
|
||||||
break;
|
break;
|
||||||
|
@ -198,7 +198,7 @@ ep1_memory_read(
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
buffer, length,
|
buffer, length,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
if (usb_ret < length) {
|
if (usb_ret < length) {
|
||||||
break;
|
break;
|
||||||
|
@ -248,18 +248,18 @@ ep1_memory_write(
|
||||||
usb_buffer + 4,
|
usb_buffer + 4,
|
||||||
buffer,
|
buffer,
|
||||||
length
|
length
|
||||||
);
|
);
|
||||||
memset(
|
memset(
|
||||||
usb_buffer + 4 + length,
|
usb_buffer + 4 + length,
|
||||||
0,
|
0,
|
||||||
sizeof(usb_buffer) - 4 - length
|
sizeof(usb_buffer) - 4 - length
|
||||||
);
|
);
|
||||||
|
|
||||||
usb_ret = usb_bulk_write(
|
usb_ret = usb_bulk_write(
|
||||||
pHDev_param, USB_EP1OUT_ADDR,
|
pHDev_param, USB_EP1OUT_ADDR,
|
||||||
(char *)usb_buffer, sizeof(usb_buffer),
|
(char *)usb_buffer, sizeof(usb_buffer),
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
if ((size_t)usb_ret < sizeof(usb_buffer)) {
|
if ((size_t)usb_ret < sizeof(usb_buffer)) {
|
||||||
break;
|
break;
|
||||||
|
@ -343,7 +343,7 @@ dtc_load_from_buffer(
|
||||||
usb_err = ep1_generic_commandl(
|
usb_err = ep1_generic_commandl(
|
||||||
pHDev_param, 1,
|
pHDev_param, 1,
|
||||||
EP1_CMD_DTC_STOP
|
EP1_CMD_DTC_STOP
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
while (length) {
|
while (length) {
|
||||||
|
@ -378,7 +378,7 @@ dtc_load_from_buffer(
|
||||||
pHDev_param,
|
pHDev_param,
|
||||||
DTC_LOAD_BUFFER,
|
DTC_LOAD_BUFFER,
|
||||||
header->length + 1, buffer
|
header->length + 1, buffer
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
/* Load it into the DTC. */
|
/* Load it into the DTC. */
|
||||||
|
@ -387,7 +387,7 @@ dtc_load_from_buffer(
|
||||||
EP1_CMD_DTC_LOAD,
|
EP1_CMD_DTC_LOAD,
|
||||||
(DTC_LOAD_BUFFER >> 8),
|
(DTC_LOAD_BUFFER >> 8),
|
||||||
DTC_LOAD_BUFFER
|
DTC_LOAD_BUFFER
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -398,7 +398,7 @@ dtc_load_from_buffer(
|
||||||
EP1_CMD_DTC_CALL,
|
EP1_CMD_DTC_CALL,
|
||||||
buffer[0],
|
buffer[0],
|
||||||
EP1_CMD_DTC_WAIT
|
EP1_CMD_DTC_WAIT
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -412,7 +412,7 @@ dtc_load_from_buffer(
|
||||||
pHDev_param,
|
pHDev_param,
|
||||||
ST7_USB_BUF_EP0OUT + lut_start,
|
ST7_USB_BUF_EP0OUT + lut_start,
|
||||||
header->length + 1, buffer
|
header->length + 1, buffer
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -450,7 +450,7 @@ dtc_start_download(void) {
|
||||||
ST7_EP2TXR >> 8,
|
ST7_EP2TXR >> 8,
|
||||||
ST7_EP2TXR,
|
ST7_EP2TXR,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
/* read back ep2txr */
|
/* read back ep2txr */
|
||||||
|
@ -458,7 +458,7 @@ dtc_start_download(void) {
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
(char *)&ep2txr, 1,
|
(char *)&ep2txr, 1,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
usb_err = ep1_generic_commandl(
|
usb_err = ep1_generic_commandl(
|
||||||
|
@ -477,7 +477,7 @@ dtc_start_download(void) {
|
||||||
EP1_CMD_DTC_CALL, /* start running the DTC */
|
EP1_CMD_DTC_CALL, /* start running the DTC */
|
||||||
dtc_entry_download,
|
dtc_entry_download,
|
||||||
EP1_CMD_DTC_GET_CACHED_STATUS
|
EP1_CMD_DTC_GET_CACHED_STATUS
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
/* wait for completion */
|
/* wait for completion */
|
||||||
|
@ -485,7 +485,7 @@ dtc_start_download(void) {
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
(char *)&ep2txr, 1,
|
(char *)&ep2txr, 1,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
return(usb_err);
|
return(usb_err);
|
||||||
}
|
}
|
||||||
|
@ -511,7 +511,7 @@ dtc_run_download(
|
||||||
USB_EP2OUT_ADDR,
|
USB_EP2OUT_ADDR,
|
||||||
(char *)command_buffer, USB_EP2BANK_SIZE,
|
(char *)command_buffer, USB_EP2BANK_SIZE,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
|
|
||||||
|
@ -524,7 +524,7 @@ dtc_run_download(
|
||||||
DTC_STATUS_POLL_BYTE >> 8,
|
DTC_STATUS_POLL_BYTE >> 8,
|
||||||
DTC_STATUS_POLL_BYTE,
|
DTC_STATUS_POLL_BYTE,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
usb_err = usb_bulk_read(
|
usb_err = usb_bulk_read(
|
||||||
|
@ -532,7 +532,7 @@ dtc_run_download(
|
||||||
USB_EP1IN_ADDR,
|
USB_EP1IN_ADDR,
|
||||||
(char *)ep2_buffer, 1,
|
(char *)ep2_buffer, 1,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
if (usb_err < 0) return(usb_err);
|
if (usb_err < 0) return(usb_err);
|
||||||
|
|
||||||
if (ep2_buffer[0] & 0x01) break;
|
if (ep2_buffer[0] & 0x01) break;
|
||||||
|
@ -540,7 +540,7 @@ dtc_run_download(
|
||||||
if (!--i) {
|
if (!--i) {
|
||||||
LOG_ERROR("%s, %d: too many retries waiting for DTC status",
|
LOG_ERROR("%s, %d: too many retries waiting for DTC status",
|
||||||
__FILE__, __LINE__
|
__FILE__, __LINE__
|
||||||
);
|
);
|
||||||
return(-ETIMEDOUT);
|
return(-ETIMEDOUT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -553,12 +553,12 @@ dtc_run_download(
|
||||||
USB_EP2IN_ADDR,
|
USB_EP2IN_ADDR,
|
||||||
(char *)ep2_buffer, sizeof(ep2_buffer),
|
(char *)ep2_buffer, sizeof(ep2_buffer),
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
if (usb_err < (int)sizeof(ep2_buffer)) {
|
if (usb_err < (int)sizeof(ep2_buffer)) {
|
||||||
LOG_ERROR("%s, %d: Read of endpoint 2 returned %d",
|
LOG_ERROR("%s, %d: Read of endpoint 2 returned %d",
|
||||||
__FILE__, __LINE__, usb_err
|
__FILE__, __LINE__, usb_err
|
||||||
);
|
);
|
||||||
return(usb_err);
|
return(usb_err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,7 +664,7 @@ dtc_queue_enqueue_reply(
|
||||||
/*
|
/*
|
||||||
* Running the queue means that any pending command buffer is run and any reply data dealt with. The command buffer is then cleared for subsequent processing.
|
* Running the queue means that any pending command buffer is run and any reply data dealt with. The command buffer is then cleared for subsequent processing.
|
||||||
* The queue is automatically run by append when it is necessary to get space for the append.
|
* The queue is automatically run by append when it is necessary to get space for the append.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static
|
static
|
||||||
int
|
int
|
||||||
|
@ -689,7 +689,7 @@ dtc_queue_run(void) {
|
||||||
usb_err = dtc_run_download(pHDev,
|
usb_err = dtc_run_download(pHDev,
|
||||||
dtc_queue.cmd_buffer, dtc_queue.cmd_index,
|
dtc_queue.cmd_buffer, dtc_queue.cmd_index,
|
||||||
NULL, 0
|
NULL, 0
|
||||||
);
|
);
|
||||||
if (usb_err < 0) {
|
if (usb_err < 0) {
|
||||||
LOG_ERROR("dtc_run_download: %s", usb_strerror());
|
LOG_ERROR("dtc_run_download: %s", usb_strerror());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -698,7 +698,7 @@ dtc_queue_run(void) {
|
||||||
usb_err = dtc_run_download(pHDev,
|
usb_err = dtc_run_download(pHDev,
|
||||||
dtc_queue.cmd_buffer, dtc_queue.cmd_index,
|
dtc_queue.cmd_buffer, dtc_queue.cmd_index,
|
||||||
reply_buffer, dtc_queue.reply_index
|
reply_buffer, dtc_queue.reply_index
|
||||||
);
|
);
|
||||||
if (usb_err < 0) {
|
if (usb_err < 0) {
|
||||||
LOG_ERROR("dtc_run_download: %s", usb_strerror());
|
LOG_ERROR("dtc_run_download: %s", usb_strerror());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -712,7 +712,7 @@ dtc_queue_run(void) {
|
||||||
rq_p = dtc_queue.rq_head;
|
rq_p = dtc_queue.rq_head;
|
||||||
rq_p != NULL;
|
rq_p != NULL;
|
||||||
rq_p = rq_next
|
rq_p = rq_next
|
||||||
) {
|
) {
|
||||||
tdo_p = rq_p->scan.buffer + (rq_p->scan.offset / 8);
|
tdo_p = rq_p->scan.buffer + (rq_p->scan.offset / 8);
|
||||||
tdo_mask = 1 << (rq_p->scan.offset % 8);
|
tdo_mask = 1 << (rq_p->scan.offset % 8);
|
||||||
|
|
||||||
|
@ -727,7 +727,7 @@ dtc_queue_run(void) {
|
||||||
;
|
;
|
||||||
bit_cnt;
|
bit_cnt;
|
||||||
bit_cnt--
|
bit_cnt--
|
||||||
) {
|
) {
|
||||||
if (*dtc_p & dtc_mask) {
|
if (*dtc_p & dtc_mask) {
|
||||||
*tdo_p |= tdo_mask;
|
*tdo_p |= tdo_mask;
|
||||||
} else {
|
} else {
|
||||||
|
@ -752,9 +752,9 @@ dtc_queue_run(void) {
|
||||||
x = *dtc_p++;
|
x = *dtc_p++;
|
||||||
if ((
|
if ((
|
||||||
rq_p->scan.type == SCAN_IN
|
rq_p->scan.type == SCAN_IN
|
||||||
) && (
|
) && (
|
||||||
rq_p->scan.offset != rq_p->scan.size - 1
|
rq_p->scan.offset != rq_p->scan.size - 1
|
||||||
)) {
|
)) {
|
||||||
/* extra bits were sent as a full byte with padding on the end */
|
/* extra bits were sent as a full byte with padding on the end */
|
||||||
dtc_mask = 1 << (8 - 1);
|
dtc_mask = 1 << (8 - 1);
|
||||||
} else {
|
} else {
|
||||||
|
@ -765,7 +765,7 @@ dtc_queue_run(void) {
|
||||||
;
|
;
|
||||||
bit_cnt;
|
bit_cnt;
|
||||||
bit_cnt--
|
bit_cnt--
|
||||||
) {
|
) {
|
||||||
if (x & dtc_mask) {
|
if (x & dtc_mask) {
|
||||||
*tdo_p |= tdo_mask;
|
*tdo_p |= tdo_mask;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1001,7 +1001,7 @@ void rlink_reset(int trst, int srst)
|
||||||
ST7_PADR >> 8,
|
ST7_PADR >> 8,
|
||||||
ST7_PADR,
|
ST7_PADR,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
if (usb_err < 0) {
|
if (usb_err < 0) {
|
||||||
LOG_ERROR("%s", usb_strerror());
|
LOG_ERROR("%s", usb_strerror());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1011,7 +1011,7 @@ void rlink_reset(int trst, int srst)
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
(char *)&bitmap, 1,
|
(char *)&bitmap, 1,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
if (usb_err < 1) {
|
if (usb_err < 1) {
|
||||||
LOG_ERROR("%s", usb_strerror());
|
LOG_ERROR("%s", usb_strerror());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1036,7 +1036,7 @@ void rlink_reset(int trst, int srst)
|
||||||
ST7_PBDDR >> 8,
|
ST7_PBDDR >> 8,
|
||||||
ST7_PBDDR,
|
ST7_PBDDR,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
if (usb_err < 0) {
|
if (usb_err < 0) {
|
||||||
LOG_ERROR("%s", usb_strerror());
|
LOG_ERROR("%s", usb_strerror());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1046,7 +1046,7 @@ void rlink_reset(int trst, int srst)
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
(char *)&bitmap, 1,
|
(char *)&bitmap, 1,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
if (usb_err < 1) {
|
if (usb_err < 1) {
|
||||||
LOG_ERROR("%s", usb_strerror());
|
LOG_ERROR("%s", usb_strerror());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1067,7 +1067,7 @@ void rlink_reset(int trst, int srst)
|
||||||
1,
|
1,
|
||||||
bitmap,
|
bitmap,
|
||||||
EP1_CMD_DTC_GET_CACHED_STATUS
|
EP1_CMD_DTC_GET_CACHED_STATUS
|
||||||
);
|
);
|
||||||
if (usb_err < 0) {
|
if (usb_err < 0) {
|
||||||
LOG_ERROR("%s", usb_strerror());
|
LOG_ERROR("%s", usb_strerror());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1077,7 +1077,7 @@ void rlink_reset(int trst, int srst)
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
(char *)&bitmap, 1,
|
(char *)&bitmap, 1,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
if (usb_err < 1) {
|
if (usb_err < 1) {
|
||||||
LOG_ERROR("%s", usb_strerror());
|
LOG_ERROR("%s", usb_strerror());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1117,7 +1117,7 @@ rlink_scan(
|
||||||
(!ir_scan && (tap_get_state() == TAP_DRSHIFT))
|
(!ir_scan && (tap_get_state() == TAP_DRSHIFT))
|
||||||
||
|
||
|
||||||
(ir_scan && (tap_get_state() == TAP_IRSHIFT))
|
(ir_scan && (tap_get_state() == TAP_IRSHIFT))
|
||||||
)) {
|
)) {
|
||||||
saved_end_state = tap_get_end_state();
|
saved_end_state = tap_get_end_state();
|
||||||
rlink_end_state(ir_scan ? TAP_IRSHIFT : TAP_DRSHIFT);
|
rlink_end_state(ir_scan ? TAP_IRSHIFT : TAP_DRSHIFT);
|
||||||
rlink_state_move();
|
rlink_state_move();
|
||||||
|
@ -1159,7 +1159,7 @@ rlink_scan(
|
||||||
/* make sure there's room for stop, byte op, and one byte */
|
/* make sure there's room for stop, byte op, and one byte */
|
||||||
if (
|
if (
|
||||||
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1 + 1))
|
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1 + 1))
|
||||||
) {
|
) {
|
||||||
dtc_queue_run();
|
dtc_queue_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1229,7 +1229,7 @@ rlink_scan(
|
||||||
type, buffer, scan_size, tdi_bit_offset,
|
type, buffer, scan_size, tdi_bit_offset,
|
||||||
chunk_bits,
|
chunk_bits,
|
||||||
cmd
|
cmd
|
||||||
) == NULL) {
|
) == NULL) {
|
||||||
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -1286,7 +1286,7 @@ rlink_scan(
|
||||||
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1 + 1))
|
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1 + 1))
|
||||||
||
|
||
|
||||||
(dtc_queue.reply_index >= USB_EP2IN_SIZE - (1))
|
(dtc_queue.reply_index >= USB_EP2IN_SIZE - (1))
|
||||||
) {
|
) {
|
||||||
dtc_queue_run();
|
dtc_queue_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1294,7 +1294,7 @@ rlink_scan(
|
||||||
type, buffer, scan_size, tdi_bit_offset,
|
type, buffer, scan_size, tdi_bit_offset,
|
||||||
extra_bits,
|
extra_bits,
|
||||||
cmd
|
cmd
|
||||||
) == NULL) {
|
) == NULL) {
|
||||||
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -1339,7 +1339,7 @@ rlink_scan(
|
||||||
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1))
|
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1))
|
||||||
||
|
||
|
||||||
(dtc_queue.reply_index >= USB_EP2IN_SIZE - (1))
|
(dtc_queue.reply_index >= USB_EP2IN_SIZE - (1))
|
||||||
) {
|
) {
|
||||||
dtc_queue_run();
|
dtc_queue_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1352,7 +1352,7 @@ rlink_scan(
|
||||||
type, buffer, scan_size, tdi_bit_offset,
|
type, buffer, scan_size, tdi_bit_offset,
|
||||||
1,
|
1,
|
||||||
cmd
|
cmd
|
||||||
) == NULL) {
|
) == NULL) {
|
||||||
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -1390,7 +1390,7 @@ int rlink_execute_queue(void)
|
||||||
ep1_generic_commandl(pHDev, 2,
|
ep1_generic_commandl(pHDev, 2,
|
||||||
EP1_CMD_SET_PORTD_LEDS,
|
EP1_CMD_SET_PORTD_LEDS,
|
||||||
~(ST7_PD_NBUSY_LED)
|
~(ST7_PD_NBUSY_LED)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (cmd)
|
while (cmd)
|
||||||
|
@ -1481,7 +1481,7 @@ int rlink_execute_queue(void)
|
||||||
ep1_generic_commandl(pHDev, 2,
|
ep1_generic_commandl(pHDev, 2,
|
||||||
EP1_CMD_SET_PORTD_LEDS,
|
EP1_CMD_SET_PORTD_LEDS,
|
||||||
~0
|
~0
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -1511,7 +1511,7 @@ int rlink_speed(int speed)
|
||||||
LOG_ERROR("%s, %d: starting DTC: %s",
|
LOG_ERROR("%s, %d: starting DTC: %s",
|
||||||
__FILE__, __LINE__,
|
__FILE__, __LINE__,
|
||||||
usb_strerror()
|
usb_strerror()
|
||||||
);
|
);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1641,7 +1641,7 @@ int rlink_init(void)
|
||||||
j = ep1_generic_commandl(
|
j = ep1_generic_commandl(
|
||||||
pHDev, 1,
|
pHDev, 1,
|
||||||
EP1_CMD_GET_FWREV
|
EP1_CMD_GET_FWREV
|
||||||
);
|
);
|
||||||
if (j < USB_EP1OUT_SIZE) {
|
if (j < USB_EP1OUT_SIZE) {
|
||||||
LOG_ERROR("USB write error: %s", usb_strerror());
|
LOG_ERROR("USB write error: %s", usb_strerror());
|
||||||
return(ERROR_FAIL);
|
return(ERROR_FAIL);
|
||||||
|
@ -1650,7 +1650,7 @@ int rlink_init(void)
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
(char *)reply_buffer, sizeof(reply_buffer),
|
(char *)reply_buffer, sizeof(reply_buffer),
|
||||||
200
|
200
|
||||||
);
|
);
|
||||||
if (j != -ETIMEDOUT) break;
|
if (j != -ETIMEDOUT) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1683,13 +1683,13 @@ int rlink_init(void)
|
||||||
ST7_PEDR,
|
ST7_PEDR,
|
||||||
1,
|
1,
|
||||||
ST7_PE_ADAPTER_SENSE_OUT
|
ST7_PE_ADAPTER_SENSE_OUT
|
||||||
);
|
);
|
||||||
|
|
||||||
usb_bulk_read(
|
usb_bulk_read(
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
(char *)reply_buffer, 1,
|
(char *)reply_buffer, 1,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
if ((reply_buffer[0] & ST7_PE_ADAPTER_SENSE_IN) != 0) {
|
if ((reply_buffer[0] & ST7_PE_ADAPTER_SENSE_IN) != 0) {
|
||||||
LOG_WARNING("target detection problem");
|
LOG_WARNING("target detection problem");
|
||||||
|
@ -1708,13 +1708,13 @@ int rlink_init(void)
|
||||||
0x00, /* DR */
|
0x00, /* DR */
|
||||||
0x00, /* DDR */
|
0x00, /* DDR */
|
||||||
0x00 /* OR */
|
0x00 /* OR */
|
||||||
);
|
);
|
||||||
|
|
||||||
usb_bulk_read(
|
usb_bulk_read(
|
||||||
pHDev, USB_EP1IN_ADDR,
|
pHDev, USB_EP1IN_ADDR,
|
||||||
(char *)reply_buffer, 1,
|
(char *)reply_buffer, 1,
|
||||||
USB_TIMEOUT_MS
|
USB_TIMEOUT_MS
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if ((reply_buffer[0] & ST7_PE_ADAPTER_SENSE_IN) == 0) {
|
if ((reply_buffer[0] & ST7_PE_ADAPTER_SENSE_IN) == 0) {
|
||||||
|
@ -1735,7 +1735,7 @@ int rlink_init(void)
|
||||||
ST7_PBDDR,
|
ST7_PBDDR,
|
||||||
1,
|
1,
|
||||||
0x00
|
0x00
|
||||||
);
|
);
|
||||||
|
|
||||||
/* make sure DTC is stopped, set VPP control, set up ports A and B */
|
/* make sure DTC is stopped, set VPP control, set up ports A and B */
|
||||||
ep1_generic_commandl(
|
ep1_generic_commandl(
|
||||||
|
@ -1755,7 +1755,7 @@ int rlink_init(void)
|
||||||
ST7_PBDR,
|
ST7_PBDR,
|
||||||
1,
|
1,
|
||||||
0x00
|
0x00
|
||||||
);
|
);
|
||||||
|
|
||||||
/* set LED updating mode and make sure they're unlit */
|
/* set LED updating mode and make sure they're unlit */
|
||||||
ep1_generic_commandl(
|
ep1_generic_commandl(
|
||||||
|
@ -1767,7 +1767,7 @@ int rlink_init(void)
|
||||||
#endif
|
#endif
|
||||||
EP1_CMD_SET_PORTD_LEDS,
|
EP1_CMD_SET_PORTD_LEDS,
|
||||||
~0
|
~0
|
||||||
);
|
);
|
||||||
|
|
||||||
tap_state_queue_init();
|
tap_state_queue_init();
|
||||||
dtc_queue_init();
|
dtc_queue_init();
|
||||||
|
@ -1789,7 +1789,7 @@ int rlink_quit(void)
|
||||||
~0,
|
~0,
|
||||||
EP1_CMD_SET_PORTD_VPP,
|
EP1_CMD_SET_PORTD_VPP,
|
||||||
~0
|
~0
|
||||||
);
|
);
|
||||||
|
|
||||||
usb_release_interface(pHDev,0);
|
usb_release_interface(pHDev,0);
|
||||||
usb_close(pHDev);
|
usb_close(pHDev);
|
||||||
|
|
Loading…
Reference in New Issue