mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-17 20:19:43 -07:00
Double PIN timeout after each wrong PIN
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user