Use BE/LE functions for packing uint16.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-12-23 21:00:43 +01:00
parent 8e68e6cae9
commit d78e977926
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -221,8 +221,7 @@ done: ;
}
void apdu_finish() {
apdu.rdata[apdu.rlen] = apdu.sw >> 8;
apdu.rdata[apdu.rlen + 1] = apdu.sw & 0xff;
put_uint16_t_be(apdu.sw, apdu.rdata + apdu.rlen);
// timeout_stop();
#ifndef ENABLE_EMULATION
if ((apdu.rlen + 2 + 10) % 64 == 0) { // FIX for strange behaviour with PSCS and multiple of 64