mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-06-10 11:59:05 +02:00
Fixes for Pico SDK 1.5
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -135,12 +135,16 @@ void tud_vendor_rx_cb(uint8_t itf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void tud_vendor_tx_cb(uint8_t itf, uint32_t sent_bytes) {
|
void tud_vendor_tx_cb(uint8_t itf, uint32_t sent_bytes) {
|
||||||
printf("written %ld\n", sent_bytes);
|
//printf("written %ld\n", sent_bytes);
|
||||||
usb_write_flush(ITF_CCID);
|
usb_write_flush(ITF_CCID);
|
||||||
}
|
}
|
||||||
|
|
||||||
int driver_write_ccid(const uint8_t *buffer, size_t buffer_size) {
|
int driver_write_ccid(const uint8_t *buffer, size_t buffer_size) {
|
||||||
return tud_vendor_write(buffer, buffer_size);
|
int r = tud_vendor_write(buffer, buffer_size);
|
||||||
|
if (r > 0) {
|
||||||
|
return MAX(tud_vendor_flush(), r);
|
||||||
|
}
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t driver_read_ccid(uint8_t *buffer, size_t buffer_size) {
|
size_t driver_read_ccid(uint8_t *buffer, size_t buffer_size) {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ tusb_desc_endpoint_t const desc_ep1 = {
|
|||||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||||
.bEndpointAddress = TUSB_DIR_IN_MASK | 1,
|
.bEndpointAddress = TUSB_DIR_IN_MASK | 1,
|
||||||
.bmAttributes.xfer = TUSB_XFER_BULK,
|
.bmAttributes.xfer = TUSB_XFER_BULK,
|
||||||
.wMaxPacketSize.size = (64),
|
.wMaxPacketSize = (64),
|
||||||
.bInterval = 0
|
.bInterval = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ tusb_desc_endpoint_t const desc_ep2 = {
|
|||||||
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
.bDescriptorType = TUSB_DESC_ENDPOINT,
|
||||||
.bEndpointAddress = 2,
|
.bEndpointAddress = 2,
|
||||||
.bmAttributes.xfer = TUSB_XFER_BULK,
|
.bmAttributes.xfer = TUSB_XFER_BULK,
|
||||||
.wMaxPacketSize.size = (64),
|
.wMaxPacketSize = (64),
|
||||||
.bInterval = 0
|
.bInterval = 0
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user