diff options
author | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 19:07:59 -0500 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 19:07:59 -0500 |
commit | 4326512568e8ab96f90844e26e10f0b50ce9c733 (patch) | |
tree | d2720eb685521c9e688b3b0aed95d2521eb08f4e | |
parent | a5e9ecff723e6df4c93c0047fcfd62c70b2b0fed (diff) |
enable self-cal on boot
-rw-r--r-- | instr-daemon.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/instr-daemon.c b/instr-daemon.c index be905ff..ec70f97 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -10,6 +10,7 @@ #include "menus.h" #include "gpib.h" #include "parser.h" +#include "error_utils.h" #include <stdlib.h> #include <ctype.h> @@ -323,7 +324,15 @@ static gboolean finish_boot (void) I2C_Setup_Monitor(); - // FIXME - self-cal here - or in thread beside user sessions? + if (globals.Flash.self_cal && + globals.Flash.self_cal_interval && + (globals.Flash.self_cal_startups % globals.Flash.self_cal_interval) == 0 ) { + int error_num; + if (error_num=self_cal()) { + queue_and_broadcast_sensor_alarm(error_num); + } + } + globals.Sys.startup_complete = 1; @@ -345,8 +354,8 @@ static gboolean periodic_poll (void) LCD_clear(); // 0123456789012345678901234567890123456789 - LCD_write(0,0,"PWR: Wait 10s. If still frozen, turn"); - LCD_write(1,0,"off 1min & retry."); + LCD_write(0,0,"PWR: Wait 10s. If still frozen, turn"); + LCD_write(1,0,"off 1min & retry."); // use plain old open to avoid any buffering etc int enablefd = open("/proc/sys/kernel/sysrq", O_SYNC | O_RDWR); |