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 70f28553c examples/gps: fix a few printf formats
70f28553c is described below
commit 70f28553c625b9ab43929bf302503975169ce023
Author: YAMAMOTO Takashi <[email protected]>
AuthorDate: Thu Apr 10 14:05:22 2025 +0900
examples/gps: fix a few printf formats
references:
https://github.com/apache/nuttx/pull/16022
https://github.com/kosma/minmea/blob/4abb6f8da5f0fd6b7a7a1064b58e50cbe912043e/minmea.h#L241C15-L241C28
https://github.com/kosma/minmea/blob/4abb6f8da5f0fd6b7a7a1064b58e50cbe912043e/minmea.h#L43
Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
examples/gps/gps_main.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/examples/gps/gps_main.c b/examples/gps/gps_main.c
index f6e9e01d8..72673944d 100644
--- a/examples/gps/gps_main.c
+++ b/examples/gps/gps_main.c
@@ -99,11 +99,14 @@ int main(int argc, FAR char *argv[])
if (minmea_parse_rmc(&frame, line))
{
- printf("Fixed-point Latitude...........: %" PRId32 "\n",
+ printf("Fixed-point Latitude...........: %" PRIdLEAST32
+ "\n",
minmea_rescale(&frame.latitude, 1000));
- printf("Fixed-point Longitude..........: %" PRId32 "\n",
+ printf("Fixed-point Longitude..........: %" PRIdLEAST32
+ "\n",
minmea_rescale(&frame.longitude, 1000));
- printf("Fixed-point Speed..............: %" PRId32 "\n",
+ printf("Fixed-point Speed..............: %" PRIdLEAST32
+ "\n",
minmea_rescale(&frame.speed, 1000));
printf("Floating point degree latitude.: %2.6f\n",
minmea_tocoord(&frame.latitude));
@@ -127,7 +130,8 @@ int main(int argc, FAR char *argv[])
{
printf("Fix quality....................: %d\n",
frame.fix_quality);
- printf("Altitude.......................: %" PRId32 "\n",
+ printf("Altitude.......................: %" PRIdLEAST32
+ "\n",
frame.altitude.value);
printf("Tracked satellites.............: %d\n",
frame.satellites_tracked);