From: ian Date: Sun, 25 Dec 2005 23:24:24 +0000 (+0000) Subject: make it compile again (but not yet link) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=446e548e4d63ba498091e3cd244b8588cfc9e6fb;p=trains.git make it compile again (but not yet link) --- diff --git a/detpic/Makefile b/detpic/Makefile index 7da6979..1604c08 100644 --- a/detpic/Makefile +++ b/detpic/Makefile @@ -30,6 +30,7 @@ INCLUDES= \ reverse.fin \ routines-led.fin \ serout.fin \ + tick.fin \ vectors.fin \ VARSFILES= variables diff --git a/detpic/final.inc b/detpic/final.inc index 5b31b79..24a2dab 100644 --- a/detpic/final.inc +++ b/detpic/final.inc @@ -11,6 +11,7 @@ include reverse.fin include routines-led.fin include serout.fin + include tick.fin include variables+vars.fin include vectors.fin diff --git a/detpic/mascan.asm b/detpic/mascan.asm index 69c316f..df64cc2 100644 --- a/detpic/mascan.asm +++ b/detpic/mascan.asm @@ -26,7 +26,7 @@ outmsg_targetlen res 1 ; near_getwritebyteyes code ;---------------------------------------- -getwritebyte_yes +i2c_getwritebyte_yes pop ; we don't care where we were in i2cmu_write_next_byte bc_f STATUS, Z ; yes, we want to write this byte return ; from i2cmu_write_next_byte @@ -35,8 +35,8 @@ getwritebyte_yes ;---------------------------------------- i2cmu_write_next_byte ; add calls to getwritebyte_ here: - call getwritebyte_polarity - call getwritebyte_points + call polarity_getwritebyte + call points_getwritebyte ; end of list of calls to getwritebyte_ ; so, no-one wants this slave: bs_f STATUS, Z @@ -217,7 +217,7 @@ nextslave_nowrite mov_lw ste_size add_wff cslot ; cslot -> next ste_flags mov_lfsr slavetable, 1 ; FSR1H -> slavetable - mov_fw cslot, FSR1L ; FSR1 -> new ste_flags + mov_ff cslot, FSR1L ; FSR1 -> new ste_flags bt_f_if1 POSTDEC1, stf_sentinel ; FSR1 -> ste_slave bra nextslave_looparound @@ -243,8 +243,8 @@ i2cmu_done ; Anyone else to write to ? ; add calls to needwrite_ here: - call needwrite_polarity - call needwrite_points + call polarity_needwrite + call points_needwrite ; end of list of calls to needwrite_ ; no, if we're here, no-one wants to write @@ -325,7 +325,7 @@ mascan_init_ifabsent bra mascan_init_loop ; we've read the whole flash table - if slavetable = 0x400 + if slavetable == 0x400 bt_f_if1 FSR0H, 0 bra mascan_bad_toomany endif diff --git a/detpic/mascan.fin b/detpic/mascan.fin index ddd160a..e949640 100644 --- a/detpic/mascan.fin +++ b/detpic/mascan.fin @@ -1,2 +1,6 @@ extern i2cm_intrl + extern mascan_init extern loopback_read_byte + extern i2c_needwrite + extern i2c_consider_restartread + extern i2c_getwritebyte_yes diff --git a/detpic/morse.messages b/detpic/morse.messages index c4b4cd9..9491ae6 100644 --- a/detpic/morse.messages +++ b/detpic/morse.messages @@ -83,7 +83,7 @@ DX ::t ; slave received wrong message byte DB detect:message_buffer ; slave_add_short_message overrun DF ::t ; slave pic2detinfo[0] invalid bits DG ::t ; too many slaves in pic2detinfo -DM ::buf0 : master has MM bit set in buf0 +DM ::buf0 ; master has MM bit set in buf0 # Messages for specific peripherals: # R - Reversers (polarity) diff --git a/detpic/points.fin b/detpic/points.fin index cd4679c..f17c081 100644 --- a/detpic/points.fin +++ b/detpic/points.fin @@ -2,5 +2,7 @@ extern point_local_do extern points_local_init extern points_local_intrl + extern points_needwrite + extern points_getwritebyte extern cdu_init extern got_pointed diff --git a/detpic/reverse.asm b/detpic/reverse.asm index c52fe16..e2318cd 100644 --- a/detpic/reverse.asm +++ b/detpic/reverse.asm @@ -166,7 +166,7 @@ board_next_none mov_fw polarity_cmds ; there's always a board 0, us call polarity_local_do - rcall needwrite_polarity ; does `return' because it will find one + rcall polarity_needwrite ; does `return' because it will find one return ; ... or maybe not if only 1 rev board ;---------- @@ -179,7 +179,7 @@ polarity_master_init ; need to set up polarity_cmds ;---------------------------------------------------------------------- -needwrite_polarity +polarity_needwrite ; needwrite_ will see if we need to talk to a slave ; if not it will simply return ; if we _do_, it will put the slave no. in W, and then pop @@ -203,7 +203,7 @@ polarity_needwrite_loop near_getwritebyteyes code ;---------------------------------------------------------------------- -getwritebyte_polarity +polarity_getwritebyte ; getwritebyte_ finds a byte to write to a particular ; slave. If we have something to write, puts the byte in W ; and does `goto getwritebyte_yes'. Otherwise simply returns. @@ -213,9 +213,10 @@ getwritebyte_polarity ; W undefined trashed byte for slave ; mov_lfsr polarity_cmds, 0 - add_wf FSR0L + mov_fw cwslave + add_wff FSR0L mov_fw INDF0 - bra_n getwritebyte_yes + bra_n i2c_getwritebyte_yes ; no: return diff --git a/detpic/reverse.fin b/detpic/reverse.fin index 1b7d8ed..fc313d4 100644 --- a/detpic/reverse.fin +++ b/detpic/reverse.fin @@ -1,3 +1,6 @@ extern command_polarity extern polarity_local_do extern polarity_local_init + extern polarity_master_init + extern polarity_needwrite + extern polarity_getwritebyte diff --git a/detpic/serout.asm b/detpic/serout.asm index 33d9b2b..6bf7cde 100644 --- a/detpic/serout.asm +++ b/detpic/serout.asm @@ -102,7 +102,7 @@ tx_fcdisable serialtxfc_init bs_f INTCON, RBIE bc_f INTCON2, RBIP - rcall porb_read + rcall portb_read return ;---------------------------------------------------------------------- diff --git a/detpic/serout.fin b/detpic/serout.fin index ea60779..894bd57 100644 --- a/detpic/serout.fin +++ b/detpic/serout.fin @@ -1,2 +1,6 @@ extern serial_addbyte extern serial_addbyte_another + extern serialtx_intrl + extern serialtxfc_init + extern serialtxbuf_init + extern portb_read diff --git a/detpic/tick.fin b/detpic/tick.fin new file mode 100644 index 0000000..7cf7f0c --- /dev/null +++ b/detpic/tick.fin @@ -0,0 +1 @@ + extern ticker_intrl diff --git a/detpic/variables.asm b/detpic/variables.asm index 0a655aa..38071ed 100644 --- a/detpic/variables.asm +++ b/detpic/variables.asm @@ -56,11 +56,12 @@ outbuf res outbuf_size bitnum2bit_section udata 0x0f8 bitnum2bit res 8 ; bitnum2bit[x] = 1<