Adding ENABLE_POWER_RESET to enable power cycle for reset command. Enabled by default.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -37,6 +37,15 @@ else()
|
|||||||
message("Disabling user presence with button")
|
message("Disabling user presence with button")
|
||||||
endif(ENABLE_UP_BUTTON)
|
endif(ENABLE_UP_BUTTON)
|
||||||
|
|
||||||
|
option(ENABLE_POWER_ON_RESET "Enable/disable power cycle on reset" ON)
|
||||||
|
if(ENABLE_POWER_ON_RESET)
|
||||||
|
add_definitions(-DENABLE_POWER_ON_RESET=1)
|
||||||
|
message("Enabling power cycle on reset")
|
||||||
|
else()
|
||||||
|
add_definitions(-DENABLE_POWER_ON_RESET=0)
|
||||||
|
message("Disabling power cycle on reset")
|
||||||
|
endif(ENABLE_POWER_ON_RESET)
|
||||||
|
|
||||||
target_sources(pico_fido PUBLIC
|
target_sources(pico_fido PUBLIC
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/fido/fido.c
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/fido.c
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/fido/files.c
|
${CMAKE_CURRENT_LIST_DIR}/src/fido/files.c
|
||||||
|
|||||||
@@ -26,8 +26,10 @@
|
|||||||
extern void scan_all();
|
extern void scan_all();
|
||||||
|
|
||||||
int cbor_reset() {
|
int cbor_reset() {
|
||||||
|
#if defined(ENABLE_POWER_ON_RESET) && ENABLE_POWER_ON_RESET==1
|
||||||
if (board_millis() > 10000)
|
if (board_millis() > 10000)
|
||||||
return CTAP2_ERR_NOT_ALLOWED;
|
return CTAP2_ERR_NOT_ALLOWED;
|
||||||
|
#endif
|
||||||
if (check_user_presence() == false)
|
if (check_user_presence() == false)
|
||||||
return CTAP2_ERR_USER_ACTION_TIMEOUT;
|
return CTAP2_ERR_USER_ACTION_TIMEOUT;
|
||||||
initialize_flash(true);
|
initialize_flash(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user