Skip to content
Snippets Groups Projects
Commit a1ac34d3 authored by TSC21's avatar TSC21 Committed by Beat Küng
Browse files

reformat how the passed time is printed

parent cac84e14
No related branches found
No related tags found
No related merge requests found
......@@ -81,12 +81,8 @@ ORB_DEFINE(@multi_topic, struct @uorb_struct, @(struct_size-padding_end_size), _
void print_message(const @uorb_struct& message)
{
PX4_INFO_RAW(" @(uorb_struct)\n");
if (message.timestamp != 0) {
PX4_INFO_RAW("\t(%.6f seconds ago)\n", hrt_elapsed_time(&message.timestamp) / 1e6);
} else {
PX4_INFO_RAW("\n");
}
@[for field in sorted_fields]@
@( print_field(field) )@
@[end for]@
}
......@@ -246,7 +246,12 @@ def print_field(field):
print("\tprint_message(message."+ field.name + ");")
return
print("PX4_INFO_RAW(\"\\t" + field.name + ": " + c_type + "\\n\", " + field_name + ");" )
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\tprintf(\"\\n\");\n\t}" )
else:
print("PX4_INFO_RAW(\"\\t" + field.name + ": " + c_type + "\\n\", " + field_name + ");" )
def print_field_def(field):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment