Lower power consumption on suspend.

This commit is contained in:
NIIBE Yutaka
2017-11-15 10:59:55 +09:00
parent e85527d302
commit f4b36b7503
4 changed files with 13 additions and 4 deletions

View File

@@ -1648,10 +1648,12 @@ usb_event_handle (struct usb_dev *dev)
break;
case USB_EVENT_DEVICE_SUSPEND:
chopstx_conf_idle (1);
bDeviceState |= USB_DEVICE_STATE_SUSPEND;
break;
case USB_EVENT_DEVICE_WAKEUP:
chopstx_conf_idle (0);
bDeviceState &= ~USB_DEVICE_STATE_SUSPEND;
break;
@@ -1731,8 +1733,9 @@ ccid_thread (void *arg)
/* RESET handling:
* (1) After DEVICE_RESET, it needs to re-start out of the loop.
* (2) After SET_INTERFACE, the endpoint is reset to RX_NAK.
* It needs to prepare receive again.
* (2) After SET_CONFIGURATION or SET_INTERFACE, the
* endpoint is reset to RX_NAK. It needs to prepare
* receive again.
*/
if (c->application)
{