diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-06-07 20:38:20 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-11-02 13:27:51 -0400 |
commit | 913d099261399ba737b35752f3c3be6da618bb6a (patch) | |
tree | 1519e14b5653ccc0d8bf5f4cd7b509ab8195d8eb /src/linux/internal.h | |
parent | ffeafb690b9d016e2a4d9fa5dc0115c062148bd8 (diff) | |
download | kutter-913d099261399ba737b35752f3c3be6da618bb6a.tar.gz kutter-913d099261399ba737b35752f3c3be6da618bb6a.tar.xz kutter-913d099261399ba737b35752f3c3be6da618bb6a.zip |
linux: Use Unix signals to notify when a timer is pending
Use Unix signals in software timer implementation. This makes the
code a little more efficient.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/linux/internal.h')
-rw-r--r-- | src/linux/internal.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/linux/internal.h b/src/linux/internal.h index 5a9ce907..001a9072 100644 --- a/src/linux/internal.h +++ b/src/linux/internal.h @@ -2,6 +2,7 @@ #define __LINUX_INTERNAL_H // Local definitions for micro-controllers running on linux +#include <signal.h> // sigset_t #include <stdint.h> // uint32_t #include "autoconf.h" // CONFIG_CLOCK_FREQ @@ -10,7 +11,6 @@ #define GPIO2PORT(PIN) ((PIN) / MAX_GPIO_LINES) #define GPIO2PIN(PIN) ((PIN) % MAX_GPIO_LINES) - #define NSECS 1000000000 #define NSECS_PER_TICK (NSECS / CONFIG_CLOCK_FREQ) @@ -19,10 +19,12 @@ void report_errno(char *where, int rc); int set_non_blocking(int fd); int set_close_on_exec(int fd); int console_setup(char *name); -void console_sleep(struct timespec ts); +void console_sleep(sigset_t *sigset); // timer.c int timer_check_periodic(uint32_t *ts); +void timer_disable_signals(void); +void timer_enable_signals(void); // watchdog.c int watchdog_setup(void); |