;
; FAULTS AND POWER:
;
-; Shutdown CDU Timeout User Fault Next states
+; Shutdown CDU Time User Fault Next states and action when
+; fault timeout ON OFF
;
-; Off shutdown off none off *On (or +Fault)
-; On power-up on none off Fault, or *Off
-; Stopping shutdown off 500ms 50% 1/100ms ->Retry
-; Retry power-up off 50ms off ->Off, or Persists
-; Persists shutdown off 90ms on ->Retry
-; * = when host instructs
-; + = lost race, only
-; -> = after timeout
+; Off shutdown off none off On
+; On power-up on none off Stopping,FAULT Off
+; Stopping shutdown on 500ms 50% 1/100ms Retry
+; Retry power-up off 50ms off Persists Off,FIXED Off
+; Persists shutdown off 90ms on Retry Off
+;
+; (no notation: event ignored)
+ make code correspond to new
+ get rid of Clearing state.
;
; shutdown LAT stop_wait retry_wait
;
-; Off H (shutdown) stopped stopped
-; On L (power-up) stopped stopped
+; Off H (shutdown) 0 0
+; On L (power-up) 0 0
; Stopping H (shutdown) before Retry for LED flash
-; Retry L (power-up) stopped before Off
-; Persists H (shutdown) stopped before retry
+; Retry L (power-up) 0 before Off
+; Persists H (shutdown) 0 before retry
;
; (uses tickdiv) (uses tick)
call power_off_now
mov_fw retry_wait
- bra_z power_fault_stop ; we were Off or On, goto Stopping
+ bra_z power_fault_newshort ; we were Off or On
; must be Stopping, Retry or Persists:
tst_f_ifnz stop_wait
- bra power_fault_stop ; we were already Stopping; restart timer
+ bra power_fault_stopmore ; we were already Stopping; restart timer
; might be Retry or Persists, goto Persists (restarting any timer):
mov_lw persist_timeout / tick_us
mov_wf retry_wait
pin_vl p0_booster_userfault
+faultintrl_noop
intrl_handled_nostack
;-----
-power_fault_stop
+power_fault_newshort
+ mov_lw b'00000111'
+ call serial_addbyte
+power_fault_stopmore
mov_lw stop_timeout / tickdiv_us
mov_wf stop_wait
pin_vl p0_booster_userfault
- mov_lw b'00000111'
- call serial_addbyte
rcall power_stop_doflash
intrl_handled_nostack