chiark / gitweb /
debugging points, wip
authorian <ian>
Wed, 7 Dec 2005 01:29:34 +0000 (01:29 +0000)
committerian <ian>
Wed, 7 Dec 2005 01:29:34 +0000 (01:29 +0000)
detpic/i2clib.inc
detpic/points.asm
detpic/slave.asm
detpic/test-sofar.asm

index 6454b6ff57fb1899e49b59b2256494b13e49e7a7..2dbf460de426ec4a8c0f9a53078759b4ddfb151c 100644 (file)
@@ -1,3 +1,4 @@
+ extern QQ_detect_slave_init
  extern QQ_i2csu_read_begin
  extern QQ_i2csu_read_another
 
index 5efca995d96805d66078569b6648fffc88fba70e..d39aa0414306bdd49e38407b9e3713ee4da1b4b6 100644 (file)
@@ -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.
 
index c356cd06462332e620bd0a3bdf0a2bd00b340f97..9aed92ffb60d0b1675fa835a61410bda95fc0c95 100644 (file)
 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
index ef634c9df303fada8bf84bc68a87f08a903ad37d..a4c1b4f4688f85ae47a1ca0ff43d099cf2a9a985 100644 (file)
@@ -245,7 +245,7 @@ panic_kill_hook
 ; FSR1 is read pointer
 
 ;----------
-test_sofar_slave_startup_hook
+QQ_detect_slave_init
        mov_lb  0x1
        mov_fw  picno
        mov_wf  t
@@ -293,6 +293,8 @@ s_shownum_loop
 s_buffer_reset
        mov_lfsr test_sofar_slave_buf, 0
        mov_lfsr test_sofar_slave_buf, 1
+
+ mov_lfsr 0x300,1
        return
 
 ;----------
@@ -300,7 +302,7 @@ QQ_i2csu_read_begin
        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