Restart on double tap

This commit is contained in:
Your Name
2026-05-24 15:40:02 +03:00
parent 24f48a0d17
commit f5211a4089
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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
+2
View File
@@ -1,5 +1,6 @@
#include "imu.h"
#include "zbus_channels.h"
#include "mode.h"
#include <zephyr/kernel.h>
#include <zephyr/device.h>
@@ -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();
}