From 832f5974f2b408a051b0f673ca64453deb960185 Mon Sep 17 00:00:00 2001 From: Salvador Arroyo Date: Mon, 20 Feb 2017 22:19:15 +0100 Subject: mips32, pic32 use uint8_t in 8 bit scan function Makes code shorter. Change-Id: I6cc01adffbea063ccb071ddf3a3e3d81727b29ce Signed-off-by: Salvador Arroyo Reviewed-on: http://openocd.zylin.com/4004 Tested-by: jenkins Reviewed-by: Freddie Chopin --- src/target/mips_ejtag.c | 21 +++++++-------------- src/target/mips_ejtag.h | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) (limited to 'src/target') diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c index 594711f..650af3e 100644 --- a/src/target/mips_ejtag.c +++ b/src/target/mips_ejtag.c @@ -169,31 +169,24 @@ void mips_ejtag_drscan_32_out(struct mips_ejtag *ejtag_info, uint32_t data) jtag_add_dr_scan(tap, 1, &field, TAP_IDLE); } -int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint32_t *data) +int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint8_t *data) { - struct jtag_tap *tap; - tap = ejtag_info->tap; - assert(tap != NULL); + assert(ejtag_info->tap != NULL); + struct jtag_tap *tap = ejtag_info->tap; struct scan_field field; - uint8_t t[4] = {0, 0, 0, 0}, r[4]; - int retval; - field.num_bits = 8; - field.out_value = t; - buf_set_u32(t, 0, field.num_bits, *data); - field.in_value = r; + + field.out_value = data; + field.in_value = data; jtag_add_dr_scan(tap, 1, &field, TAP_IDLE); - retval = jtag_execute_queue(); + int retval = jtag_execute_queue(); if (retval != ERROR_OK) { LOG_ERROR("register read failed"); return retval; } - - *data = buf_get_u32(field.in_value, 0, 32); - return ERROR_OK; } diff --git a/src/target/mips_ejtag.h b/src/target/mips_ejtag.h index 6ef0867..2178afc 100644 --- a/src/target/mips_ejtag.h +++ b/src/target/mips_ejtag.h @@ -220,7 +220,7 @@ void mips_ejtag_add_scan_96(struct mips_ejtag *ejtag_info, void mips_ejtag_drscan_32_out(struct mips_ejtag *ejtag_info, uint32_t data); int mips_ejtag_drscan_32(struct mips_ejtag *ejtag_info, uint32_t *data); void mips_ejtag_drscan_8_out(struct mips_ejtag *ejtag_info, uint8_t data); -int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint32_t *data); +int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint8_t *data); int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write_t, uint32_t *data); int mips_ejtag_init(struct mips_ejtag *ejtag_info); -- cgit v1.1