Fix enabled capabilities detection.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-08-14 20:49:29 +02:00
parent 2b1227b105
commit aa7362f88f
2 changed files with 2 additions and 2 deletions

View File

@@ -176,10 +176,10 @@ extern int calculate_oath(uint8_t truncate,
static uint8_t session_counter[2] = {0};
#endif
int otp_button_pressed(uint8_t slot) {
init_otp();
if (!cap_supported(CAP_OTP)) {
return 3;
}
init_otp();
#ifndef ENABLE_EMULATION
file_t *ef = search_dynamic_file(slot == 1 ? EF_OTP_SLOT1 : EF_OTP_SLOT2);
const uint8_t *data = file_get_data(ef);