Restart on double tap
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user