From 1ea2928d2a9307427afce68c654b3df63c1e205e Mon Sep 17 00:00:00 2001 From: zvecr Date: Mon, 11 Apr 2022 02:14:19 +0100 Subject: [PATCH] XAP messages extend timeout? --- quantum/secure.c | 6 ++++++ quantum/secure.h | 2 ++ quantum/xap/xap.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/quantum/secure.c b/quantum/secure.c index 751977d351c..375f75fb008 100644 --- a/quantum/secure.c +++ b/quantum/secure.c @@ -47,6 +47,12 @@ void secure_request_unlock(void) { } } +void secure_activity_event(void) { + if (secure_status == SECURE_UNLOCKED) { + idle_time = timer_read32(); + } +} + void secure_keypress_event(uint8_t row, uint8_t col) { static const uint8_t sequence[][2] = SECURE_UNLOCK_SEQUENCE; diff --git a/quantum/secure.h b/quantum/secure.h index ba5fd6cbff7..e1e3067c550 100644 --- a/quantum/secure.h +++ b/quantum/secure.h @@ -22,6 +22,8 @@ void secure_unlock(void); void secure_request_unlock(void); +void secure_activity_event(void); + void secure_keypress_event(uint8_t row, uint8_t col); void secure_task(void); diff --git a/quantum/xap/xap.c b/quantum/xap/xap.c index bda2846a2f6..61e0d4de308 100644 --- a/quantum/xap/xap.c +++ b/quantum/xap/xap.c @@ -97,6 +97,9 @@ void xap_execute_route(xap_token_t token, const xap_route_t *routes, size_t max_ // xap_respond_failure(token, XAP_RESPONSE_FLAG_UNLOCK_IN_PROGRESS); // return; // } + + // TODO: XAP messages extend timeout? + secure_activity_event(); #endif switch (route.flags.type) {