diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-09-06 13:06:35 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-09-06 13:06:35 -0400 |
commit | 61990ae8b79aca30745eca02b44e63c377504176 (patch) | |
tree | 6a7665f4aaf6402462bddacf45c4c14171de35e6 /instr-daemon.c | |
parent | 6e01ae99f1b7b61e6057454891d9bbd11db2196f (diff) |
add a periodic_poll function to check buttons (and gpib in future)
Diffstat (limited to 'instr-daemon.c')
-rw-r--r-- | instr-daemon.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/instr-daemon.c b/instr-daemon.c index b90990d..d9a99c3 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -14,6 +14,10 @@ #define STDIN_BUF_SIZE 1024 + +static gboolean periodic_poll (void); + + int port=3333; //port to listen int connections=0; int maxConn=16; //max connections - 16 @@ -284,7 +288,7 @@ int main(int argc, char **argv) GMainLoop *loop = g_main_loop_new (NULL, FALSE); - g_timeout_add (20, Menu_Check_Buttons, NULL); + g_timeout_add (20, (GSourceFunc) periodic_poll, NULL); g_main_loop_run (loop); @@ -295,3 +299,12 @@ int main(int argc, char **argv) return 0; } + + +static gboolean periodic_poll (void) +{ + + Menu_Check_Buttons (); + + return TRUE; +} |