summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomek CEDRO <cederom@tlen.pl>2011-11-02 02:48:02 +0100
committerTomek CEDRO <cederom@tlen.pl>2011-11-02 02:49:13 +0100
commit7374dbc98dd075953cf76cb465e88ebe9e356c3c (patch)
tree4320525b833cc4f2fafdbf1ca207e8c1b3065cf3 /src
parent03925b8da483524051ed72054213c6ff21252b4e (diff)
downloadopenocd_libswd-7374dbc98dd075953cf76cb465e88ebe9e356c3c.tar.gz
openocd_libswd-7374dbc98dd075953cf76cb465e88ebe9e356c3c.tar.bz2
openocd_libswd-7374dbc98dd075953cf76cb465e88ebe9e356c3c.tar.xz
openocd_libswd-7374dbc98dd075953cf76cb465e88ebe9e356c3c.zip
transport/swd: unused variables and headers build fixes for linux ubuntu 11.04. Thanks to Przemyslaw Wegrzyn for pointing this out :-)
Diffstat (limited to 'src')
-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