Fix reGNUal upgrade
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
2016-05-19 Niibe Yutaka <gniibe@fsij.org>
|
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.
|
* src/usb-ccid.c: Rename from usb-icc.c.
|
||||||
|
(ccid_thread): Handle reGNUal upgrade.
|
||||||
|
|
||||||
* src/Makefile.in (CSRC): Follow the change.
|
* src/Makefile.in (CSRC): Follow the change.
|
||||||
|
|
||||||
* chopstx: Update to 0.11.
|
* chopstx: Update to 0.11.
|
||||||
|
|||||||
@@ -1370,6 +1370,7 @@ ccid_usb_reset (void)
|
|||||||
void *
|
void *
|
||||||
ccid_thread (void *arg)
|
ccid_thread (void *arg)
|
||||||
{
|
{
|
||||||
|
extern uint32_t bDeviceState;
|
||||||
chopstx_intr_t interrupt;
|
chopstx_intr_t interrupt;
|
||||||
uint32_t timeout;
|
uint32_t timeout;
|
||||||
|
|
||||||
@@ -1511,6 +1512,13 @@ ccid_thread (void *arg)
|
|||||||
c->application = 0;
|
c->application = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Loading reGNUal. */
|
||||||
|
while (bDeviceState != UNCONNECTED)
|
||||||
|
{
|
||||||
|
chopstx_poll (NULL, 1, &interrupt);
|
||||||
|
usb_interrupt_handler ();
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
uint8_t type_rcp = req & (REQUEST_TYPE|RECIPIENT);
|
||||||
|
|
||||||
|
(void)arg;
|
||||||
if (type_rcp == (VENDOR_REQUEST | DEVICE_RECIPIENT))
|
if (type_rcp == (VENDOR_REQUEST | DEVICE_RECIPIENT))
|
||||||
{
|
{
|
||||||
if (USB_SETUP_SET (req) && req_no == USB_FSIJ_GNUK_EXEC)
|
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)
|
if (*icc_state_p != ICC_STATE_EXITED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
(void)arg;
|
bDeviceState = UNCONNECTED;
|
||||||
usb_lld_prepare_shutdown (); /* No further USB communication */
|
usb_lld_prepare_shutdown (); /* No further USB communication */
|
||||||
led_blink (LED_GNUK_EXEC); /* Notify the main. */
|
led_blink (LED_GNUK_EXEC); /* Notify the main. */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user