From: ian Date: Wed, 21 Dec 2005 12:20:59 +0000 (+0000) Subject: use panic.asm's panic; separate FERR and OERR panics X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=bca31c0f321f08016846e75c293a3f4f45458d47;p=trains.git use panic.asm's panic; separate FERR and OERR panics --- diff --git a/detpic/morse.messages b/detpic/morse.messages index ea35a03..8ce7148 100644 --- a/detpic/morse.messages +++ b/detpic/morse.messages @@ -22,6 +22,8 @@ E ; `expected'; we were told to panic HX ::t ; host sent unknown command HW ::t ; host sent message which was too long +HO ; host RS232 read overrun +HF ; host RS232 framing error # Problematic interrupts IH INTCON,INTCON3,PIR1,PIR2,PIR3 ; Interrupt source not found (high pri.) @@ -59,10 +61,12 @@ DR FSR2L,::outmsg_end ; slave read overrun DX ::t ; slave received wrong message byte DB detect:message_buffer ; slave_add_short_message overrun -# Messages for specific peripherals +# Messages for specific peripherals: +# R - Reversers (polarity) RS FSR0L ; POLARITY message too short RL FSR0L ; POLARITY message too long +# P - Points PB points:pointmsg ; Firing point when already busy PI points:pointmsg,T3CON ; Unexpected Timer 3 interrupt PU points:pointmsg ; Firing nonexistent point diff --git a/detpic/nmra-stream.asm b/detpic/nmra-stream.asm index 32ac094..d230cb4 100644 --- a/detpic/nmra-stream.asm +++ b/detpic/nmra-stream.asm @@ -192,9 +192,9 @@ fixme need to check both interrupt handlers here and look for refies too ; debug 'h' ; write 'h' to serial port bt_fa_if1 RCSTA,FERR ; if FERR set (= framing error), then panic - goto panic + goto panic_ferr bt_fa_if1 RCSTA,OERR ; if OERR set (= overrun error), then panic - goto panic + goto panic_oerr mov_ff fromserial,FSR0L ; set low byte of INDF0 pointer mov_lw bufferpage @@ -430,17 +430,9 @@ advance_read_buffer ;**************************************************************************** +panic_oerr panic morse_HO +panic_ferr panic morse_HF -panic - debug 'x' - clr_fa INTCON ; disable all interrupts EVER - debug 'y' - bc_fa PORTC,1 ; switch off booster - debug 'z' - call led_red -panic_loop - goto panic_loop - ;**************************************************************************** include final.inc