chiark / gitweb /
detection scanning seems to work
authorian <ian>
Fri, 30 Dec 2005 14:44:03 +0000 (14:44 +0000)
committerian <ian>
Fri, 30 Dec 2005 14:44:03 +0000 (14:44 +0000)
detpic/mascan.asm
detpic/program.asm

index 62e439729469dd7a3c5e83f2be6689beb17bdd6f..754f278310f2e52484cadf1fe3591d52ef5381e9 100644 (file)
@@ -65,7 +65,11 @@ i2cmu_read_got_byte
                                ; W =           received byte
        mov_wf  b               ; W = b =       received byte
 
- panic morse_TI4
+ D 0x70
+ mov_fw cbyte
+ call debugbyte
+ mov_fw b
+ call debugbyte
        mov_lfsr slavetable, 1
        mov_ff  cslot, FSR1L    ; FSR1 ->       slave's flags
 
@@ -140,8 +144,13 @@ read_got_detectbyte_prep_ifsomething
 ;  lastd<n>    [o0]*
 ;  FSR1 ->     lastd<n>
 ;
+ mov_wf xdebug+0
        mov_wf  u               ; u =           [C0]*
-       xor_wfw INDF1           ; lastd<n> =    [d0]*
+ mov_ff INDF1, xdebug+1
+       xor_wff INDF1           ; lastd<n> =    [d0]*
+       ; to force test of repeated detection notification,
+       ;  comment out previous line
+ mov_ff INDF1, xdebug+2
        mov_lw  0x07
        ior_wff FSR1L           ; FSR1L ->      detmsgh
        return ; to addmsgs_<something>, very shortly
@@ -234,11 +243,13 @@ nextslave_nowrite
        mov_lfsr slavetable, 1  ; FSR1H -> slavetable
        mov_ff  cslot, FSR1L    ; FSR1 -> new ste_flags
 
- return
        bt_f_if1 POSTDEC1, stf_sentinel ; FSR1 -> ste_slave
        bra     nextslave_looparound
        ; Ok, we have a slave:
 
+ D 0x71
+ mov_fw cslot
+ call debugbyte
        mov_fw  INDF1           ; W = new slave number
        goto    i2cm_read_start
 
@@ -246,6 +257,9 @@ nextslave_looparound
        ; now we do our own detection
        mov_lw  (slavetable + ste_flags) & 0xff ; select our own slot
        mov_wf  cslot
+ D 0x72
+ mov_fw cslot
+ call debugbyte
        call    read_detection_head_master
        goto    i2cmu_read_got_byte
 
@@ -441,11 +455,16 @@ addmsg_one
 ;  TOS - 4 ->  bt_f_if1 w, b'bbb'
 ;  TOSL                ???bbb00
 ; other conditions on entry and exit as for entry to addmsgs_<kind>, above
- panic morse_TI5
+ ;dec_f_ifz xdebug+7
+ ;bra boom
+
+ mov_ff t, xdebug+1
        rr_fw   TOSL            ; W =           0???bbb0
+ mov_wf xdebug+2
        rr_w                    ; W =           00???bbb
-       ior_wfw 0xf8            ; W =           11111bbb
+       ior_lw  0xf8            ; W =           11111bbb
        mov_wf  FSR0L           ; FSR0L =       11111bbb
+ mov_wf xdebug+3
        clr_f   FSR0H           ; FSR0 ->       bitnum2bit[bbb]
        add_wfw t               ; W =           adjdetbasel + 11111bbb
                                ;  ie =         0 SSSSSSS (det msg low byte)
@@ -461,5 +480,7 @@ addmsg_one
        mov_fw  v               ; W =           0 SSSSSSS (det msg low byte)
        goto    serial_addbyte_another
 
+boom panic morse_TI5
+
 ;======================================================================
   include final.inc
index 239e2098eb27563df07c02d7ef8228bc54de3927..557e316d3bfb7435e78f32d7ec677b9b29c0024f 100644 (file)
@@ -59,6 +59,7 @@ master_init
 ; Master-specific initialisation.
        call    memory_erase
        clr_f   flags
+ set_f xdebug+7
        call    serial_init
        call    i2cm_init
        call    serialtxbuf_init