chiark / gitweb /
Revised Settling state
authorian <ian>
Sat, 13 May 2006 18:10:31 +0000 (18:10 +0000)
committerian <ian>
Sat, 13 May 2006 18:10:31 +0000 (18:10 +0000)
hostside/startup.c

index d9235bd78851c2167a15ec22a5af0a72ebfa6db2..64c53d3ef2cd29611a95825e56e00f4aeac7be60 100644 (file)
@@ -16,6 +16,10 @@ static void sta_goto(StartupState new_state);
 
 static void timedout_onward(TimeoutEvent *toev) {
   assert(sta_state != Sta_Run);
+  if (sta_state == Sta_Settling) {
+    enco_pic_off(&piob);
+    serial_transmit(&piob);
+  }
   sta_goto(sta_state == Sta_Flush ? Sta_Ping : sta_state + 1);
 }
 
@@ -61,7 +65,7 @@ static void sta_goto(StartupState new_state) {
   case Sta_Off:                                    break;
   case Sta_Ping:                                   break;
   case Sta_Fault:                                  break;
-  case Sta_Settling:   sta_toev.duration=  2000;   break;
+  case Sta_Settling:   sta_toev.duration=   750;   break;
   case Sta_Resolving:  sta_toev.duration=   500;   break;
   case Sta_Run:                                    break;
   }
@@ -161,7 +165,7 @@ void on_pic_pong(const PicInsnInfo *pii, const PicInsn *pi, int objnum) {
 
 void on_pic_fixed(const PicInsnInfo *pii, const PicInsn *pi, int objnum) {
   if (sta_state >= Sta_Resolving) die("PIC sent unexpected FIXED");
-  if (sta_state == Sta_Fault) sta_goto(Sta_Settling);
+  if (sta_state == Sta_Fault) sta_goto(Sta_Resolving);
 }
 
 void on_pic_fault(const PicInsnInfo *pii, const PicInsn *pi, int objnum) {