From 8cd1bd7eb4ab5fb5ffb77b5a648c92be7d62aaff Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 12 Jan 2008 03:32:25 +0000 Subject: [PATCH] new NOPOINT command to get rid of FAULT/POINT race --- TODO | 3 --- cebpic/README.protocol | 9 ++++++++- detpic/points.asm | 13 +++++++++++-- hostside/cdumgr.c | 4 ++++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 902e32b..f67896d 100644 --- 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 diff --git a/cebpic/README.protocol b/cebpic/README.protocol index da40540..0860a07 100644 --- a/cebpic/README.protocol +++ b/cebpic/README.protocol @@ -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 ------------- diff --git a/detpic/points.asm b/detpic/points.asm index ac50cff..01555b1 100644 --- a/detpic/points.asm +++ b/detpic/points.asm @@ -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 diff --git a/hostside/cdumgr.c b/hostside/cdumgr.c index 089d954..db6f8ba 100644 --- a/hostside/cdumgr.c +++ b/hostside/cdumgr.c @@ -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 */ +} -- 2.30.2