From 21a984f1a1cdce7730fe392423aa62e2db79a59e Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 28 Nov 2013 09:55:42 +0100 Subject: [PATCH] tools/spark_fp: add flashing period option --- tools/spark_fp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/spark_fp.c b/tools/spark_fp.c index 8ca112c..866e567 100644 --- a/tools/spark_fp.c +++ b/tools/spark_fp.c @@ -47,6 +47,7 @@ void usage() printf("\t-S : show standby RC code (n = 0..4 or \"all\")\n"); printf("\t-B :: set blue RC code (n = 0..4)\n"); printf("\t-S :: set standby RC code\n"); + printf("\t-p: set LED flashing period (in ms)\n"); printf("\t-l : set LED on\n"); printf("\t-L : set LED off\n"); printf("\t-i : set icon on\n"); @@ -130,6 +131,7 @@ int main(int argc, char **argv) int ret, c, val; time_t t, t2, diff; struct tm *tmp; + int period = LOG_ON; int fd = open(FP_DEV, O_RDWR); if (fd < 0) @@ -145,7 +147,7 @@ int main(int argc, char **argv) } ret = 0; - while ((c = getopt (argc, argv, "gs:tw:Tl:L:P:S:B:i:I:")) != -1) + while ((c = getopt (argc, argv, "gs:tw:Tl:L:P:S:B:i:I:p:")) != -1) { switch (c) { @@ -219,8 +221,11 @@ int main(int argc, char **argv) case 'P': ret = ioctl(fd, VFDPOWEROFF); break; + case 'p': + period = atoi(optarg)/10; + break; case 'l': /* LED on */ - aotom.u.led.on = LOG_ON; + aotom.u.led.on = period; aotom.u.led.led_nr = atoi(optarg); ioctl(fd, VFDSETLED, &aotom); break;