From e4178464080fc2fb8e2ef4c53a364dae834d7d35 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 17 Nov 2017 12:29:32 +0900 Subject: [PATCH] More change for USB suspend. --- ChangeLog | 7 +++++++ chopstx | 2 +- src/main.c | 3 +++ src/usb-ccid.c | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7256039..3909402 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-11-17 NIIBE Yutaka + + * src/main.c (main): Call chopstx_conf_idle. + + * src/usb-ccid.c (usb_event_handle): Use 2 for call of + chopstx_conf_idle on suspend. + 2017-11-16 NIIBE Yutaka * src/gnuk.h (LED_OFF): New. diff --git a/chopstx b/chopstx index b34b9b6..e684e85 160000 --- a/chopstx +++ b/chopstx @@ -1 +1 @@ -Subproject commit b34b9b64408bcc915e1d494a7d4f639e525107b0 +Subproject commit e684e853c8770d8e4273926be1fbfd3315cb13a2 diff --git a/src/main.c b/src/main.c index 6fad946..b9968d4 100644 --- a/src/main.c +++ b/src/main.c @@ -40,6 +40,7 @@ #include #define main emulated_main #else +#include "mcu/cortex-m.h" #include "mcu/stm32f103.h" #endif @@ -228,6 +229,8 @@ main (int argc, const char *argv[]) #endif chopstx_t ccid_thd; + chopstx_conf_idle (1); + gnuk_malloc_init (); #ifdef GNU_LINUX_EMULATION diff --git a/src/usb-ccid.c b/src/usb-ccid.c index b220de3..3816dbc 100644 --- a/src/usb-ccid.c +++ b/src/usb-ccid.c @@ -1649,12 +1649,12 @@ usb_event_handle (struct usb_dev *dev) case USB_EVENT_DEVICE_SUSPEND: led_blink (LED_OFF); - chopstx_conf_idle (1); + chopstx_conf_idle (2); bDeviceState |= USB_DEVICE_STATE_SUSPEND; break; case USB_EVENT_DEVICE_WAKEUP: - chopstx_conf_idle (0); + chopstx_conf_idle (1); bDeviceState &= ~USB_DEVICE_STATE_SUSPEND; break;