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/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new f9d4a47889 pcf8575: fix compilation warnings
f9d4a47889 is described below

commit f9d4a47889b5679d368f27b24a734e7bc8b2f75a
Author: Michal Lenc <[email protected]>
AuthorDate: Tue Aug 29 11:59:33 2023 +0200

    pcf8575: fix compilation warnings
    
    Just few compile warning fixes in case CONFIG_IOEXPANDER_MULTIPIN is
    selected.
    
    Signed-off-by: Michal Lenc <[email protected]>
---
 drivers/ioexpander/pcf8575.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/ioexpander/pcf8575.c b/drivers/ioexpander/pcf8575.c
index c08b12dd62..4943d86115 100644
--- a/drivers/ioexpander/pcf8575.c
+++ b/drivers/ioexpander/pcf8575.c
@@ -63,9 +63,9 @@ static int pcf8575_readpin(FAR struct ioexpander_dev_s *dev, 
uint8_t pin,
              FAR bool *value);
 #ifdef CONFIG_IOEXPANDER_MULTIPIN
 static int pcf8575_multiwritepin(FAR struct ioexpander_dev_s *dev,
-             FAR uint8_t *pins, FAR bool *values, int count);
+             FAR const uint8_t *pins, FAR bool *values, int count);
 static int pcf8575_multireadpin(FAR struct ioexpander_dev_s *dev,
-             FAR uint8_t *pins, FAR bool *values, int count);
+             FAR const uint8_t *pins, FAR bool *values, int count);
 #endif
 
 /****************************************************************************
@@ -467,7 +467,7 @@ errout_with_lock:
 
 #ifdef CONFIG_IOEXPANDER_MULTIPIN
 static int pcf8575_multiwritepin(FAR struct ioexpander_dev_s *dev,
-                                 FAR uint8_t *pins, FAR bool *values,
+                                 FAR const uint8_t *pins, FAR bool *values,
                                  int count)
 {
   FAR struct pcf8575_dev_s *priv = (FAR struct pcf8575_dev_s *)dev;
@@ -501,7 +501,7 @@ static int pcf8575_multiwritepin(FAR struct 
ioexpander_dev_s *dev,
           return -ENXIO;
         }
 
-      gpioinfo("%d. pin=%u value=%u\n", pin, values[i]);
+      gpioinfo("%d. pin=%u value=%u\n", i, pin, values[i]);
 
       if ((priv->inpins & (1 << pin)) != 0)
         {
@@ -551,11 +551,11 @@ static int pcf8575_multiwritepin(FAR struct 
ioexpander_dev_s *dev,
 
 #ifdef CONFIG_IOEXPANDER_MULTIPIN
 static int pcf8575_multireadpin(FAR struct ioexpander_dev_s *dev,
-                                FAR uint8_t *pins, FAR bool *values,
+                                FAR const uint8_t *pins, FAR bool *values,
                                 int count)
 {
   FAR struct pcf8575_dev_s *priv = (FAR struct pcf8575_dev_s *)dev;
-  uint8_t regval;
+  uint16_t regval;
   uint8_t pin;
   int ret;
   int i;
@@ -615,7 +615,7 @@ static int pcf8575_multireadpin(FAR struct ioexpander_dev_s 
*dev,
           values[i] = ((regval & (1 << pin)) != 0);
         }
 
-      gpioinfo("%d. pin=%u value=%u\n", pin, values[i]);
+      gpioinfo("%d. pin=%u value=%u\n", i, pin, values[i]);
     }
 
   ret = OK;

Reply via email to