Sat, 09 Aug 2014 17:24:32 +0200
Added panel thread
197 | 1 | /***************************************************************************** |
2 | * Copyright (C) 2014 | |
3 | * | |
4 | * Michiel Broek <mbroek at mbse dot eu> | |
5 | * | |
6 | * This file is part of the mbsePi-apps | |
7 | * | |
8 | * This is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public License as published by the | |
10 | * Free Software Foundation; either version 2, or (at your option) any | |
11 | * later version. | |
12 | * | |
13 | * mbsePi-apps is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
21 | *****************************************************************************/ | |
22 | ||
23 | #include "thermferm.h" | |
24 | #include "panel.h" | |
25 | ||
26 | #ifdef HAVE_WIRINGPI_H | |
27 | ||
28 | ||
199 | 29 | extern int my_shutdown; |
30 | extern int debug; | |
31 | ||
32 | ||
33 | ||
34 | PI_THREAD (my_panel_loop) | |
35 | { | |
36 | ||
37 | syslog(LOG_NOTICE, "Thread my_panel_loop started"); | |
38 | if (debug) | |
39 | fprintf(stdout, "Thread my_panel_loop started\n"); | |
40 | ||
41 | /* | |
42 | * Loop forever until the external shutdown variable is set. | |
43 | */ | |
44 | for (;;) { | |
45 | if (my_shutdown) | |
46 | break; | |
47 | ||
48 | /* | |
49 | * Loop 10 milliseconds | |
50 | */ | |
51 | usleep(10000); | |
52 | } | |
53 | ||
54 | syslog(LOG_NOTICE, "Thread my_panel_loop stopped"); | |
55 | if (debug) | |
56 | fprintf(stdout, "Thread my_panel_loop stopped\n"); | |
57 | ||
58 | return 0; | |
59 | } | |
197 | 60 | |
61 | ||
62 | #endif |