; 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
;...
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
bra points_init_byte_loop
;... end of loop:
+ return;qq
+
; We've scanned for points used on this board;
; now find the actual pins.
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<<GIEH) | (1<<GIEL)
mov_wf INTCON
; FSR1 is read pointer
;----------
-test_sofar_slave_startup_hook
+QQ_detect_slave_init
mov_lb 0x1
mov_fw picno
mov_wf t
s_buffer_reset
mov_lfsr test_sofar_slave_buf, 0
mov_lfsr test_sofar_slave_buf, 1
+
+ mov_lfsr 0x300,1
return
;----------
rcall led_green
QQ_i2csu_read_another
mov_fw POSTINC1
- bc_f FSR1L, test_sofar_s_bufbit
+ ;qq bc_f FSR1L, test_sofar_s_bufbit
goto i2cs_read_data