mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 04:06:33 +08:00
Improve formatting of topic listener output
This commit is contained in:
@@ -108,7 +108,7 @@ print("""
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#ifndef PRIu64
|
#ifndef PRIu64
|
||||||
#define PRIu64 "ull"
|
#define PRIu64 "llu"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
""")
|
""")
|
||||||
@@ -140,11 +140,11 @@ for index,m in enumerate(messages[1:]):
|
|||||||
print("\t\tstruct %s_s container;" % m)
|
print("\t\tstruct %s_s container;" % m)
|
||||||
print("\t\tmemset(&container, 0, sizeof(container));")
|
print("\t\tmemset(&container, 0, sizeof(container));")
|
||||||
print("\t\tbool updated;")
|
print("\t\tbool updated;")
|
||||||
print("\t\tfor(uint32_t i = 0;i<num_msgs;i++) {")
|
print("\t\tfor (unsigned i = 0; i < num_msgs; i++) {")
|
||||||
print("\t\t\torb_check(sub,&updated);")
|
print("\t\t\torb_check(sub,&updated);")
|
||||||
print("\t\t\tupdated = true;")
|
print("\t\t\tupdated = true;")
|
||||||
print("\t\t\tif (updated) {")
|
print("\t\t\tif (updated) {")
|
||||||
print("\t\tprintf(\"\\nTOPIC: %s\");" % m)
|
print("\t\tprintf(\"\\nTOPIC: %s #%%d\\n\", i);" % m)
|
||||||
print("\t\t\torb_copy(ID,sub,&container);")
|
print("\t\t\torb_copy(ID,sub,&container);")
|
||||||
for item in message_elements[index+1]:
|
for item in message_elements[index+1]:
|
||||||
if item[0] == "float":
|
if item[0] == "float":
|
||||||
|
|||||||
Reference in New Issue
Block a user