summaryrefslogtreecommitdiff
path: root/board/cr50
diff options
context:
space:
mode:
Diffstat (limited to 'board/cr50')
-rw-r--r--board/cr50/u2f.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/board/cr50/u2f.c b/board/cr50/u2f.c
index 285ca2af93..0d474ef33d 100644
--- a/board/cr50/u2f.c
+++ b/board/cr50/u2f.c
@@ -40,7 +40,8 @@ void power_button_record(void)
enum touch_state pop_check_presence(int consume)
{
- int recent = (get_time().val - PRESENCE_TIMEOUT) < last_press.val;
+ int recent = ((last_press.val > 0) &&
+ ((get_time().val - last_press.val) < PRESENCE_TIMEOUT));
CPRINTS("Presence:%d", recent);
if (consume)