mirror of
https://github.com/openocd-org/openocd.git
synced 2025-10-14 02:58:23 +08:00
Compare commits
2 Commits
56d67dac2e
...
e971d677c0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e971d677c0 | ||
![]() |
96c219a408 |
@@ -793,11 +793,10 @@ static int ch347_cmd_start_next(uint8_t type)
|
||||
{
|
||||
// different command type or non chainable command? (GPIO commands can't be concat)
|
||||
uint8_t prev_type = ch347.scratchpad_cmd_type;
|
||||
int retval = ERROR_OK;
|
||||
if (prev_type != type || ch347_is_single_cmd_type(type)) {
|
||||
// something written in the scratchpad? => store it as command
|
||||
if (prev_type != 0 && ch347.scratchpad_idx > 0) {
|
||||
retval = ch347_cmd_from_scratchpad();
|
||||
int retval = ch347_cmd_from_scratchpad();
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
@@ -813,7 +812,7 @@ static int ch347_cmd_start_next(uint8_t type)
|
||||
/* before we can send non chainable command ("single" like GPIO command) we should send all
|
||||
other commands because we can't send it together with other commands */
|
||||
if (ch347_is_single_cmd_type(type)) {
|
||||
retval = ch347_cmd_transmit_queue();
|
||||
int retval = ch347_cmd_transmit_queue();
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
}
|
||||
@@ -822,7 +821,7 @@ static int ch347_cmd_start_next(uint8_t type)
|
||||
ch347.scratchpad_cmd_type = type;
|
||||
}
|
||||
|
||||
return retval;
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -863,7 +862,6 @@ static int ch347_single_read_get_byte(int read_buf_idx, uint8_t *byte)
|
||||
|
||||
if (read_buf_idx > CH347_SINGLE_CMD_MAX_READ || read_buf_idx < 0) {
|
||||
LOG_ERROR("read_buf_idx out of range");
|
||||
read_buf_idx = 0;
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
@@ -981,17 +979,15 @@ static int ch347_scratchpad_add_clock_tms(bool tms)
|
||||
*/
|
||||
static int ch347_scratchpad_add_stableclocks(int count)
|
||||
{
|
||||
int retval = ERROR_OK;
|
||||
if (ch347.scratchpad_cmd_type == 0) {
|
||||
retval = ch347_cmd_start_next(CH347_CMD_JTAG_BIT_OP);
|
||||
int retval = ch347_cmd_start_next(CH347_CMD_JTAG_BIT_OP);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool tms = ch347.tms_pin == TMS_H;
|
||||
retval = ERROR_OK;
|
||||
for (int i = 0; i < count; i++) {
|
||||
retval = ch347_scratchpad_add_clock_tms(tms);
|
||||
int retval = ch347_scratchpad_add_clock_tms(tms);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
}
|
||||
@@ -1199,7 +1195,7 @@ static int ch347_scratchpad_add_write_read(struct scan_command *cmd, uint8_t *bi
|
||||
static int ch347_scratchpad_add_run_test(int cycles, enum tap_state state)
|
||||
{
|
||||
LOG_DEBUG_IO("cycles=%d, end_state=%d", cycles, state);
|
||||
int retval = ERROR_OK;
|
||||
int retval;
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
retval = ch347_scratchpad_add_move_state(TAP_IDLE, 0);
|
||||
if (retval != ERROR_OK)
|
||||
@@ -1228,7 +1224,7 @@ static int ch347_scratchpad_add_scan(struct scan_command *cmd)
|
||||
int scan_bits = jtag_build_buffer(cmd, &buf);
|
||||
|
||||
// add a move to IRSHIFT or DRSHIFT state
|
||||
int retval = ERROR_OK;
|
||||
int retval;
|
||||
if (cmd->ir_scan)
|
||||
retval = ch347_scratchpad_add_move_state(TAP_IRSHIFT, 0);
|
||||
else
|
||||
|
Reference in New Issue
Block a user