You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/04/27 07:29:52 UTC

[incubator-nuttx-apps] branch master updated (267aba6 -> 5b26068)

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

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git.


    from 267aba6  addroute: inet_pton cannot accept slash notation. We must fixup the argument before calling.
     new 63d59b0  system/spi: Print sent data in the same way as received.
     new 5b26068  system/spi: Fix NxStyle issues

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:
 system/spi/spi_exch.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

[incubator-nuttx-apps] 01/02: system/spi: Print sent data in the same way as received.

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

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 63d59b0acf398293e2b76d3813ce6b9b64d4a5d2
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Apr 26 14:52:09 2021 -0300

    system/spi: Print sent data in the same way as received.
    
    This eases the comparison for testing SPI with looped back MOSI and MISO
    signals.
---
 system/spi/spi_exch.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/system/spi/spi_exch.c b/system/spi/spi_exch.c
index 6bdee9e..3616d6f 100644
--- a/system/spi/spi_exch.c
+++ b/system/spi/spi_exch.c
@@ -132,6 +132,21 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv)
       argndx += 1;
     }
 
+  spitool_printf(spitool, "Sending:\t");
+  for (d = 0; d < spitool->count; d++)
+    {
+      if (spitool->width <= 8)
+        {
+          spitool_printf(spitool, "%02X ", txdata[d]);
+        }
+      else
+        {
+          spitool_printf(spitool, "%04X ", ((uint16_t *)txdata)[d]);
+        }
+    }
+
+  spitool_printf(spitool, "\n");
+
   /* Get a handle to the SPI bus */
 
   fd = spidev_open(spitool->bus);
@@ -168,7 +183,7 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv)
       return ret;
     }
 
-  spitool_printf(spitool, "Received: ");
+  spitool_printf(spitool, "Received:\t");
   for (d = 0; d < spitool->count; d++)
     {
       if (spitool->width <= 8)

[incubator-nuttx-apps] 02/02: system/spi: Fix NxStyle issues

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

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 5b26068635f14e3221645a046c2c63f7df6f0a14
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Apr 26 15:05:42 2021 -0300

    system/spi: Fix NxStyle issues
---
 system/spi/spi_exch.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/system/spi/spi_exch.c b/system/spi/spi_exch.c
index 3616d6f..2f69141 100644
--- a/system/spi/spi_exch.c
+++ b/system/spi/spi_exch.c
@@ -71,10 +71,12 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv)
   {
     0
   };
+
   uint8_t rxdata[MAX_XDATA] =
   {
     0
   };
+
   uint8_t *txdatap = txdata;
   struct spi_trans_s trans;
   struct spi_sequence_s seq;
@@ -111,7 +113,6 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv)
       return ERROR;
     }
 
-
   while (argndx < argc)
     {
       FAR uint8_t *a = (uint8_t *)argv[argndx];
@@ -119,7 +120,7 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv)
         {
           if ((*(a + 1) == 0) || !ISHEX(*a) || !ISHEX(*(a + 1)))
             {
-              /* Uneven number of characters or illegal char .... that's an error */
+              /* Uneven number of characters or illegal character error */
 
               spitool_printf(spitool, g_spiincompleteparam, argv[0]);
               return ERROR;