From: ian Date: Fri, 30 Dec 2005 01:49:44 +0000 (+0000) Subject: fix much braindamage surrounding mov_wf not setting flags and thus getting erroneous... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=b876987aba5ba3b3a57d713092ea2c88e925adee;p=trains.git fix much braindamage surrounding mov_wf not setting flags and thus getting erroneous SN panics --- diff --git a/detpic/i2clib.asm b/detpic/i2clib.asm index b09c087..efd3ae4 100644 --- a/detpic/i2clib.asm +++ b/detpic/i2clib.asm @@ -235,6 +235,9 @@ i2cm_write_start ; At call On return ; State Idle/Reading-Wait Writing-Setup ; W slave number any + mov_wf xdebug+3 + mov_ff st, xdebug+4 + set_f xdebug+5 tst_f_ifnz st bra m_write_start_busy @@ -361,11 +364,13 @@ m_event_done_acking mov_fw slave_next bra_z m_stop ; ok, we want to read another: + mov_wf xdebug+2 mov_wf slave clr_f slave_next bt_f_if0 st, st_writing ; because of i2cm_write_start ? bs_f st, st_reading ; no, then we will want to read bs_f SSPCON2, RSEN + set_f xdebug+0 bra m_start_or_restart ;---------- @@ -499,4 +504,6 @@ s_event_bad include program+externs.fin include i2clib.inc + include variables+vars.fin + end diff --git a/detpic/morse.messages b/detpic/morse.messages index 5481984..64df6fc 100644 --- a/detpic/morse.messages +++ b/detpic/morse.messages @@ -54,6 +54,7 @@ SM i2clib+panic:st,:sspstat,:sspcon1,:sspcon2 ; m.,i., ctrlr bad state SS SSPSTAT,SSPCON1 ; s.,i., controller bad state SK i2clib+panic:slave ; m. couldn't address slave (no ack) SN i2clib+panic:slave ; improper slave number +SO i2clib+panic:slave ; improper next slave number SB i2clib+panic:st ; improper i2cm_{read,write}_start SF i2clib+panic:st ; improper i2cmu_write_next_byte Z SA i2clib+panic:st ; improper i2cm_read_another