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 2018/11/29 21:08:41 UTC

[mynewt-core] 11/14: hw/bus/i2c: Fix operation timeouts

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

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

commit 42b4ece8c6967ac94c947f4032c67058bb845b7e
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Nov 26 12:19:12 2018 +0100

    hw/bus/i2c: Fix operation timeouts
    
    These are specified in ticks in HAL already.
---
 hw/bus/i2c/src/i2c.c | 6 ++----
 hw/bus/syscfg.yml    | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/bus/i2c/src/i2c.c b/hw/bus/i2c/src/i2c.c
index 16827cc..10feca6 100644
--- a/hw/bus/i2c/src/i2c.c
+++ b/hw/bus/i2c/src/i2c.c
@@ -98,8 +98,7 @@ bus_i2c_read(struct bus_dev *bdev, struct bus_node *bnode, uint8_t *buf,
 
     last_op = !(flags & BUS_F_NOSTOP);
 
-    rc = hal_i2c_master_read(dev->cfg.i2c_num, &i2c_data,
-                             os_time_ticks_to_ms32(timeout), last_op);
+    rc = hal_i2c_master_read(dev->cfg.i2c_num, &i2c_data, timeout, last_op);
 
     return rc;
 }
@@ -123,8 +122,7 @@ bus_i2c_write(struct bus_dev *bdev, struct bus_node *bnode, const uint8_t *buf,
 
     last_op = !(flags & BUS_F_NOSTOP);
 
-    rc = hal_i2c_master_write(dev->cfg.i2c_num, &i2c_data,
-                              os_time_ticks_to_ms32(timeout), last_op);
+    rc = hal_i2c_master_write(dev->cfg.i2c_num, &i2c_data, timeout, last_op);
 
     return rc;
 }
diff --git a/hw/bus/syscfg.yml b/hw/bus/syscfg.yml
index 7a19cde..b7e03f3 100644
--- a/hw/bus/syscfg.yml
+++ b/hw/bus/syscfg.yml
@@ -30,7 +30,7 @@ syscfg.defs:
         description: >
             Default timeout for transaction on bus. This is used for simple
             transaction APIs (i.e. without timeout set explicitly)
-        value: 10
+        value: 50
 
     BUS_DEBUG_OS_DEV:
         description: >