;====================================================================== ; MAIN PROGRAM AND GLUE include common.inc code ;---------- vector_reset set_f qqTRISA set_f qqTRISB set_f qqTRISC set_f qqTRISD set_f qqTRISE mov_lw 0xaa mov_wf qqLATA mov_wf qqLATB mov_wf qqLATC mov_wf qqLATD mov_wf qqLATE clr_f INTCON bs_f RCON, IPEN ; interrupt priorities call idlocs_init tst_f_ifnz picno goto slave bra master ;---------- i2cm_intrl ; handles i2c interrupt using i2cm_interrupt[_definite], ; according to the rules for _intrl. bt_f_if0 PIR1, SSPIF return call i2cm_interrupt_definite intrl_handled_nostack ;---------- intrl_handled_routine mov_ff isr_low_save_stkptr, STKPTR intrl_handled_core ;====================================================================== ; MASTER/SLAVE deviations ;---------- message_for_master ; Either transmits the message to the master, or if we are the master, ; handles it as an incoming message from the notional `slave 0'. ; W message unchanged ; GIEH set set bt_f_if1 idloc1,idloc1_master goto loopback_read_byte goto slave_add_short_message ;====================================================================== ; UNIMPLEMENTED STUFF ;---------- loopback_read_byte panic morse_UL include final.inc