From: ian Date: Wed, 7 Dec 2005 01:29:34 +0000 (+0000) Subject: debugging points, wip X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=12cf008695cc25ab003e2b96678fa715068e2782;p=trains.git debugging points, wip --- diff --git a/detpic/i2clib.inc b/detpic/i2clib.inc index 6454b6f..2dbf460 100644 --- a/detpic/i2clib.inc +++ b/detpic/i2clib.inc @@ -1,3 +1,4 @@ + extern QQ_detect_slave_init extern QQ_i2csu_read_begin extern QQ_i2csu_read_another diff --git a/detpic/points.asm b/detpic/points.asm index 5efca99..d39aa04 100644 --- a/detpic/points.asm +++ b/detpic/points.asm @@ -139,7 +139,8 @@ points_local_init ; Doing it like this avoids having to constantly recompute ; individual TBLPTR*'s. - mov_lfsr ptix2bitlat, 0 ; FSR0 -> this bit and LAT* + mov_lfsr ptix2bitlat-1, 0 ; FSR0 -> this bit and LAT* + ; points just at last thing we've filled in load_perpic_tblptr picno2ptmap, maxpoint/8 @@ -148,16 +149,16 @@ points_local_init ;... points_init_byte_loop mov_lw 8 ; W = bit counter - clr_f INDF0 ; bit[current] := 0 + clr_f PREINC0 ; FSR0 -> bit[current] := 0 tblrd_postinc_fixup ; TABLAT = bitmap data being processed ;... points_init_bit_loop rrc_f TABLAT - bra_nc points_init_ifnot_point -points_init_if_point - set_f POSTINC0 ; bit[current] := 0xff, FSR0 -> LAT*[current] -points_init_ifnot_point - clr_f POSTINC0 ; LAT*[current] := 0xff, FSR0 -> bit[current+1] + + bt_f_if1 STATUS,C + set_f INDF0 ; FSR0 -still-> bit[current] := 0xff + + clr_f PREINC0 ; FSR0 -> LAT*[current] := 0 dec_w_ifnz bra points_init_bit_loop @@ -165,6 +166,8 @@ points_init_ifnot_point bra points_init_byte_loop ;... end of loop: + return;qq + ; We've scanned for points used on this board; ; now find the actual pins. diff --git a/detpic/slave.asm b/detpic/slave.asm index c356cd0..9aed92f 100644 --- a/detpic/slave.asm +++ b/detpic/slave.asm @@ -15,12 +15,11 @@ slave mov_fw picno call i2cs_init - call test_sofar_slave_startup_hook call bitnum2bit_init call points_local_init call polarity_local_init call detect_local_init - call detect_slave_init + call QQ_detect_slave_init mov_lw (1<