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 2023/09/22 01:14:26 UTC
[nuttx-apps] branch master updated: Fixes compiler warnings while printing uint32_t and int32_t values.
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-apps.git
The following commit(s) were added to refs/heads/master by this push:
new e62e1e91f Fixes compiler warnings while printing uint32_t and int32_t values.
e62e1e91f is described below
commit e62e1e91fe742f09751314da9a3b5e349a42ea75
Author: Daniel P. Carvalho <da...@gmail.com>
AuthorDate: Thu Sep 21 12:10:15 2023 -0300
Fixes compiler warnings while printing uint32_t and int32_t values.
---
examples/ina226/ina226_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/examples/ina226/ina226_main.c b/examples/ina226/ina226_main.c
index e760397b5..69d040cdf 100644
--- a/examples/ina226/ina226_main.c
+++ b/examples/ina226/ina226_main.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -70,7 +71,8 @@ int main(int argc, FAR char *argv[])
break;
}
- printf("U=%12u uV I=%12d uA\n", sample.voltage, sample.current);
+ printf("U=%12"PRIu32 "uV I=%12"PRIi32 "uA\n", sample.voltage,
+ sample.current);
usleep(500000);
}