Skip to content

Commit

Permalink
tools: gpio: add option to report wall-clock time to gpio-event-mon
Browse files Browse the repository at this point in the history
Add support for selecting the realtime clock for events.

Signed-off-by: Kent Gibson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
warthog618 authored and linusw committed Dec 5, 2020
1 parent da777be commit e0822cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/gpio/gpio-event-mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ void print_usage(void)
" -s Set line as open source\n"
" -r Listen for rising edges\n"
" -f Listen for falling edges\n"
" -w Report the wall-clock time for events\n"
" -b <n> Debounce the line with period n microseconds\n"
" [-c <n>] Do <n> loops (optional, infinite loop if not stated)\n"
" -? This helptext\n"
Expand All @@ -173,7 +174,7 @@ int main(int argc, char **argv)

memset(&config, 0, sizeof(config));
config.flags = GPIO_V2_LINE_FLAG_INPUT;
while ((c = getopt(argc, argv, "c:n:o:b:dsrf?")) != -1) {
while ((c = getopt(argc, argv, "c:n:o:b:dsrfw?")) != -1) {
switch (c) {
case 'c':
loops = strtoul(optarg, NULL, 10);
Expand Down Expand Up @@ -204,6 +205,9 @@ int main(int argc, char **argv)
case 'f':
config.flags |= GPIO_V2_LINE_FLAG_EDGE_FALLING;
break;
case 'w':
config.flags |= GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME;
break;
case '?':
print_usage();
return -1;
Expand Down

0 comments on commit e0822cf

Please sign in to comment.