chiark / gitweb /
fixes from debugging
authorian <ian>
Fri, 30 Dec 2005 01:48:38 +0000 (01:48 +0000)
committerian <ian>
Fri, 30 Dec 2005 01:48:38 +0000 (01:48 +0000)
detpic/reverse.asm

index 13eaa3eaa98790e0e88ad93e21d4baee8dbe1018..d0c40aa2eca237a036153acb1855ecb3eb8065ab 100644 (file)
@@ -98,15 +98,15 @@ polarity_local_init @
 command_polarity @
 ; message format
 ;              SS zz zz SS  ZZ 2f 2e 2d        g is board 2
-;              MM 2c 0f 0e  0d 0c 0b 0a        board 0
-;              MM 2b 1f 1e  1d 1c 1b 1a        board 1
-;              MM 2a 3f 3e  3d 3c 3b 3a        g, board 2, complete, also 3
-;              MM 9f 4f 4e  4d 4c 4b 4a        g is board 9
-;              MM 9e 5f 5e  5d 5c 5b 5a
-;              MM 9d 6f 6e  6d 6c 6b 6a
-;              MM 9c 7f 7e  7d 7c 7b 7a
-;              MM 9b 8f 8e  8d 8c 8b 8a
-;              MM 9a af ae  ad ac ab aa
+;              MM 0f 0e  0d 0c 0b 0a 2c        board 0
+;              MM 1f 1e  1d 1c 1b 1a 2b        board 1
+;              MM 3f 3e  3d 3c 3b 3a 2a        g, board 2, complete, also 3
+;              MM 4f 4e  4d 4c 4b 4a 9f        g is board 9
+;              MM 5f 5e  5d 5c 5b 5a 9e
+;              MM 6f 6e  6d 6c 6b 6a 9d
+;              MM 7f 7e  7d 7c 7b 7a 9c
+;              MM 8f 8e  8d 8c 8b 8a 9b
+;              MM af ae  ad ac ab aa 9a
 ;              etc.
 ; where
 ;      SS      bit set
@@ -166,8 +166,10 @@ board_next_none
 
        mov_fw  polarity_cmds ; there's always a board 0, us
        call    polarity_local_do
+       clr_f   polarity_cmds ; we've done ours (this is for form's sake)
        rcall   polarity_needwrite ; does `return' because it will find one
        return                     ; ... or maybe not if only 1 rev board
+       ; so do not optimise away rcall/return combination !
 
 ;----------
 board_next_none_more_message
@@ -229,7 +231,7 @@ polarity_needwrite @
 ;  nb register usage may need to be adjusted for wiring into mascan i2cm_...
        mov_lfsr polarity_cmds, 0
 polarity_needwrite_loop
-       rlc_fw  PREINC1         ; W = 1RRRRRR? C=1  reverse command
+       rlc_fw  PREINC0         ; W = 1RRRRRR? C=1  reverse command
                                ; W = 0000001? C=0  not a reversers pic
                                ; W = 0000000? C=0  no existing command
                                ; W = 1000000? C=0  sentinel
@@ -243,7 +245,7 @@ polarity_needwrite_loop
        goto    power_polarising_settling
 
 polarity_needwrite_found
-       mov_fw  FSR1L
+       mov_fw  FSR0L
        add_lw  -polarity_cmds
        pop
        goto    i2c_needwrite
@@ -263,6 +265,7 @@ polarity_getwritebyte @
        mov_fw  cwslave
        add_wff FSR0L
        mov_fw  INDF0
+       clr_f   INDF0 ; we're about to write this
        bra_n   i2c_getwritebyte_yes
        ; no:
        return