Fix otp processing if other applications were processed before.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2023-03-31 00:41:12 +02:00
parent f636085dbf
commit 46e7d3a181
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -311,8 +311,10 @@ void tud_hid_set_report_cb(uint8_t itf,
apdu.data = otp_frame_rx;
apdu.nc = 64;
apdu.rdata = otp_frame_tx;
apdu.header[0] = 0;
apdu.header[1] = 0x01;
apdu.header[2] = slot_id;
apdu.header[3] = 0;
int ret = otp_process_apdu();
if (ret == 0x9000 && res_APDU_size > 0) {
otp_send_frame(apdu.rdata, apdu.rlen);