; write a byte to pic0 via the serial port, pic0 will transmit it to
-; pic1, which will then toggle its colour (without checking the contents
-; of the byte)
+; pic1.
+; pic0 will go into morse/register readout panic routine when it
+; has transmitted the address byte+data byte via i2c.
+
+; pic1 will go into morse/register readout panic routine when it
+; received address byte+data byte via i2c.
+
+; prints out various debugging letters via the serial port
+; along the way.
+
+; panic routines may be all a bit confused because I can't remember
+; whet the original i2c program did when panicing.
+
+;***************************************************************************
; pin 21 (per-pic-led, RD2/PSP2/C1IN) states:
; high H = blue (=green), low L = orange (=red), float Z = black
call wait_for_i2c_interrupt ; wait for 2nd (data) byte
call led_black
debug 'B'
- goto slave_main_loop
+ goto vector_panic
;----------------------------------------
serial_rx_isr
bsf SSPCON2,PEN,0 ; i2c STOP
call wait_for_i2c_interrupt
+ goto vector_panic
retfie
;***************************************************************************
;--------------------
i2c_master_isr
debug 'm'
- goto vector_panic
+ goto wait_for_i2c_interrupt
;--------------------
i2c_slave_isr
debug 's'
- goto vector_panic
+ goto wait_for_i2c_interrupt
;----------------------------------------
wait_for_i2c_interrupt