tiny bit of encapsulation of global end state. No longer expose it as a global variable.
[openocd.git] / src / jtag / zy1000.c
index 73a40f2ed8c5910b1ec3efd0f11cb1d6e7230100..1fc2479ed4d8eeacc775ffefe466d8012bd96134 100644 (file)
 #include "config.h"
 #endif
 
-#define INCLUDE_JTAG_INTERFACE_H
 #include "embeddedice.h"
 #include "minidriver.h"
-#include "bitbang.h"
+#include "interface.h"
 
 #include <cyg/hal/hal_io.h>             // low level i/o
 #include <cyg/hal/hal_diag.h>
@@ -117,7 +116,7 @@ static int zy1000_power_dropout(int *dropout)
 jtag_interface_t zy1000_interface =
 {
        .name = "ZY1000",
-       .execute_queue = bitbang_execute_queue,
+       .execute_queue = NULL,
        .speed = zy1000_speed,
        .register_commands = zy1000_register_commands,
        .init = zy1000_init,
@@ -128,15 +127,6 @@ jtag_interface_t zy1000_interface =
        .srst_asserted = zy1000_srst_asserted,
 };
 
-bitbang_interface_t zy1000_bitbang =
-{
-       .read = zy1000_read,
-       .write = zy1000_write,
-       .reset = zy1000_reset
-};
-
-
-
 static void zy1000_write(int tck, int tms, int tdi)
 {
 
@@ -368,8 +358,6 @@ int zy1000_init(void)
        zy1000_reset(0, 0);
        zy1000_speed(jtag_speed);
 
-       bitbang_interface = &zy1000_bitbang;
-
        return ERROR_OK;
 }
 
@@ -439,11 +427,6 @@ static void shiftValueInnerFlip(const tap_state_t state, const tap_state_t endSt
 
 extern int jtag_check_value(u8 *captured, void *priv);
 
-static void gotoEndState(void)
-{
-       setCurrentState(cmd_queue_end_state);
-}
-
 static __inline void scanFields(int num_fields, scan_field_t *fields, tap_state_t shiftState, tap_state_t end_state)
 {
        int i;
@@ -534,7 +517,7 @@ int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_s
                tap_state_t end_state;
                if (nextTap==NULL)
                {
-                       end_state = cmd_queue_end_state;
+                       end_state = state;
                } else
                {
                        end_state = TAP_IRSHIFT;
@@ -585,7 +568,7 @@ int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_s
 
 int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
 {
-       scanFields(num_fields, fields, TAP_IRSHIFT, cmd_queue_end_state);
+       scanFields(num_fields, fields, TAP_IRSHIFT, state);
 
        return ERROR_OK;
 }
@@ -604,7 +587,7 @@ int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_s
                tap_state_t end_state;
                if (nextTap==NULL)
                {
-                       end_state = cmd_queue_end_state;
+                       end_state = state;
                } else
                {
                        end_state = TAP_DRSHIFT;
@@ -638,7 +621,7 @@ int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_s
 
 int interface_jtag_add_plain_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
 {
-       scanFields(num_fields, fields, TAP_DRSHIFT, cmd_queue_end_state);
+       scanFields(num_fields, fields, TAP_DRSHIFT, state);
        return ERROR_OK;
 }
 
@@ -710,7 +693,7 @@ int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
 
 int interface_jtag_add_clocks(int num_cycles)
 {
-       return zy1000_jtag_add_clocks(num_cycles, cmd_queue_cur_state, cmd_queue_end_state);
+       return zy1000_jtag_add_clocks(num_cycles, cmd_queue_cur_state, cmd_queue_cur_state);
 }
 
 int interface_jtag_add_sleep(u32 us)
@@ -765,7 +748,7 @@ int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
 void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, u8 *buffer, int little, int count)
 {
 //     static int const reg_addr=0x5;
-       tap_state_t end_state=cmd_queue_end_state;
+       tap_state_t end_state=jtag_add_end_state(TAP_INVALID);
        if (jtag_NextEnabledTap(jtag_NextEnabledTap(NULL))==NULL)
        {
                /* better performance via code duplication */

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)