From a6bb2a682f9b7eae887aad7bb9cbcaa134c297f0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 8 Jan 2011 23:45:28 +0000 Subject: [PATCH] realtime: allow suppression of use of the PICs watchdog feature --- hostside/realtime.c | 2 ++ hostside/realtime.h | 1 + hostside/startup.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hostside/realtime.c b/hostside/realtime.c index 2a469ea..4761d98 100644 --- a/hostside/realtime.c +++ b/hostside/realtime.c @@ -10,6 +10,7 @@ const char *progname= "realtime"; CommandInput cmdi; int picio_send_noise= 1; +int disable_watchdog; static const char *device= "/dev/railway"; static const char *logcopy_fn; @@ -472,6 +473,7 @@ int main(int argc, const char **argv) { case 'm': sta_state= Sta_Manual; break; case 'V': simlog_full=1; break; case 'B': nononblock_stdin=1; break; + case 'W': disable_watchdog=1; break; case 'L': logcopy_fn= arg; arg=0; break; case 'S': simulate= arg; arg=0; break; case 'D': debug_arg_spec(arg); arg=0; break; diff --git a/hostside/realtime.h b/hostside/realtime.h index 2affa20..83e5362 100644 --- a/hostside/realtime.h +++ b/hostside/realtime.h @@ -108,6 +108,7 @@ extern AdjunctsAddr **adjaddrs; extern CommandInput cmdi; extern int picio_send_noise; +extern int disable_watchdog; #define CIXF_U 0x0000ffffu #define CIXF_FORCE 0x00010000u diff --git a/hostside/startup.c b/hostside/startup.c index cab2995..460c789 100644 --- a/hostside/startup.c +++ b/hostside/startup.c @@ -152,7 +152,7 @@ static void sta_goto(StartupState new_state) { } if (piob.l) serial_transmit(&piob); - if (new_state >= Sta_Run) watchdog_start(); + if (new_state >= Sta_Run && !disable_watchdog) watchdog_start(); else watchdog_stop(); toev_start(&sta_toev); -- 2.30.2