mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
msg: timestamp_sample print elapsed from timestamp
This commit is contained in:
parent
2bbdef205e
commit
c5cbc7725d
@ -89,6 +89,9 @@ void print_message(const @uorb_struct &message)
|
||||
PX4_INFO_RAW("Not implemented on flash constrained hardware\n");
|
||||
@[else]
|
||||
PX4_INFO_RAW(" @(uorb_struct)\n");
|
||||
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
|
||||
@[for field in sorted_fields]@
|
||||
@( print_field(field) )@
|
||||
@[end for]@
|
||||
|
||||
@ -298,7 +298,9 @@ def print_field(field):
|
||||
if field.name == 'timestamp':
|
||||
print(("if (message.timestamp != 0) {\n\t\tPX4_INFO_RAW(\"\\t" + field.name +
|
||||
": " + c_type + " (%.6f seconds ago)\\n\", " + field_name +
|
||||
", hrt_elapsed_time(&message.timestamp) / 1e6);\n\t} else {\n\t\tPX4_INFO_RAW(\"\\n\");\n\t}"))
|
||||
", (now - message.timestamp) / 1e6);\n\t} else {\n\t\tPX4_INFO_RAW(\"\\n\");\n\t}"))
|
||||
elif field.name == 'timestamp_sample':
|
||||
print(("\n\tPX4_INFO_RAW(\"\\t" + field.name + ": " + c_type + " (" + c_type + " us before timestamp)\\n\", " + field_name + ", message.timestamp - message.timestamp_sample);\n\t"))
|
||||
elif field.name == 'device_id':
|
||||
print("char device_id_buffer[80];")
|
||||
print("device::Device::device_id_print_buffer(device_id_buffer, sizeof(device_id_buffer), message.device_id);")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user