You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "radek-pesina (via GitHub)" <gi...@apache.org> on 2023/05/05 05:37:00 UTC

[GitHub] [nuttx-apps] radek-pesina commented on a diff in pull request #1739: spitool: add support for 32-bit SPI BUS width

radek-pesina commented on code in PR #1739:
URL: https://github.com/apache/nuttx-apps/pull/1739#discussion_r1185714555


##########
system/spi/spi_exch.c:
##########
@@ -175,10 +179,14 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv)
         {
           spitool_printf(spitool, "%02X ", rxdata[d]);
         }
-      else
+      else if (spitool->width <= 16)
         {
           spitool_printf(spitool, "%04X ", ((uint16_t *)rxdata)[d]);
         }
+      else
+        {
+          spitool_printf(spitool, "%08lX ", ((uint32_t *)rxdata)[d]);

Review Comment:
   Done.



##########
system/spi/spi_exch.c:
##########
@@ -124,10 +124,14 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv)
         {
           spitool_printf(spitool, "%02X ", txdata[d]);
         }
-      else
+      else if (spitool->width <= 16)
         {
           spitool_printf(spitool, "%04X ", ((uint16_t *)txdata)[d]);
         }
+      else
+        {
+          spitool_printf(spitool, "%08lX ", ((uint32_t *)txdata)[d]);

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org