From: oharboe Date: Sun, 19 Apr 2009 08:05:54 +0000 (+0000) Subject: Zach Welch use tap_state_t X-Git-Tag: v0.2.0~1039 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dd6912b1e55888d02af390f1174a80b74a511d86;p=openocd Zach Welch use tap_state_t git-svn-id: svn://svn.berlios.de/openocd/trunk@1464 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- diff --git a/src/jtag/amt_jtagaccel.c b/src/jtag/amt_jtagaccel.c index 54523fb3..5e0ec492 100644 --- a/src/jtag/amt_jtagaccel.c +++ b/src/jtag/amt_jtagaccel.c @@ -156,7 +156,7 @@ int amt_jtagaccel_speed(int speed) return ERROR_OK; } -void amt_jtagaccel_end_state(int state) +void amt_jtagaccel_end_state(tap_state_t state) { if (tap_is_state_stable(state)) tap_set_end_state(state); diff --git a/src/jtag/dummy.c b/src/jtag/dummy.c index 0a64c214..7228ab5a 100644 --- a/src/jtag/dummy.c +++ b/src/jtag/dummy.c @@ -91,7 +91,7 @@ void dummy_write(int tck, int tms, int tdi) { if( tck ) { - int old_state = dummy_state; + tap_state_t old_state = dummy_state; dummy_state = tap_state_transition( old_state, tms ); if( old_state != dummy_state ) diff --git a/src/jtag/gw16012.c b/src/jtag/gw16012.c index af577675..d9d5680c 100644 --- a/src/jtag/gw16012.c +++ b/src/jtag/gw16012.c @@ -194,7 +194,7 @@ int gw16012_speed(int speed) return ERROR_OK; } -void gw16012_end_state(int state) +void gw16012_end_state(tap_state_t state) { if (tap_is_state_stable(state)) tap_set_end_state(state); diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 2f6ab776..a9a4b30c 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -219,7 +219,7 @@ void jtag_add_runtest(int num_cycles, tap_state_t endstate); void jtag_add_end_state(tap_state_t endstate); void jtag_add_sleep(u32 us); int jtag_execute_queue(void); -int tap_state_by_name(const char *name); +tap_state_t tap_state_by_name(const char *name); /* jtag commands */ int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); @@ -2652,7 +2652,7 @@ int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char * int handle_endstate_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { - int state; + tap_state_t state; if (argc < 1) { @@ -2665,7 +2665,7 @@ int handle_endstate_command(struct command_context_s *cmd_ctx, char *cmd, char * command_print( cmd_ctx, "Invalid state name: %s\n", args[0] ); return ERROR_COMMAND_SYNTAX_ERROR; } - jtag_add_end_state( (tap_state_t)(state)); + jtag_add_end_state(state); jtag_execute_queue(); } command_print(cmd_ctx, "current endstate: %s", tap_state_name(cmd_queue_end_state)); @@ -2729,7 +2729,7 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a int i; scan_field_t *fields; jtag_tap_t *tap; - int endstate; + tap_state_t endstate; if ((argc < 2) || (argc % 2)) { @@ -2807,7 +2807,7 @@ int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args) int field_count = 0; int i, e; jtag_tap_t *tap; - int endstate; + tap_state_t endstate; /* args[1] = device * args[2] = num_bits @@ -3269,9 +3269,9 @@ const char* tap_state_name(tap_state_t state) return ret; } -int tap_state_by_name( const char *name ) +tap_state_t tap_state_by_name( const char *name ) { - int x; + tap_state_t x; for( x = 0 ; x < TAP_NUM_STATES ; x++ ){ /* be nice to the human */