Added dynamic option to enable/disable press to confirm.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-04-06 15:14:23 +02:00
parent 1c7ef50568
commit 565ea12d88
2 changed files with 16 additions and 12 deletions

View File

@@ -104,12 +104,15 @@ uint16_t get_device_options() {
extern uint32_t board_button_read(void);
static void wait_button() {
uint32_t val = EV_PRESS_BUTTON;
queue_try_add(ccid_comm, &val);
do {
queue_remove_blocking(card_comm, &val);
uint16_t opts = get_device_options();
if (opts & HSM_OPT_BOOTSEL_BUTTON) {
uint32_t val = EV_PRESS_BUTTON;
queue_try_add(ccid_comm, &val);
do {
queue_remove_blocking(card_comm, &val);
}
while (val != EV_BUTTON_PRESSED);
}
while (val != EV_BUTTON_PRESSED);
}
static int cmd_select() {