From: ian Date: Tue, 22 Nov 2005 23:00:18 +0000 (+0000) Subject: much debugging; reading now seems to work! X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=ce5cd1c350580ed55c23f628ed4f59d6bc0b44f7;p=trains.git much debugging; reading now seems to work! --- diff --git a/detpic/i2clib.asm b/detpic/i2clib.asm index 0c3e80f..f2af785 100644 --- a/detpic/i2clib.asm +++ b/detpic/i2clib.asm @@ -60,6 +60,7 @@ sspcon2 res 1 ; master only slave res 1 ; master only st res 1 +st_orig res 1 ; st is a bitmask, bit set in visible states: ; master slave @@ -96,6 +97,7 @@ i2cm_init mov_wf SSPCON1 clr_f SSPCON2 ; nothing going mov_lw 0x80 ; SMP(noslew), !CKE(!smbus) + mov_wf SSPSTAT bra init_enable ;---------- @@ -108,14 +110,15 @@ i2cm_interrupt mov_ff SSPCON1, sspcon1 mov_ff SSPCON2, sspcon2 - bt_f_if1 sspcon1, WCOL - bra_z m_event_bad - bt_f_if1 sspcon1, SSPOV - bra_z m_event_bad + bc_f PIR1, SSPIF + + mov_lw (1<