]> git.sur5r.net Git - openocd/commitdiff
clock 1/0 in idle now configurable.
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 26 May 2008 11:46:05 +0000 (11:46 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 26 May 2008 11:46:05 +0000 (11:46 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@687 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/bitbang.c

index 79f77b5624bb4ea3b636acb3dbe6c9c001679bb3..c4f9ce94130a6a5768d92cde2abd9647b6321886 100644 (file)
 
 bitbang_interface_t *bitbang_interface;
 
+
+/* should the clock be high or low in idle? */
+#define CLOCK_IDLE() 0 
+
 int bitbang_execute_queue(void);
 
 /* The bitbang driver leaves the TCK 0 when in idle */
@@ -62,7 +66,7 @@ void bitbang_state_move(void) {
                bitbang_interface->write(0, tms, 0);
                bitbang_interface->write(1, tms, 0);
        }
-       bitbang_interface->write(0, tms, 0);
+       bitbang_interface->write(CLOCK_IDLE(), tms, 0);
        
        cur_state = end_state;
 }
@@ -98,7 +102,7 @@ void bitbang_path_move(pathmove_command_t *cmd)
                num_states--;
        }
        
-       bitbang_interface->write(0, tms, 0);
+       bitbang_interface->write(CLOCK_IDLE(), tms, 0);
 
        end_state = cur_state;
 }
@@ -117,12 +121,12 @@ void bitbang_runtest(int num_cycles)
        }
        
        /* execute num_cycles */
-       bitbang_interface->write(0, 0, 0);
        for (i = 0; i < num_cycles; i++)
        {
-               bitbang_interface->write(1, 0, 0);
                bitbang_interface->write(0, 0, 0);
+               bitbang_interface->write(1, 0, 0);
        }
+       bitbang_interface->write(CLOCK_IDLE(), 0, 0);
        
        /* finish in end_state */
        bitbang_end_state(saved_end_state);
@@ -187,7 +191,7 @@ void bitbang_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size)
         */
        bitbang_interface->write(0, 0, 0);
        bitbang_interface->write(1, 0, 0);
-       bitbang_interface->write(0, 0, 0);
+       bitbang_interface->write(CLOCK_IDLE(), 0, 0);
        
        if (ir_scan)
                cur_state = TAP_PI;