This is an automated email from Gerrit.

Tomas Vanek ([email protected]) just uploaded a new patch set to Gerrit, which you 
can find at http://openocd.zylin.com/4469

-- gerrit

commit 3ce6b2b5e7474122a7ffb82fb3e5a8a520355a99
Author: Tomas Vanek <[email protected]>
Date:   Thu Mar 15 20:02:10 2018 +0100

    transport: add transport_is_hla()
    
    and move declaration of all transport_is_xxx() functions to transport.h
    
    Change-Id: Ib229115b5017507b49655bc43b517ab6fb32f7a6
    Signed-off-by: Tomas Vanek <[email protected]>

diff --git a/src/jtag/hla/hla_transport.c b/src/jtag/hla/hla_transport.c
index 5a5671d..ddacea3 100644
--- a/src/jtag/hla/hla_transport.c
+++ b/src/jtag/hla/hla_transport.c
@@ -233,3 +233,11 @@ static void hl_constructor(void)
        transport_register(&hl_jtag_transport);
        transport_register(&stlink_swim_transport);
 }
+
+bool transport_is_hla(void)
+{
+       struct transport *t;
+       t = get_current_transport();
+       return t == &hl_swd_transport || t == &hl_jtag_transport
+                  || t == &stlink_swim_transport;
+}
diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h
index 1b8677e..a6891c0 100644
--- a/src/jtag/jtag.h
+++ b/src/jtag/jtag.h
@@ -640,8 +640,6 @@ void jtag_poll_set_enabled(bool value);
  * level APIs that are used in inner loops. */
 #include <jtag/minidriver.h>
 
-bool transport_is_jtag(void);
-
 int jim_jtag_newtap(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
 
 #endif /* OPENOCD_JTAG_JTAG_H */
diff --git a/src/jtag/swd.h b/src/jtag/swd.h
index c888cc0..52f41d5 100644
--- a/src/jtag/swd.h
+++ b/src/jtag/swd.h
@@ -211,6 +211,4 @@ struct swd_driver {
 int swd_init_reset(struct command_context *cmd_ctx);
 void swd_add_reset(int req_srst);
 
-bool transport_is_swd(void);
-
 #endif /* OPENOCD_JTAG_SWD_H */
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index bc6bbf2..e32f0ca 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -42,6 +42,7 @@
 #endif
 
 #include <helper/time_support.h>
+#include "transport/transport.h"
 
 /**
  * @file
diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index a85e5bc..7a0b71e 100644
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -56,6 +56,7 @@
 #include "arm_semihosting.h"
 #include "jtag/swd.h"
 #include <helper/time_support.h>
+#include "transport/transport.h"
 
 static int cortex_a_poll(struct target *target);
 static int cortex_a_debug_entry(struct target *target);
diff --git a/src/transport/transport.h b/src/transport/transport.h
index 6c57067..bfe8817 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -90,4 +90,8 @@ int allow_transports(struct command_context *ctx, const char 
* const *vector);
 
 bool transports_are_declared(void);
 
+bool transport_is_jtag(void);
+bool transport_is_swd(void);
+bool transport_is_hla(void);
+
 #endif /* OPENOCD_TRANSPORT_TRANSPORT_H */

-- 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to