You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2019/01/09 10:07:02 UTC

[mynewt-core] 01/08: [donotmerge] hw/bus: Debug printouts

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch bus-dev-test
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 0c0024770e4e646b01fbfc9c9326bb7cd118e561
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Nov 26 16:16:29 2018 +0100

    [donotmerge] hw/bus: Debug printouts
---
 hw/bus/src/bus.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/hw/bus/src/bus.c b/hw/bus/src/bus.c
index 93f7153..fa5399a 100644
--- a/hw/bus/src/bus.c
+++ b/hw/bus/src/bus.c
@@ -26,6 +26,7 @@
 #if MYNEWT_VAL(BUS_STATS)
 #include "stats/stats.h"
 #endif
+#include "console/console.h"
 
 static os_time_t g_bus_node_lock_timeout;
 
@@ -222,6 +223,7 @@ bus_node_read(struct os_dev *node, void *buf, uint16_t length,
 
     rc = bus_node_lock(node, bus_node_get_lock_timeout(node));
     if (rc) {
+        console_printf("\x1B[1;31m%s: bnode %p rc %d\x1B[0m\n", __func__, bnode, rc);
         return rc;
     }
 
@@ -233,6 +235,10 @@ bus_node_read(struct os_dev *node, void *buf, uint16_t length,
 
     (void)bus_node_unlock(node);
 
+    if (rc) {
+        console_printf("\x1B[1;31m%s: bnode %p rc %d\x1B[0m\n", __func__, bnode, rc);
+    }
+
     return rc;
 }
 
@@ -253,6 +259,7 @@ bus_node_write(struct os_dev *node, const void *buf, uint16_t length,
 
     rc = bus_node_lock(node, bus_node_get_lock_timeout(node));
     if (rc) {
+        console_printf("\x1B[1;31m%s: bnode %p rc %d\x1B[0m\n", __func__, bnode, rc);
         return rc;
     }
 
@@ -264,6 +271,10 @@ bus_node_write(struct os_dev *node, const void *buf, uint16_t length,
 
     (void)bus_node_unlock(node);
 
+    if (rc) {
+        console_printf("\x1B[1;31m%s: bnode %p rc %d\x1B[0m\n", __func__, bnode, rc);
+    }
+
     return rc;
 }
 
@@ -285,6 +296,7 @@ bus_node_write_read_transact(struct os_dev *node, const void *wbuf,
 
     rc = bus_node_lock(node, bus_node_get_lock_timeout(node));
     if (rc) {
+        console_printf("\x1B[1;31m%s: bnode %p rc %d\x1B[0m\n", __func__, bnode, rc);
         return rc;
     }
 
@@ -311,6 +323,10 @@ bus_node_write_read_transact(struct os_dev *node, const void *wbuf,
 done:
     (void)bus_node_unlock(node);
 
+    if (rc) {
+        console_printf("\x1B[1;31m%s: bnode %p rc %d\x1B[0m\n", __func__, bnode, rc);
+    }
+
     return rc;
 }