From d7415b624fa278f1d8513b94b1011dc831e581bf Mon Sep 17 00:00:00 2001 From: Tomek CEDRO Date: Thu, 13 Oct 2011 21:59:45 +0200 Subject: SWD: swd tcl commands are now available from CLI and initialized at program startup with other commands. --- src/openocd.c | 1 + src/target/arm_adi_v5.c | 1 - src/transport/swd.h | 7 ++++++- src/transport/swd_core.c | 2 +- src/transport/transport.h | 1 + 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/openocd.c b/src/openocd.c index 317743dd..f9401d41 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -276,6 +276,7 @@ struct command_context *setup_command_handler(Jim_Interp *interp) &transport_register_commands, &interface_register_commands, &bitbang_register_commands, + &swd_register_commands, &target_register_commands, &flash_register_commands, &nand_register_commands, diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index f5294469..413511c7 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -77,7 +77,6 @@ #include #include #include -#include //We need to have access to information on other layers such as transport etc //these are kept in global interface structure for now. Change ASAP. diff --git a/src/transport/swd.h b/src/transport/swd.h index 437a8a5e..cf737e32 100644 --- a/src/transport/swd.h +++ b/src/transport/swd.h @@ -35,12 +35,16 @@ */ /** \file swd.h SWD Transport Header File for OpenOCD. */ + +#ifndef OOCD_SWD_H +#define OOCD_SWD_H + + #ifdef HAVE_CONFIG_H #include "config.h" #endif #include -#include #include #include #include @@ -62,3 +66,4 @@ extern const struct dap_ops oocd_dap_ops_swd; int swd_register_commands(struct command_context *cmd_ctx); +#endif diff --git a/src/transport/swd_core.c b/src/transport/swd_core.c index 383199f2..f5c9faef 100644 --- a/src/transport/swd_core.c +++ b/src/transport/swd_core.c @@ -46,7 +46,7 @@ #include "config.h" #endif -#include +#include ///Unfortunalety OpenOCD use globals to pass information so we need to use it too. extern struct jtag_interface *jtag_interface; diff --git a/src/transport/transport.h b/src/transport/transport.h index 2702b9ef..b5e15ffd 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -21,6 +21,7 @@ #define OOCD_TRANSPORT_H #include "helper/command.h" +#include "transport/swd.h" /** * Wrapper for transport lifecycle operations. -- cgit v1.2.3