The following patches was applied:
[openocd.git] / src / jtag / jtag.c
index 0c892b29f27a42cc0df2f6066b500c7c3fad7cbe..2f6ab776a7b5cff68258422f438e39c3d9749c55 100644 (file)
@@ -510,7 +510,7 @@ static void jtag_prelude(tap_state_t state)
 {
        jtag_prelude1();
 
-       if (state != -1)
+       if (state != TAP_INVALID)
                jtag_add_end_state(state);
 
        cmd_queue_cur_state = cmd_queue_end_state;
@@ -2717,7 +2717,7 @@ int handle_runtest_command(struct command_context_s *cmd_ctx, char *cmd, char **
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       jtag_add_runtest(strtol(args[0], NULL, 0), -1);
+       jtag_add_runtest(strtol(args[0], NULL, 0), TAP_INVALID);
        jtag_execute_queue();
 
        return ERROR_OK;
@@ -2740,7 +2740,7 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
        /*          "statename" */
        /* at the end of the arguments. */
        /* assume none. */
-       endstate = -1;
+       endstate = TAP_INVALID;
        if( argc >= 4 ){
                /* have at least one pair of numbers. */
                /* is last pair the magic text? */
@@ -2748,13 +2748,13 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
                        const char *cpA;
                        const char *cpS;
                        cpA = args[ argc-1 ];
-                       for( endstate = 0 ; endstate < 16 ; endstate++ ){
+                       for( endstate = 0 ; endstate < TAP_NUM_STATES ; endstate++ ){
                                cpS = tap_state_name( endstate );
                                if( 0 == strcmp( cpA, cpS ) ){
                                        break;
                                }
                        }
-                       if( endstate >= 16 ){
+                       if( endstate >= TAP_NUM_STATES ){
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        } else {
                                /* found - remove the last 2 args */
@@ -2784,11 +2784,11 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
                fields[i].in_handler_priv = NULL;
        }
 
-       jtag_add_ir_scan(argc / 2, fields, -1);
+       jtag_add_ir_scan(argc / 2, fields, TAP_INVALID);
        /* did we have an endstate? */
-       if( endstate >= 0 ){
+       if (endstate != TAP_INVALID)
                jtag_add_end_state(endstate);
-       }
+
        jtag_execute_queue();
 
        for (i = 0; i < argc / 2; i++)
@@ -2825,7 +2825,7 @@ int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args)
        }
 
        /* assume no endstate */
-       endstate = -1;
+       endstate = TAP_INVALID;
        /* validate arguments as numbers */
        e = JIM_OK;
        for (i = 2; i < argc; i+=2)
@@ -2901,11 +2901,11 @@ int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args)
                fields[field_count++].in_handler_priv = NULL;
        }
 
-       jtag_add_dr_scan(num_fields, fields, -1);
+       jtag_add_dr_scan(num_fields, fields, TAP_INVALID);
        /* did we get an end state? */
-       if( endstate >= 0 ){
-               jtag_add_end_state( (tap_state_t)endstate );
-       }
+       if (endstate != TAP_INVALID)
+               jtag_add_end_state(endstate);
+
        retval = jtag_execute_queue();
        if (retval != ERROR_OK)
        {
@@ -3089,7 +3089,7 @@ int tap_get_tms_path( tap_state_t from, tap_state_t to )
         *
         * DRSHIFT->DRSHIFT and IRSHIFT->IRSHIFT have to be caught in interface specific code
         */
-       const static u8 tms_seqs[6][6] =
+       static const u8 tms_seqs[6][6] =
        {
                /* value clocked to TMS to move from one of six stable states to another */
 
@@ -3273,14 +3273,14 @@ int tap_state_by_name( const char *name )
 {
        int x;
 
-       for( x = 0 ; x < 16 ; x++ ){
+       for( x = 0 ; x < TAP_NUM_STATES ; x++ ){
                /* be nice to the human */
                if( 0 == strcasecmp( name, tap_state_name(x) ) ){
                        return x;
                }
        }
        /* not found */
-       return -1;
+       return TAP_INVALID;
 }
 
 /*-----</Cable Helper API>--------------------------------------*/

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)