mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-06-16 15:44:51 +02:00
Enable each USB interface independently depending on PHY parameters.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -122,6 +122,9 @@ uint8_t sc_itf_to_usb_itf(uint8_t itf) {
|
||||
}
|
||||
|
||||
void ccid_init_buffers() {
|
||||
if (ITF_SC_TOTAL == 0) {
|
||||
return;
|
||||
}
|
||||
if (ccid_rx == NULL) {
|
||||
ccid_rx = (usb_buffer_t *)calloc(ITF_SC_TOTAL, sizeof(usb_buffer_t));
|
||||
}
|
||||
@@ -170,11 +173,6 @@ void tud_vendor_rx_cb(uint8_t itf, const uint8_t *buffer, uint16_t bufsize) {
|
||||
} while (len > 0);
|
||||
}
|
||||
|
||||
void tud_vendor_tx_cb(uint8_t itf, uint32_t sent_bytes) {
|
||||
(void) sent_bytes;
|
||||
tud_vendor_n_write_flush(itf);
|
||||
}
|
||||
|
||||
int driver_write_ccid(uint8_t itf, const uint8_t *tx_buffer, uint16_t buffer_size) {
|
||||
if (*tx_buffer != 0x81) {
|
||||
DEBUG_PAYLOAD(tx_buffer, buffer_size);
|
||||
@@ -346,16 +344,17 @@ void ccid_task() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ENABLE_EMULATION
|
||||
|
||||
#define USB_CONFIG_ATT_ONE TU_BIT(7)
|
||||
|
||||
#define MAX_USB_POWER 1
|
||||
|
||||
void ccid_init() {
|
||||
ccid_init_buffers();
|
||||
}
|
||||
|
||||
#ifndef ENABLE_EMULATION
|
||||
|
||||
void tud_vendor_tx_cb(uint8_t itf, uint32_t sent_bytes) {
|
||||
(void) sent_bytes;
|
||||
tud_vendor_n_write_flush(itf);
|
||||
}
|
||||
|
||||
static void ccid_init_cb(void) {
|
||||
vendord_init();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user