chiark / gitweb /
new NOPOINT command to get rid of FAULT/POINT race
authorian <ian>
Sat, 12 Jan 2008 03:32:25 +0000 (03:32 +0000)
committerian <ian>
Sat, 12 Jan 2008 03:32:25 +0000 (03:32 +0000)
TODO
cebpic/README.protocol
detpic/points.asm
hostside/cdumgr.c

diff --git a/TODO b/TODO
index 902e32b9f25be27c99f1898a74eff5599a1e3555..f67896dec94c09f1e9a311c792b72008a685c3be 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,6 +1,3 @@
-race between cdu off (due to watchdog or short) and points
-
-
 layout polarity diagram colourful segment encoding:
  make moveable feature selection in subseg2display bitwise rather than
   setwise
index da40540910cd9f76e9d64dfde153aa7464d282c9..0860a07fbebfc082f6510ba78798f8eeb9505fb1 100644 (file)
@@ -24,7 +24,7 @@ From host to PIC:
  > 0 0010 000             (10) OFF       Power off
 
 ;> 00000000                     CRASHED   Acknowledge panic, go to readout mode
-;> 00001002               (0a) TELLMODE  Confirm mode - say HELLO or CRASHED
+;> 00001010               (0a) TELLMODE  Confirm mode - say HELLO or CRASHED
 ;                                          if crashed, undoes the effect of ack
 
 ; In crash readout mode:
@@ -63,6 +63,7 @@ From PIC to host:
  < 0 000 1001             (HT)  HELLO    I am booted
  < 0 000 1011             (VT)  AAARGH   Followed by debug chars (only)
  < 0 000 1101             (CR)  WTIMEOUT  Watchdog timeout happened
+ < 0 000 1110             (SO)  NOPOINT   Point fired when CDU off
  < 0 000 0111             (BEL) FAULT    Fault exists
  < 0 000 0110             (ACK) FIXED    Fault now fixed
  < 0 0100 PPP             (20+)        POINTED   Point change done using capacitor P
@@ -155,6 +156,12 @@ not check that the received P value is 0; they may simply assume it).
        is recharging  <----POINTED----  Point is changing
 
 
+If the CDU is turned off (the disabled and fault states from the power
+state diagram, above), a POINT command will not result in a panic but
+rather produce only an immediate NOPOINT message.  (This must not be a
+panic because the POINT command may already be en-route when a FAULT
+occurs.)
+
 
 PING and PONG
 -------------
index ac50cffe4b97346a5af16aab13a0840e939e5e03..01555b10de5132bb0870aab6b6e9f28ef3fd1357 100644 (file)
@@ -285,7 +285,7 @@ command_point @
        bra     command_point_busy
 
        tst_f_ifnz cducharging
-       bra     command_point_cduempty
+       bra     command_point_ifcduempty
 
        swap_fw POSTINC0                ; W =           0SSS 1010
        and_lw  0x70                    ; W =           0SSS 0000
@@ -311,7 +311,16 @@ command_point @
 
 command_point_badmsg panic morse_PX
 command_point_busy panic morse_PB
-command_point_cduempty panic morse_PC
+
+;----------
+command_point_ifcduempty
+       pinlat_ifh p0_cdu_enable
+       bra     command_point_cducharging
+       ; state `Charging' but not really since it's disabled, ie Off:
+       mov_lw  b'00001110' ; POINTED
+       goto    serial_addbyte
+
+command_point_cducharging panic morse_PC
 
 ;----------
 command_point_ifslave
index 089d9548c0705c600c393cf6c48ddd9c31ac5777..db6f8ba959030f8cd1c40ac3002516dec59015c5 100644 (file)
@@ -14,3 +14,7 @@ void on_pic_pointed(const PicInsnInfo *pii, const PicInsn *pi, int objnum) {
   if (sta_state <= Sta_Settling) return;
   /* fixme do something here */
 }
+
+void on_pic_nopoint(const PicInsnInfo *pii, const PicInsn *pi, int objnum) {
+  /* fixme perhaps log this if it was unexpected */
+}