Skip to content

Commit

Permalink
jtag/core: Use 'bool' data type for 'bypass'
Browse files Browse the repository at this point in the history
Change-Id: I918fd5ce674e808ad6a96634a11046d2b3f6a05c
Signed-off-by: Marc Schink <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8040
Reviewed-by: Antonio Borneo <[email protected]>
Tested-by: jenkins
  • Loading branch information
zapb-0 authored and borneoa committed Dec 16, 2023
1 parent f018cd7 commit d2b34b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/jtag/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ static int jtag_reset_callback(enum jtag_event event, void *priv)

/* current instruction is either BYPASS or IDCODE */
buf_set_ones(tap->cur_instr, tap->ir_length);
tap->bypass = 1;
tap->bypass = true;
}

return ERROR_OK;
Expand Down Expand Up @@ -1464,7 +1464,7 @@ void jtag_tap_init(struct jtag_tap *tap)
buf_set_u32(tap->expected_mask, 0, ir_len_bits, tap->ir_capture_mask);

/* TAP will be in bypass mode after jtag_validate_ircapture() */
tap->bypass = 1;
tap->bypass = true;
buf_set_ones(tap->cur_instr, tap->ir_length);

/* register the reset callback for the TAP */
Expand Down
4 changes: 2 additions & 2 deletions src/jtag/drivers/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ int interface_jtag_add_ir_scan(struct jtag_tap *active,

if (tap == active) {
/* if TAP is listed in input fields, copy the value */
tap->bypass = 0;
tap->bypass = false;

jtag_scan_field_clone(field, in_fields);
} else {
/* if a TAP isn't listed in input fields, set it to BYPASS */

tap->bypass = 1;
tap->bypass = true;

field->num_bits = tap->ir_length;
field->out_value = buf_set_ones(cmd_queue_alloc(DIV_ROUND_UP(tap->ir_length, 8)), tap->ir_length);
Expand Down
2 changes: 1 addition & 1 deletion src/jtag/jtag.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct jtag_tap {
/** current instruction */
uint8_t *cur_instr;
/** Bypass register selected */
int bypass;
bool bypass;

struct jtag_tap_event_action *event_action;

Expand Down

0 comments on commit d2b34b4

Please sign in to comment.