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/12/28 08:48:41 UTC

[incubator-nuttx-apps] branch master updated (5ac1513 -> 7b48a11)

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 5ac1513  apps: remove space befone newline in logs
     new 2f44643  canutils: odb_decodepid: fix two debug prints
     new 7b48a11  canutils: odb_decodepid: 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:
 canutils/libobd2/obd_decodepid.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

[incubator-nuttx-apps] 01/02: canutils: odb_decodepid: fix two debug prints

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 2f446437043978017d01659bd1778db439f362a4
Author: Eero Nurkkala <ee...@offcode.fi>
AuthorDate: Mon Dec 27 14:50:50 2021 +0200

    canutils: odb_decodepid: fix two debug prints
    
    Fix the following printfs, as reported by cppcheck:
    
    canutils/libobd2/obd_decodepid.c:85:9: error: printf format string requires 1 parameter but only 0 are given. [wrongPrintfScanfArgNum]
            printf("Supported PIDs: %08X\n");
            ^
    canutils/libobd2/obd_decodepid.c:114:9: error: printf format string requires 2 parameters but only 1 is given. [wrongPrintfScanfArgNum]
            printf("Throttle position = %d\% \n", (100 * dev->data[3])/255);
            ^
    
    Signed-off-by: Eero Nurkkala <ee...@offcode.fi>
---
 canutils/libobd2/obd_decodepid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/canutils/libobd2/obd_decodepid.c b/canutils/libobd2/obd_decodepid.c
index 571dba1..edea383 100644
--- a/canutils/libobd2/obd_decodepid.c
+++ b/canutils/libobd2/obd_decodepid.c
@@ -82,7 +82,7 @@ FAR char *obd_decode_pid(FAR struct obd_dev_s *dev, uint8_t pid)
                (dev->data[5] << 8) | dev->data[6];
         snprintf(g_data, MAXDATA, "%08X", pids);
 #ifdef CONFIG_DEBUG_INFO
-        printf("Supported PIDs: %08X\n");
+        printf("Supported PIDs: %08X\n", pids);
 #endif
         break;
 
@@ -111,7 +111,7 @@ FAR char *obd_decode_pid(FAR struct obd_dev_s *dev, uint8_t pid)
       case OBD_PID_THROTTLE_POSITION:
         snprintf(g_data, MAXDATA, "%d", (100 * dev->data[3])/255);
 #ifdef CONFIG_DEBUG_INFO
-        printf("Throttle position = %d\%\n", (100 * dev->data[3])/255);
+        printf("Throttle position = %d\n", (100 * dev->data[3]) / 255);
 #endif
         break;
     }

[incubator-nuttx-apps] 02/02: canutils: odb_decodepid: 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 7b48a119acc8ffe6f4beb7d88f3d57dc5c24c562
Author: Eero Nurkkala <ee...@offcode.fi>
AuthorDate: Tue Dec 28 07:52:43 2021 +0200

    canutils: odb_decodepid: fix nxstyle issues
    
    Fix the following nxstyle issue on the file:
    error: Operator/assignment must be followed with whitespace
    
    Signed-off-by: Eero Nurkkala <ee...@offcode.fi>
---
 canutils/libobd2/obd_decodepid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/canutils/libobd2/obd_decodepid.c b/canutils/libobd2/obd_decodepid.c
index edea383..3a3439a 100644
--- a/canutils/libobd2/obd_decodepid.c
+++ b/canutils/libobd2/obd_decodepid.c
@@ -94,7 +94,7 @@ FAR char *obd_decode_pid(FAR struct obd_dev_s *dev, uint8_t pid)
         break;
 
       case OBD_PID_RPM:
-        rpm = ((256 * dev->data[3]) + dev->data[4])/4;
+        rpm = ((256 * dev->data[3]) + dev->data[4]) / 4;
         snprintf(g_data, MAXDATA, "%d", rpm);
 #ifdef CONFIG_DEBUG_INFO
         printf("RPM = %d\n", rpm);
@@ -109,7 +109,7 @@ FAR char *obd_decode_pid(FAR struct obd_dev_s *dev, uint8_t pid)
         break;
 
       case OBD_PID_THROTTLE_POSITION:
-        snprintf(g_data, MAXDATA, "%d", (100 * dev->data[3])/255);
+        snprintf(g_data, MAXDATA, "%d", (100 * dev->data[3]) / 255);
 #ifdef CONFIG_DEBUG_INFO
         printf("Throttle position = %d\n", (100 * dev->data[3]) / 255);
 #endif