uORB print_message cleanup

- indent field print with tabs instead of spaces
 - print a newline before printing a nested field
 - cmake add generator dependencies
This commit is contained in:
Daniel Agar
2018-03-27 12:19:04 -04:00
parent c4c4441c87
commit 416feea9e4
3 changed files with 20 additions and 9 deletions
+9 -4
View File
@@ -80,9 +80,14 @@ ORB_DEFINE(@multi_topic, struct @uorb_struct, @(struct_size-padding_end_size), _
void print_message(const @uorb_struct& message)
{
printf(" @(uorb_struct)\n");
printf("\ttimestamp: %" PRIu64 " (%.6f seconds ago)\n", message.timestamp, hrt_elapsed_time(&message.timestamp) / 1e6);
printf(" @(uorb_struct)\n");
printf("\ttimestamp: %" PRIu64, message.timestamp);
if (message.timestamp != 0) {
printf(" (%.6f seconds ago)\n", hrt_elapsed_time(&message.timestamp) / 1e6);
} else {
printf("\n");
}
@[for field in sorted_fields]@
@( print_field(field) )
@[end for]
@( print_field(field) )@
@[end for]@
}