From d0fe44741653427f98126a92f3c703255fb9e72a Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Thu, 29 Sep 2022 16:59:30 +0200 Subject: [PATCH] Fix PING with no data. Signed-off-by: Pol Henarejos --- src/usb/hid/hid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/usb/hid/hid.c b/src/usb/hid/hid.c index 2cafd46..f298324 100644 --- a/src/usb/hid/hid.c +++ b/src/usb/hid/hid.c @@ -248,7 +248,11 @@ int driver_process_usb_packet(uint16_t read) { } else { memcpy(ctap_resp->init.data, ctap_req->init.data, MSG_LEN(ctap_req)); - driver_exec_finished(MSG_LEN(ctap_req)); + ctap_resp->cid = ctap_req->cid; + ctap_resp->init.cmd = last_cmd; + ctap_resp->init.bcnth = MSG_LEN(ctap_req) >> 8; + ctap_resp->init.bcntl = MSG_LEN(ctap_req) & 0xff; + hid_write(64); } msg_packet.len = msg_packet.current_len = 0; last_packet_time = 0;