diff --git a/applications/services/desktop/helpers/pin_lock.c b/applications/services/desktop/helpers/pin_lock.c index 22fcabe7d..decd98320 100644 --- a/applications/services/desktop/helpers/pin_lock.c +++ b/applications/services/desktop/helpers/pin_lock.c @@ -30,20 +30,6 @@ static const NotificationSequence sequence_pin_fail = { NULL, }; -static const uint8_t desktop_helpers_fails_timeout[] = { - 0, - 0, - 0, - 0, - 30, - 60, - 90, - 120, - 150, - 180, - /* +60 for every next fail */ -}; - void desktop_pin_lock_error_notify() { NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION); notification_message(notification, &sequence_pin_fail); @@ -52,15 +38,10 @@ void desktop_pin_lock_error_notify() { uint32_t desktop_pin_lock_get_fail_timeout() { uint32_t pin_fails = furi_hal_rtc_get_pin_fails(); - uint32_t pin_timeout = 0; - uint32_t max_index = COUNT_OF(desktop_helpers_fails_timeout) - 1; - if(pin_fails <= max_index) { - pin_timeout = desktop_helpers_fails_timeout[pin_fails]; - } else { - pin_timeout = desktop_helpers_fails_timeout[max_index] + (pin_fails - max_index) * 60; + if(pin_fails < 3) { + return 0; } - - return pin_timeout; + return 30 * pow(2, pin_fails - 3); } void desktop_pin_lock(DesktopSettings* settings) {