diff options
| author | spv <spv@spv.sh> | 2025-09-24 18:42:02 -0400 |
|---|---|---|
| committer | spv <spv@spv.sh> | 2025-09-24 18:42:02 -0400 |
| commit | 7421749f450d9845574a64476a7bebbf8555e8d7 (patch) | |
| tree | b6b907daa22c6683f23ebeb1f0c1f3e3407ce4ea /src/light_thread.c | |
| parent | e87085400d4a46793ee4f21ea8591c0f65813ba6 (diff) | |
refactor, change timeout to 5s
Diffstat (limited to 'src/light_thread.c')
| -rw-r--r-- | src/light_thread.c | 17 |
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(); } |
