mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
lib/parameters:Use inttypes
This commit is contained in:
parent
b4ebc68a40
commit
f50b238c78
@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2020 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2020, 2021 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -63,7 +63,8 @@ bool param_modify_on_import(bson_node_t node)
|
||||
strcpy(node->name, "COM_ARM_AUTH_ID");
|
||||
node->i = old_param.struct_value.authorizer_system_id;
|
||||
|
||||
PX4_INFO("migrating COM_ARM_AUTH: %d -> COM_ARM_AUTH_ID:%d, COM_ARM_AUTH_MET: %d and COM_ARM_AUTH_TO: %f",
|
||||
PX4_INFO("migrating COM_ARM_AUTH: %" PRId32 " -> COM_ARM_AUTH_ID:%" PRId8 ", COM_ARM_AUTH_MET: %" PRId32
|
||||
" and COM_ARM_AUTH_TO: %f",
|
||||
old_param.param_value,
|
||||
old_param.struct_value.authorizer_system_id,
|
||||
method,
|
||||
@ -258,7 +259,7 @@ bool param_modify_on_import(bson_node_t node)
|
||||
int32_t new_value = (int32_t)device_id.devid;
|
||||
|
||||
if (new_value != *ivalue) {
|
||||
PX4_INFO("param modify: %s, value=0x%x (old=0x%x)", node->name, new_value, (int32_t)*ivalue);
|
||||
PX4_INFO("param modify: %s, value=0x%" PRId32 " (old=0x%" PRId32 ")", node->name, new_value, (int32_t)*ivalue);
|
||||
*ivalue = new_value;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -497,12 +497,12 @@ param_get(param_t param, void *val)
|
||||
perf_count(param_get_perf);
|
||||
|
||||
if (!handle_in_range(param)) {
|
||||
PX4_ERR("get: param %d invalid", param);
|
||||
PX4_ERR("get: param %" PRId16 " invalid", param);
|
||||
return PX4_ERROR;
|
||||
}
|
||||
|
||||
if (!params_active[param]) {
|
||||
PX4_DEBUG("get: param %d (%s) not active", param, param_name(param));
|
||||
PX4_DEBUG("get: param %" PRId16 " (%s) not active", param, param_name(param));
|
||||
}
|
||||
|
||||
int result = PX4_ERROR;
|
||||
@ -1430,7 +1430,8 @@ param_import_internal(int fd, bool mark_saved)
|
||||
} while (result > 0);
|
||||
|
||||
if (result == 0) {
|
||||
PX4_INFO("BSON document size %d bytes, decoded %d bytes", decoder.total_document_size, decoder.total_decoded_size);
|
||||
PX4_INFO("BSON document size %" PRId32 " bytes, decoded %" PRId32 " bytes", decoder.total_document_size,
|
||||
decoder.total_decoded_size);
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user