Make sure to turn off LED on suspend.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 16 Nov 2017 04:08:00 +0000 (13:08 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 16 Nov 2017 04:08:00 +0000 (13:08 +0900)
ChangeLog
chopstx
src/gnuk.h
src/usb-ccid.c

index 5c4bf2c..7256039 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
 2017-11-16  NIIBE Yutaka  <gniibe@fsij.org>
 
-       * src/usb-ccid.c (ccid_thread): Use constant pointer for
-       chopstx_poll.
+       * src/gnuk.h (LED_OFF): New.
+
+       * src/usb-ccid.c (usb_event_handle): LED off on sleep.
+       (ccid_thread): Use constant pointer for chopstx_poll.
        (poll_event_intr): Remove.
 
 2017-11-15  NIIBE Yutaka  <gniibe@fsij.org>
diff --git a/chopstx b/chopstx
index 3552fc5..b34b9b6 160000 (submodule)
--- a/chopstx
+++ b/chopstx
@@ -1 +1 @@
-Subproject commit 3552fc5615fff7c7be3f96a0e7e9ac81470a82cb
+Subproject commit b34b9b64408bcc915e1d494a7d4f639e525107b0
index 1f0be6c..e0e05cf 100644 (file)
@@ -434,6 +434,7 @@ extern const uint8_t gnuk_string_serial[];
 #define LED_GNUK_EXEC           32
 #define LED_START_COMMAND       64
 #define LED_FINISH_COMMAND     128
+#define LED_OFF         LED_FINISH_COMMAND
 void led_blink (int spec);
 
 #if defined(PINPAD_SUPPORT)
index f78f763..b220de3 100644 (file)
@@ -1648,6 +1648,7 @@ usb_event_handle (struct usb_dev *dev)
       break;
 
     case USB_EVENT_DEVICE_SUSPEND:
+      led_blink (LED_OFF);
       chopstx_conf_idle (1);
       bDeviceState |= USB_DEVICE_STATE_SUSPEND;
       break;