Skip to content

Commit

Permalink
ptrig: trig: cosmetic cleanup and added additional config/port doc
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Klotzbuecher <mk@mkio.de>
  • Loading branch information
kmarkus committed Jan 6, 2020
1 parent 2473af3 commit dee2b93
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 44 deletions.
44 changes: 12 additions & 32 deletions std_blocks/trig/ptrig.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,8 @@ char ptrig_meta[] =
"}";

ubx_port_t ptrig_ports[] = {
{ .name="tstats",
.out_type_name="struct ubx_tstat",
.doc="out port for totals and per block timing statistics"
},
{ .name="shutdown",
.in_type_name="int",
.doc="in port for stopping ptrig"
},
{ .name="tstats", .out_type_name="struct ubx_tstat", .doc="out port for totals and per block timing statistics" },
{ .name="shutdown", .in_type_name="int", .doc="input port for stopping ptrig" },
{ NULL },
};

Expand All @@ -52,30 +46,16 @@ ubx_type_t ptrig_types[] = {

/* configuration */
ubx_config_t ptrig_config[] = {
{ .name="period", .type_name = "struct ptrig_period",
.doc="trigger period in { sec, ns }",
},
{ .name="stacksize", .type_name = "size_t",
.doc="stacksize as per pthread_attr_setstacksize(3)"
},
{ .name="sched_priority", .type_name = "int" },
{ .name="sched_policy", .type_name = "char" },
{ .name="thread_name", .type_name = "char" },
{ .name="trig_blocks", .type_name = "struct ubx_trig_spec",
.doc="trigger conf: which block and how to trigger"
},
{ .name="profile_path", .type_name = "char" },
{ .name="tstats_enabled", .type_name = "int",
.doc="enable timing statistics over all blocks",
},
{ .name="tstats_output_rate",
.type_name = "unsigned int",
.doc="output tstats only on every tstats_output_rate'th trigger (0 to disable)"
},
{ .name="tstats_print_on_stop",
.type_name = "int",
.doc="print tstats in stop()",
},
{ .name="period", .type_name = "struct ptrig_period", .doc="trigger period in { sec, ns }", },
{ .name="stacksize", .type_name = "size_t", .doc="stacksize as per pthread_attr_setstacksize(3)" },
{ .name="sched_priority", .type_name = "int", .doc="pthread priority" },
{ .name="sched_policy", .type_name = "char", .doc="pthread scheduling policy" },
{ .name="thread_name", .type_name = "char", .doc="thread name (for dbg), default is block name" },
{ .name="trig_blocks", .type_name = "struct ubx_trig_spec", .doc="specification of blocks to trigger" },
{ .name="profile_path", .type_name = "char", doc="file to which to write the timing statistics" },
{ .name="tstats_enabled", .type_name = "int", .doc="enable timing statistics over all blocks", },
{ .name="tstats_output_rate", .type_name = "unsigned int", .doc="output tstats only on every tstats_output_rate'th trigger (0 to disable)" },
{ .name="tstats_print_on_stop", .type_name = "int", .doc="print tstats in stop hook", },
{ NULL },
};

Expand Down
16 changes: 4 additions & 12 deletions std_blocks/trig/trig.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,10 @@ ubx_port_t trig_ports[] = {
/* configuration */
ubx_config_t trig_config[] = {
{ .name="trig_blocks", .type_name = "struct trig_config", .doc="describes which blocks to trigger" },
{ .name="profile_path", .type_name = "char" },
{ .name="tstats_enabled", .type_name = "int",
.doc="enable timing statistics over all blocks",
},
{ .name="tstats_output_rate",
.type_name = "unsigned int",
.doc="output tstats only on every tstats_output_rate'th trigger (0 to disable)"
},
{ .name="tstats_print_on_stop",
.type_name = "int",
.doc="print tstats in stop()",
},
{ .name="profile_path", .type_name = "char", doc="file to which to write the timing statistics" },
{ .name="tstats_enabled", .type_name = "int", .doc="enable timing statistics over all blocks", },
{ .name="tstats_output_rate", .type_name = "unsigned int", .doc="output tstats only on every N'th trigger (0 to disable)" },
{ .name="tstats_print_on_stop", .type_name = "int", .doc="print tstats in stop hook", },
{ .name="loglevel", .type_name="int" },
{ NULL },
};
Expand Down

0 comments on commit dee2b93

Please sign in to comment.