]> git.sur5r.net Git - openocd/blobdiff - src/jtag/bitq.c
Encapsulate JTAG Cable API and interface structure, plan for new header file.
[openocd] / src / jtag / bitq.c
index cbba551108cbbcc032d3632c67c238cb6ebf1e53..40b704b9ed04f8d5b396af094f09a81395eed4da 100644 (file)
 #include "config.h"
 #endif
 
+#define INCLUDE_JTAG_INTERFACE_H
 #include "bitq.h"
 
-/* project specific includes */
-#include "log.h"
-#include "types.h"
-#include "jtag.h"
-#include "configuration.h"
-
-/* system includes */
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
 
 bitq_interface_t* bitq_interface;       /* low level bit queue interface */
 
@@ -171,8 +162,9 @@ void bitq_state_move(tap_state_t new_state)
        }
 
        tms_scan = tap_get_tms_path(tap_get_state(), new_state);
+       int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
 
-       for (i = 0; i<7; i++)
+       for (i = 0; i<tms_count; i++)
        {
                bitq_io(tms_scan & 1, 0, 0);
                tms_scan >>= 1;
@@ -305,13 +297,6 @@ int bitq_execute_queue(void)
        {
                switch (cmd->type)
                {
-               case JTAG_END_STATE:
-#ifdef _DEBUG_JTAG_IO_
-                       LOG_DEBUG("end_state: %i", cmd->cmd.end_state->end_state);
-#endif
-                       bitq_end_state(cmd->cmd.end_state->end_state);
-                       break;
-
                case JTAG_RESET:
 #ifdef _DEBUG_JTAG_IO_
                        LOG_DEBUG("reset trst: %i srst %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst);