thermferm/simulator.c

changeset 259
b7c967359771
child 262
d0014ccec615
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/thermferm/simulator.c	Fri Aug 22 17:12:42 2014 +0200
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * Copyright (C) 2008-2014
+ *   
+ * Michiel Broek <mbroek at mbse dot eu>
+ *
+ * This file is part of the mbsePi-apps
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * mbsePi-apps is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with ThermFerm; see the file COPYING.  If not, write to the Free
+ * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *****************************************************************************/
+
+#include "thermferm.h"
+#include "simulator.h"
+
+#ifdef USE_SIMULATOR
+
+extern int		my_shutdown;
+extern int		debug;
+
+
+
+#ifdef HAVE_WIRINGPI_H
+PI_THREAD (my_simulator_loop)
+#else
+void *my_simulator_loop(void *threadid)
+#endif
+{
+
+    syslog(LOG_NOTICE, "Thread my_simulator_loop started");
+    if (debug)
+	fprintf(stdout, "Thread my_simulator_loop started\n");
+
+    for (;;) {
+
+	if (my_shutdown)
+	    break;
+
+	usleep(100000);
+    }
+
+    syslog(LOG_NOTICE, "Thread my_simulator_loop stopped");
+    if (debug)
+	fprintf(stdout, "Thread my_simulator_loop stopped\n");
+    return 0;
+}
+
+
+#endif

mercurial