You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/05/19 08:11:27 UTC

[mynewt-core] branch master updated (f6817b9 -> 46037d6)

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

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


    from f6817b9  sensor_creator: Add LIS2DW12 configuration for bus drivers
     new c755a17  hw/drivers/spiram: Fix spiram link error
     new 46037d6  hw/drivers/spiram: Fix build warning for non bus driver build

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 hw/drivers/ram/spiram/pkg.yml      |  2 +-
 hw/drivers/ram/spiram/src/spiram.c | 16 +++++++---------
 2 files changed, 8 insertions(+), 10 deletions(-)

[mynewt-core] 01/02: hw/drivers/spiram: Fix spiram link error

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c755a17bc97231155072375b624128edae049bed
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed May 19 08:58:09 2021 +0200

    hw/drivers/spiram: Fix spiram link error
    
    spiram_init is only defined in spiram.c when SPIRAM_0 is set.
    
    Now package initialization is conditional on SPIRAM_0.
---
 hw/drivers/ram/spiram/pkg.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/drivers/ram/spiram/pkg.yml b/hw/drivers/ram/spiram/pkg.yml
index 222ed01..991c3d1 100644
--- a/hw/drivers/ram/spiram/pkg.yml
+++ b/hw/drivers/ram/spiram/pkg.yml
@@ -26,5 +26,5 @@ pkg.keywords:
 pkg.deps:
     - "@apache-mynewt-core/hw/hal"
 
-pkg.init:
+pkg.init.SPIRAM_0:
     spiram_init: 'MYNEWT_VAL(SPIRAM_SYSINIT_STAGE)'

[mynewt-core] 02/02: hw/drivers/spiram: Fix build warning for non bus driver build

Posted by je...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 46037d61581ecdae196a69d177e7d3dfa5a5b530
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed May 19 09:00:55 2021 +0200

    hw/drivers/spiram: Fix build warning for non bus driver build
    
    label end was used only in bus driver build.
    goto is now removed and ifs are used instead.
---
 hw/drivers/ram/spiram/src/spiram.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/hw/drivers/ram/spiram/src/spiram.c b/hw/drivers/ram/spiram/src/spiram.c
index c684bd4..29212e0 100644
--- a/hw/drivers/ram/spiram/src/spiram.c
+++ b/hw/drivers/ram/spiram/src/spiram.c
@@ -167,16 +167,15 @@ spiram_write(struct spiram_dev *dev, uint32_t addr, void *buf, uint32_t size)
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
         rc = bus_node_lock((struct os_dev *)&dev->dev,
                            BUS_NODE_LOCK_DEFAULT_TIMEOUT);
-        if (rc) {
-            goto end;
-        }
-        rc = bus_node_write((struct os_dev *)&dev->dev,
-                            cmd, dev->characteristics->address_bytes + 1,
-                            BUS_NODE_LOCK_DEFAULT_TIMEOUT, BUS_F_NOSTOP);
         if (rc == 0) {
-            rc = bus_node_simple_write((struct os_dev *)&dev->dev, buf, size);
+            rc = bus_node_write((struct os_dev *)&dev->dev,
+                                cmd, dev->characteristics->address_bytes + 1,
+                                BUS_NODE_LOCK_DEFAULT_TIMEOUT, BUS_F_NOSTOP);
+            if (rc == 0) {
+                rc = bus_node_simple_write((struct os_dev *)&dev->dev, buf, size);
+            }
+            (void)bus_node_unlock((struct os_dev *)&dev->dev);
         }
-        (void)bus_node_unlock((struct os_dev *)&dev->dev);
 #else
         spiram_cs_activate(dev);
         rc = hal_spi_txrx(dev->spi_num, cmd, NULL, dev->characteristics->address_bytes + 1);
@@ -186,7 +185,6 @@ spiram_write(struct spiram_dev *dev, uint32_t addr, void *buf, uint32_t size)
         spiram_cs_deactivate(dev);
 #endif
     }
-end:
     if (locked) {
         spiram_unlock(dev);
     }