aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <jaylink-dev@marcschink.de>2016-11-11 16:32:41 +0100
committerMarc Schink <jaylink-dev@marcschink.de>2016-11-15 12:34:10 +0100
commit58953bbfecc13f79d59549cb9aabd898c8ab5714 (patch)
tree2a1f9866c5370a99ec7c7ebe9c461bc32ef3d68e
parent8713c3e9a9c7a0324aae7a62a74083bca759c8a9 (diff)
Print error code in error messages
Signed-off-by: Marc Schink <jaylink-dev@marcschink.de>
-rw-r--r--libjaylink/emucom.c6
-rw-r--r--libjaylink/swo.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/libjaylink/emucom.c b/libjaylink/emucom.c
index 057113b..8affc97 100644
--- a/libjaylink/emucom.c
+++ b/libjaylink/emucom.c
@@ -143,7 +143,8 @@ JAYLINK_API int jaylink_emucom_read(struct jaylink_device_handle *devh,
}
if (tmp & EMUCOM_ERR) {
- log_err(ctx, "Failed to read from channel 0x%x.", channel);
+ log_err(ctx, "Failed to read from channel 0x%x: 0x%x.",
+ channel, tmp);
return JAYLINK_ERR_DEV;
}
@@ -269,7 +270,8 @@ JAYLINK_API int jaylink_emucom_write(struct jaylink_device_handle *devh,
return JAYLINK_ERR_DEV_NOT_SUPPORTED;
if (tmp & EMUCOM_ERR) {
- log_err(ctx, "Failed to write to channel 0x%x.", channel);
+ log_err(ctx, "Failed to write to channel 0x%x: 0x%x.",
+ channel, tmp);
return JAYLINK_ERR_DEV;
}
diff --git a/libjaylink/swo.c b/libjaylink/swo.c
index 572be5a..7dfa7f7 100644
--- a/libjaylink/swo.c
+++ b/libjaylink/swo.c
@@ -394,7 +394,8 @@ JAYLINK_API int jaylink_swo_get_speeds(struct jaylink_device_handle *devh,
tmp = buffer_get_u32(buf, 0);
if (tmp & SWO_ERR) {
- log_err(ctx, "Failed to retrieve speed information.");
+ log_err(ctx, "Failed to retrieve speed information: 0x%x.",
+ tmp);
return JAYLINK_ERR_DEV;
}