From c5926b40619edc73de4cd37b918f74b138480947 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 30 Dec 2005 14:44:03 +0000 Subject: [PATCH] detection scanning seems to work --- detpic/mascan.asm | 31 ++++++++++++++++++++++++++----- detpic/program.asm | 1 + 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/detpic/mascan.asm b/detpic/mascan.asm index 62e4397..754f278 100644 --- a/detpic/mascan.asm +++ b/detpic/mascan.asm @@ -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 [o0]* ; FSR1 -> lastd ; + mov_wf xdebug+0 mov_wf u ; u = [C0]* - xor_wfw INDF1 ; lastd = [d0]* + mov_ff INDF1, xdebug+1 + xor_wff INDF1 ; lastd = [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_, 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_, 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 diff --git a/detpic/program.asm b/detpic/program.asm index 239e209..557e316 100644 --- a/detpic/program.asm +++ b/detpic/program.asm @@ -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 -- 2.30.2