From 7421749f450d9845574a64476a7bebbf8555e8d7 Mon Sep 17 00:00:00 2001 From: spv Date: Wed, 24 Sep 2025 18:42:02 -0400 Subject: refactor, change timeout to 5s --- src/light_thread.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/light_thread.c') 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 @@ -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(); } -- cgit v1.2.3