INTERRUPT pipe implemented
This commit is contained in:
@@ -633,7 +633,6 @@ icc_prepare_receive (struct ccid *c)
|
|||||||
/*
|
/*
|
||||||
* Rx ready callback
|
* Rx ready callback
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
EP1_OUT_Callback (void)
|
EP1_OUT_Callback (void)
|
||||||
{
|
{
|
||||||
@@ -1297,9 +1296,17 @@ icc_handle_timeout (struct ccid *c)
|
|||||||
return next_state;
|
return next_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define USB_ICC_TIMEOUT (1950*1000)
|
/*
|
||||||
|
* Another Tx done callback
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
EP2_IN_Callback (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define USB_ICC_TIMEOUT (1950*1000)
|
||||||
|
|
||||||
static struct ccid ccid;
|
static struct ccid ccid;
|
||||||
|
|
||||||
#define GPG_THREAD_TERMINATED 0xffff
|
#define GPG_THREAD_TERMINATED 0xffff
|
||||||
@@ -1350,11 +1357,15 @@ ccid_thread (chopstx_t thd)
|
|||||||
{
|
{
|
||||||
if (card_change_requested)
|
if (card_change_requested)
|
||||||
{
|
{
|
||||||
|
uint8_t notify_slot_change[2] = { 0x50, 0x02 };
|
||||||
|
|
||||||
led_blink (LED_TWOSHOTS);
|
led_blink (LED_TWOSHOTS);
|
||||||
|
|
||||||
if (c->icc_state == ICC_STATE_NOCARD)
|
if (c->icc_state == ICC_STATE_NOCARD)
|
||||||
/* Inserted! */
|
{ /* Inserted! */
|
||||||
c->icc_state = ICC_STATE_START;
|
c->icc_state = ICC_STATE_START;
|
||||||
|
notify_slot_change[1] |= 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (c->application)
|
if (c->application)
|
||||||
@@ -1368,6 +1379,7 @@ ccid_thread (chopstx_t thd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
card_change_requested = 0;
|
card_change_requested = 0;
|
||||||
|
usb_lld_write (ENDP2, notify_slot_change, 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
card_change_requested = 1;
|
card_change_requested = 1;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ static const uint8_t gnukConfigDescriptor[] = {
|
|||||||
0x82, /* bEndpointAddress: (IN2) */
|
0x82, /* bEndpointAddress: (IN2) */
|
||||||
0x03, /* bmAttributes: Interrupt */
|
0x03, /* bmAttributes: Interrupt */
|
||||||
4, 0x00, /* wMaxPacketSize: */
|
4, 0x00, /* wMaxPacketSize: */
|
||||||
0x20, /* bInterval (32ms) */
|
0xFF, /* bInterval (255ms) */
|
||||||
|
|
||||||
/* Interface Descriptor */
|
/* Interface Descriptor */
|
||||||
9, /* bLength: Interface Descriptor size */
|
9, /* bLength: Interface Descriptor size */
|
||||||
|
|||||||
Reference in New Issue
Block a user