mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-07 20:31:20 +08:00
uorb:Fixed the abnormal issue of printing uint16 with PRIu16.
The PRIu16 macro in the system is defined as "u", and "hu" is required. In Linux and Nuttx, PRIu32 PRIu16 PRIu8 are all defined as "u", but %pB prints the structure and needs its offset. %pB gets the offset through sizeof(short int) Signed-off-by: likun17 <likun17@xiaomi.com>
This commit is contained in:
parent
8b17cfedf2
commit
06181f0b00
@ -31,7 +31,7 @@
|
|||||||
#ifdef CONFIG_DEBUG_UORB
|
#ifdef CONFIG_DEBUG_UORB
|
||||||
static const char sensor_ppgd_format[] =
|
static const char sensor_ppgd_format[] =
|
||||||
"timestamp:%" PRIu64 ",ppg0:%" PRIu32 ",ppg1:%" PRIu32 ","
|
"timestamp:%" PRIu64 ",ppg0:%" PRIu32 ",ppg1:%" PRIu32 ","
|
||||||
"current:%" PRIu32 ",gain0:%" PRIu16 ",gain1:%" PRIu16 "";
|
"current:%" PRIu32 ",gain0:%hu,gain1:%hu";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -31,8 +31,8 @@
|
|||||||
#ifdef CONFIG_DEBUG_UORB
|
#ifdef CONFIG_DEBUG_UORB
|
||||||
static const char sensor_ppgq_format[] =
|
static const char sensor_ppgq_format[] =
|
||||||
"timestamp:%" PRIu64 ",ppg0:%" PRIu32 ",ppg1:%" PRIu32 ",ppg2:%" PRIu32 ","
|
"timestamp:%" PRIu64 ",ppg0:%" PRIu32 ",ppg1:%" PRIu32 ",ppg2:%" PRIu32 ","
|
||||||
"ppg3:%" PRIu32 ",current:%" PRIu32 ",gain0:%" PRIu16 ",gain1:%" PRIu16 ","
|
"ppg3:%" PRIu32 ",current:%" PRIu32 ",gain0:%hu,gain1:%hu,gain2:%hu,"
|
||||||
"gain2:%" PRIu16 ",gain3:%" PRIu16 "";
|
"gain3:%hu";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user