spark_fp: add options for setting led status

from git://gitorious.org/~martii/neutrino-hd/martiis-libstb-hal.git
This commit is contained in:
Stefan Seyfried
2013-02-24 13:07:54 +01:00
parent 6ec87214f2
commit 70979f4df3

View File

@@ -42,6 +42,8 @@ void usage()
printf("\t-t: get current FP time\n");
printf("\t-s <time>: set FP time (time = 0: use current time)\n");
printf("\t-w <time>: set FP wakeup time and power down (time = 1: no wakeup)\n");
printf("\t-l <n>: set LED <n> on\n");
printf("\t-L <n>: set LED <n> off\n");
printf("times are given in unix time (UTC, seconds since 1970-01-01 00:00:00)\n");
printf("\n");
}
@@ -136,7 +138,7 @@ int main(int argc, char **argv)
}
ret = 0;
while ((c = getopt (argc, argv, "gs:tw:T")) != -1)
while ((c = getopt (argc, argv, "gs:tw:Tl:L:")) != -1)
{
switch (c)
{
@@ -220,6 +222,16 @@ int main(int argc, char **argv)
*/
sleep(2); /* not reached... */
break;
case 'l': /* LED on */
aotom.u.led.on = LOG_ON;
aotom.u.led.led_nr = atoi(optarg);
ioctl(fd, VFDSETLED, &aotom);
break;
case 'L': /* LED off */
aotom.u.led.on = LOG_OFF;
aotom.u.led.led_nr = atoi(optarg);
ioctl(fd, VFDSETLED, &aotom);
break;
case 'T':
ret = ioctl(fd, VFDGETVERSION, &val);
if (ret < 0)