Fix reGNUal upgrade

This commit is contained in:
NIIBE Yutaka 2016-05-19 17:34:38 +09:00
parent d68bee21e5
commit 1e004bec78
3 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,10 @@
2016-05-19 Niibe Yutaka <gniibe@fsij.org>
* src/usb_ctrl.c (usb_cb_ctrl_write_finish): Set bDeviceState.
* src/usb-ccid.c: Rename from usb-icc.c.
(ccid_thread): Handle reGNUal upgrade.
* src/Makefile.in (CSRC): Follow the change.
* chopstx: Update to 0.11.

View File

@ -1370,6 +1370,7 @@ ccid_usb_reset (void)
void *
ccid_thread (void *arg)
{
extern uint32_t bDeviceState;
chopstx_intr_t interrupt;
uint32_t timeout;
@ -1511,6 +1512,13 @@ ccid_thread (void *arg)
c->application = 0;
}
/* Loading reGNUal. */
while (bDeviceState != UNCONNECTED)
{
chopstx_poll (NULL, 1, &interrupt);
usb_interrupt_handler ();
}
return NULL;
}

View File

@ -391,6 +391,7 @@ usb_cb_ctrl_write_finish (uint8_t req, uint8_t req_no, struct req_args *arg)
{
uint8_t type_rcp = req & (REQUEST_TYPE|RECIPIENT);
(void)arg;
if (type_rcp == (VENDOR_REQUEST | DEVICE_RECIPIENT))
{
if (USB_SETUP_SET (req) && req_no == USB_FSIJ_GNUK_EXEC)
@ -398,7 +399,7 @@ usb_cb_ctrl_write_finish (uint8_t req, uint8_t req_no, struct req_args *arg)
if (*icc_state_p != ICC_STATE_EXITED)
return;
(void)arg;
bDeviceState = UNCONNECTED;
usb_lld_prepare_shutdown (); /* No further USB communication */
led_blink (LED_GNUK_EXEC); /* Notify the main. */
}