system/uORB: using lib_sprintf to output va_format and printf normal info in aosp adb shell
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
f0db02740b
commit
2ae831f40d
@ -348,11 +348,15 @@ int orb_sscanf(FAR const char *buf, FAR const char *format, FAR void *data)
|
||||
void orb_info(FAR const char *format, FAR const char *name,
|
||||
FAR const void *data)
|
||||
{
|
||||
struct lib_stdoutstream_s stdoutstream;
|
||||
struct va_format vaf;
|
||||
|
||||
vaf.fmt = format;
|
||||
vaf.va = (va_list *)data;
|
||||
uorbinfo_raw("%s(now:%" PRIu64 "):%pB\n", name, orb_absolute_time(), &vaf);
|
||||
|
||||
lib_stdoutstream(&stdoutstream, stdout);
|
||||
lib_sprintf(&stdoutstream.common, "%s(now:%" PRIu64 "):%pB",
|
||||
name, orb_absolute_time(), &vaf);
|
||||
}
|
||||
|
||||
int orb_fprintf(FAR FILE *stream, FAR const char *format,
|
||||
|
@ -121,7 +121,7 @@ typedef struct sensor_device_info_s orb_info_t;
|
||||
# define uorbdebug uorbnone
|
||||
#endif
|
||||
|
||||
#define uorbinfo_raw(fmt, ...) syslog(LOG_INFO, fmt "\n", ##__VA_ARGS__)
|
||||
#define uorbinfo_raw(fmt, ...) printf(fmt "\n", ##__VA_ARGS__)
|
||||
|
||||
/* Generates a pointer to the uORB metadata structure for
|
||||
* a given topic.
|
||||
|
Loading…
x
Reference in New Issue
Block a user