diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-10-14 11:06:30 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-10-14 11:06:30 +0000 |
commit | 257d238e618ead82009058efad7e7a7e7102825a (patch) | |
tree | d80850668c2c776ec9ca7d9e411bc1adca9cf84a /src/target/arm_jtag.c | |
parent | 50959e133cf6c875890f62e0d9ccaf2e8f106db6 (diff) | |
download | riscv-openocd-257d238e618ead82009058efad7e7a7e7102825a.zip riscv-openocd-257d238e618ead82009058efad7e7a7e7102825a.tar.gz riscv-openocd-257d238e618ead82009058efad7e7a7e7102825a.tar.bz2 |
Laurentiu Cocanu - add error handling
git-svn-id: svn://svn.berlios.de/openocd/trunk@1057 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/arm_jtag.c')
-rw-r--r-- | src/target/arm_jtag.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/target/arm_jtag.c b/src/target/arm_jtag.c index 1e2683c..9452c2b 100644 --- a/src/target/arm_jtag.c +++ b/src/target/arm_jtag.c @@ -63,6 +63,7 @@ int arm_jtag_set_instr(arm_jtag_t *jtag_info, u32 new_instr, in_handler_t handl int arm_jtag_scann(arm_jtag_t *jtag_info, u32 new_scan_chain) { + int retval = ERROR_OK; if(jtag_info->cur_scan_chain != new_scan_chain) { u32 values[1]; @@ -70,9 +71,13 @@ int arm_jtag_scann(arm_jtag_t *jtag_info, u32 new_scan_chain) values[0]=new_scan_chain; num_bits[0]=jtag_info->scann_size; - - arm_jtag_set_instr(jtag_info, jtag_info->scann_instr, NULL); - jtag_add_dr_out(jtag_info->chain_pos, + + if((retval = arm_jtag_set_instr(jtag_info, jtag_info->scann_instr, NULL)) != ERROR_OK) + { + return retval; + } + + jtag_add_dr_out(jtag_info->chain_pos, 1, num_bits, values, @@ -80,8 +85,8 @@ int arm_jtag_scann(arm_jtag_t *jtag_info, u32 new_scan_chain) jtag_info->cur_scan_chain = new_scan_chain; } - - return ERROR_OK; + + return retval; } int arm_jtag_reset_callback(enum jtag_event event, void *priv) @@ -102,9 +107,7 @@ int arm_jtag_setup_connection(arm_jtag_t *jtag_info) jtag_info->cur_scan_chain = 0; jtag_info->intest_instr = 0xc; - jtag_register_event_callback(arm_jtag_reset_callback, jtag_info); - - return ERROR_OK; + return jtag_register_event_callback(arm_jtag_reset_callback, jtag_info); } /* read JTAG buffer into host-endian u32, flipping bit-order */ |