aboutsummaryrefslogtreecommitdiff
path: root/src/light_thread.c
diff options
context:
space:
mode:
authorspv <spv@spv.sh>2025-09-24 18:42:02 -0400
committerspv <spv@spv.sh>2025-09-24 18:42:02 -0400
commit7421749f450d9845574a64476a7bebbf8555e8d7 (patch)
treeb6b907daa22c6683f23ebeb1f0c1f3e3407ce4ea /src/light_thread.c
parente87085400d4a46793ee4f21ea8591c0f65813ba6 (diff)
refactor, change timeout to 5s
Diffstat (limited to 'src/light_thread.c')
-rw-r--r--src/light_thread.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/light_thread.c b/src/light_thread.c
index 20b7bb9..287932b 100644
--- a/src/light_thread.c
+++ b/src/light_thread.c
@@ -1,4 +1,4 @@
-// XXX signals, includes, open, write instead of fopen, fwrite
+// XXX sigwait instead of signal handler...
#include <stdio.h>
@@ -34,20 +34,15 @@ void handler(int _) {
backlight_off();
} else {
backlight_on();
+ usleep(BACKLIGHT_TIME);
- handler(_);
+ raise(SIGCONT);
}
}
-int light_thread(pid_t _keypress_pid) {
- keypress_pid = _keypress_pid;
-
+void light_thread() {
signal(SIGCONT, handler);
- while (1) {
- pause();
-// usleep(THREAD_WAIT);
- }
-
- return 0;
+ for (;;) pause();
+ __builtin_unreachable();
}