summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/swd.h7
-rw-r--r--src/transport/swd_core.c10
-rw-r--r--src/transport/transport.h4
3 files changed, 11 insertions, 10 deletions
diff --git a/src/transport/swd.h b/src/transport/swd.h
index cf737e32..590f6a10 100644
--- a/src/transport/swd.h
+++ b/src/transport/swd.h
@@ -36,14 +36,13 @@
/** \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
+#ifndef OOCD_SWD_H
+#define OOCD_SWD_H
+
#include <libswd.h>
#include <target/arm.h>
#include <target/arm_adi_v5.h>
diff --git a/src/transport/swd_core.c b/src/transport/swd_core.c
index f5c9faef..f1d4168d 100644
--- a/src/transport/swd_core.c
+++ b/src/transport/swd_core.c
@@ -42,10 +42,6 @@
* and external open-source SWD framework.
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <transport/transport.h>
///Unfortunalety OpenOCD use globals to pass information so we need to use it too.
@@ -143,7 +139,8 @@ int oocd_swd_transport_init(struct command_context *ctx){
}
LOG_INFO("New SWD context initialized at 0x%p", (void *)dap->ctx);
/* Now inherit the log level from OpenOCD settings. */
- if (swd_log_level_inherit((swd_ctx_t *)dap->ctx, debug_level)<0){
+ retval=swd_log_level_inherit((swd_ctx_t *)dap->ctx, debug_level);
+ if (retval<0){
LOG_ERROR("Unable to set log level: %s", swd_error_string(retval));
return ERROR_FAIL;
}
@@ -178,7 +175,8 @@ int oocd_swd_transport_select(struct command_context *ctx){
jtag_interface->transport=(struct transport *)&oocd_transport_swd;
- if (swd_register_commands(ctx)!=ERROR_OK){
+ retval=swd_register_commands(ctx);
+ if (retval!=ERROR_OK){
LOG_ERROR("Unable to register SWD commands!");
return retval;
}
diff --git a/src/transport/transport.h b/src/transport/transport.h
index b5e15ffd..5e080ac8 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -17,6 +17,10 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifndef OOCD_TRANSPORT_H
#define OOCD_TRANSPORT_H