mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2024-09-20 11:20:08 +00:00
Return some SW even if no app is selected.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
c29f8d6cc5
commit
d6368a221f
@ -382,9 +382,11 @@ static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
|
||||
|
||||
void usb_tx_enable(const void *buf, uint32_t len)
|
||||
{
|
||||
if (len > 0) {
|
||||
//DEBUG_PAYLOAD(((uint8_t *)buf),len);
|
||||
tud_vendor_write(buf, len);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ATR (Answer To Reset) string
|
||||
@ -1408,7 +1410,7 @@ static int usb_event_handle(struct ccid *c)
|
||||
{
|
||||
ccid_tx_done ();
|
||||
}
|
||||
else if (tud_vendor_available() && c->epo->ready)
|
||||
if (tud_vendor_available() && c->epo->ready)
|
||||
{
|
||||
uint32_t count = tud_vendor_read(endp1_rx_buf, sizeof(endp1_rx_buf));
|
||||
//DEBUG_PAYLOAD(endp1_rx_buf, count);
|
||||
@ -1447,6 +1449,7 @@ int process_apdu() {
|
||||
}
|
||||
if (current_app->process_apdu)
|
||||
return current_app->process_apdu();
|
||||
return set_res_sw (0x6D, 0x00);
|
||||
}
|
||||
|
||||
|
||||
@ -1563,7 +1566,6 @@ void card_thread()
|
||||
break;
|
||||
|
||||
process_apdu();
|
||||
|
||||
done:;
|
||||
uint32_t flag = EV_EXEC_FINISHED;
|
||||
queue_add_blocking(ccid_comm, &flag);
|
||||
@ -1669,7 +1671,6 @@ void ccid_task(void)
|
||||
}
|
||||
else if (m == EV_TX_FINISHED)
|
||||
{
|
||||
TU_LOG3("state %d\r\n",c->state);
|
||||
if (c->state == APDU_STATE_RESULT)
|
||||
ccid_reset (c);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user