tools/spark_fp: add option for enabling/disabling icons

Origin commit data
------------------
Branch: master
Commit: 8f0f5dd29a
Author: martii <m4rtii@gmx.de>
Date: 2013-11-13 (Wed, 13 Nov 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-11-13 20:37:46 +01:00
parent 76700e710d
commit 6b280b917e

View File

@@ -49,6 +49,8 @@ void usage()
printf("\t-S <n>:<predata><code>: set standby RC code\n"); printf("\t-S <n>:<predata><code>: set standby RC code\n");
printf("\t-l <n>: set LED <n> on\n"); printf("\t-l <n>: set LED <n> on\n");
printf("\t-L <n>: set LED <n> off\n"); printf("\t-L <n>: set LED <n> off\n");
printf("\t-i <n>: set icon <n> on\n");
printf("\t-I <n>: set icon <n> off\n");
printf("times are given in unix time (UTC, seconds since 1970-01-01 00:00:00)\n"); printf("times are given in unix time (UTC, seconds since 1970-01-01 00:00:00)\n");
printf("\n"); printf("\n");
} }
@@ -143,7 +145,7 @@ int main(int argc, char **argv)
} }
ret = 0; ret = 0;
while ((c = getopt (argc, argv, "gs:tw:Tl:L:P:S:B:")) != -1) while ((c = getopt (argc, argv, "gs:tw:Tl:L:P:S:B:i:I:")) != -1)
{ {
switch (c) switch (c)
{ {
@@ -227,6 +229,16 @@ int main(int argc, char **argv)
aotom.u.led.led_nr = atoi(optarg); aotom.u.led.led_nr = atoi(optarg);
ioctl(fd, VFDSETLED, &aotom); ioctl(fd, VFDSETLED, &aotom);
break; break;
case 'i': /* icon on */
aotom.u.icon.on = 1;
aotom.u.icon.icon_nr = atoi(optarg);
ioctl(fd, VFDICONDISPLAYONOFF, &aotom);
break;
case 'I': /* icon off */
aotom.u.icon.on = 0;
aotom.u.icon.icon_nr = atoi(optarg);
ioctl(fd, VFDICONDISPLAYONOFF, &aotom);
break;
case 'T': case 'T':
ret = ioctl(fd, VFDGETVERSION, &val); ret = ioctl(fd, VFDGETVERSION, &val);
if (ret < 0) if (ret < 0)