From f5211a40897150e25e9b25fb9c85c1dc95adfae0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 24 May 2026 15:40:02 +0300 Subject: [PATCH] Restart on double tap --- README.md | 2 +- src/imu.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8a9e0d..398390e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Chill -Sulajalmari code for resting eyes when working. Default settings are 20 minutes of work (the blue LEDs as a loading bar), 20 seconds of looking into the distance (eyes flashing). +Sulajalmari code for resting eyes when working. Default settings are 20 minutes of work (the blue LEDs as a loading bar), 20 seconds of looking into the distance (eyes flashing). Double tapping the head restarts the cycle. ## Shell Commands diff --git a/src/imu.c b/src/imu.c index 35f3b99..112d2fc 100644 --- a/src/imu.c +++ b/src/imu.c @@ -1,5 +1,6 @@ #include "imu.h" #include "zbus_channels.h" +#include "mode.h" #include #include @@ -97,6 +98,7 @@ static void debounce_cb(struct k_work *work) LOG_INF("Double tap"); struct button_msg_t msg = { .button = IMU, .function = DOUBLE_TAP }; zbus_chan_pub(&buttons_data_chan, &msg, K_NO_WAIT); + mode_restart(); } last_tap = k_uptime_get(); }