+2016-05-21 Niibe Yutaka <gniibe@fsij.org>
+
+ * src/main.c (led_blink, main): Fix LED blink protocol.
+
2016-05-20 NIIBE Yutaka <gniibe@fsij.org>
* VERSION: 1.2.0.
#define LED_ONESHOT 1
#define LED_TWOSHOTS 2
#define LED_SHOW_STATUS 4
-#define LED_START_COMMAND 8
-#define LED_FINISH_COMMAND 16
-#define LED_FATAL 32
-#define LED_GNUK_EXEC 64
+#define LED_FATAL 8
+#define LED_SYNC 16
+#define LED_GNUK_EXEC 32
+#define LED_START_COMMAND 64
+#define LED_FINISH_COMMAND 128
void led_blink (int spec);
#if defined(PINPAD_SUPPORT)
void
led_blink (int spec)
{
+ if (spec == LED_START_COMMAND || spec == LED_FINISH_COMMAND)
+ {
+ led_inverted = (spec == LED_START_COMMAND);
+ spec = LED_SYNC;
+ }
+
eventflag_signal (&led_event, spec);
}
case LED_SHOW_STATUS:
display_status_code ();
break;
- case LED_START_COMMAND:
- set_led (1);
- led_inverted = 1;
- chopstx_usec_wait (LED_TIMEOUT_STOP);
- break;
- case LED_FINISH_COMMAND:
- led_inverted = 0;
- set_led (0);
- break;
case LED_FATAL:
display_fatal_code ();
break;
+ case LED_SYNC:
+ set_led (led_inverted);
+ break;
case LED_GNUK_EXEC:
goto exec;
default: