All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 37a8d55e authored by Timothy Stack's avatar Timothy Stack

Change the watchdog to use the .3 - .9 second timeout instead of the

60s one.  Also bump up the rate that we feed it.
parent 2905e2cd
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <unistd.h> #include <unistd.h>
#include <syslog.h> #include <syslog.h>
#include <paths.h> #include <paths.h>
#include <signal.h>
#include <sys/resource.h> #include <sys/resource.h>
#include "SGGPIO.h" #include "SGGPIO.h"
...@@ -50,7 +51,7 @@ int main(int argc, char **argv) ...@@ -50,7 +51,7 @@ int main(int argc, char **argv)
unsigned int elapsed = 0; unsigned int elapsed = 0;
SGGPIO_PORT sggpio; SGGPIO_PORT sggpio;
while ((c = getopt(argc, argv, "h")) != -1) { while ((c = getopt(argc, argv, "dhi")) != -1) {
switch (c) { switch (c) {
case 'd': case 'd':
debug += 1; debug += 1;
...@@ -72,6 +73,8 @@ int main(int argc, char **argv) ...@@ -72,6 +73,8 @@ int main(int argc, char **argv)
daemon(0, 0); daemon(0, 0);
} }
signal(SIGTERM, SIG_IGN);
setpriority(PRIO_PROCESS, 0, 20); setpriority(PRIO_PROCESS, 0, 20);
openlog("wagthedog", LOG_PID, LOG_DAEMON); openlog("wagthedog", LOG_PID, LOG_DAEMON);
syslog(LOG_INFO, "wagthedog started"); syslog(LOG_INFO, "wagthedog started");
...@@ -90,14 +93,14 @@ int main(int argc, char **argv) ...@@ -90,14 +93,14 @@ int main(int argc, char **argv)
sggpio.setDir(WDT_SET2, 1); sggpio.setDir(WDT_SET2, 1);
sggpio.setPin(WDT_INPUT, wiggle); sggpio.setPin(WDT_INPUT, wiggle);
sggpio.setPin(WDT_SET1, 1); sggpio.setPin(WDT_SET1, 0);
sggpio.setPin(WDT_SET2, 1); sggpio.setPin(WDT_SET2, 1);
while (looping) { while (looping) {
wiggle = !wiggle; wiggle = !wiggle;
sggpio.setPin(WDT_INPUT, wiggle); sggpio.setPin(WDT_INPUT, wiggle);
sleep(1); usleep(500);
elapsed += 1; elapsed += 1;
if (elapsed == WDT_STARTUP_DELAY) if (elapsed == WDT_STARTUP_DELAY)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment