summaryrefslogtreecommitdiff
path: root/instr-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'instr-daemon.c')
-rw-r--r--instr-daemon.c15
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);