chiark / gitweb /
remove various debugging junk: all uses of xdebug removed (but not the xdebug memory...
authorian <ian>
Sun, 1 Jan 2006 13:52:05 +0000 (13:52 +0000)
committerian <ian>
Sun, 1 Jan 2006 13:52:05 +0000 (13:52 +0000)
detpic/common.inc
detpic/energy.asm
detpic/i2clib.asm
detpic/i2clib.inc
detpic/mascan.asm
detpic/points.asm
detpic/program.asm
detpic/variables.asm

index f54e81806781f949fa4a0d94ca42fffbcc0051a8..116c007b16f46e551c0512ead9114bef0d24dd17 100644 (file)
@@ -122,11 +122,48 @@ tickdiv_us equ tick_us * tickdiv
 @ macro
   endm
 
-D macro v
-       mov_lw  v
+;----------------------------------------
+; For adding a byte to the debug buffer.
+; Not for use in High ISR.  In all cases:
+;
+;  STATUS      any             trashed
+;  all others  any             preserved
+
+  ifndef NDEBUG
+;----------
+Dv macro  ; sorry, but assembler's dw directive isn't case-sensitive
+;
+;  W           message byte    preserved
+;
        call    debugbyte
        endm
 
+;----------
+Dl macro debug_literal_value
+;
+;  W           any             literal value as specified
+;
+       mov_lw  debug_literal_value
+       Dv
+       endm
+
+;----------
+Df macro debug_register_file_address
+;
+;  W           any             value from specified memory location
+;
+       mov_fw  debug_register_file_address
+       Dv
+       endm
+  else
+Dv macro
+   endm
+Dl macro debug_literal_value
+   endm
+Df macro debug_register_file_address
+   endm
+  endif
+
 ;----------------------------------------
 ; For entering and leaving Low ISR, saving and restoring STATUS and W
 ; See above under <something>_intrl, and {master,slave}_interrupt_low
index 7229d2b73c6fce34c9a1cb2c01c0ffddeda4b5c0..57ab317b30e0fc460c2a42c886303a20020fa4e5 100644 (file)
@@ -121,9 +121,7 @@ command_power_on @
        ; must be Off:
 
        pin_vl  p0_booster_shutdown
- D 0x81
- bt_f_if1 xdebug+6, 0
- bs_f xdebug+6, 1
+       Dl 0x81
        goto    cdu_on
 
 ;----------
index ed70623894d8717b6bd8fcbe811697833e4c6b57..ebbf62ddbe946edf1689328637bb1bcfc1c0c5b8 100644 (file)
@@ -3,16 +3,15 @@
 ;
 ; See i2clib.asm for documentation of the interface to this file.
 
; include /usr/share/gputils/header/p18f458.inc
; radix dec
; include ../iwjpictest/insn-aliases.inc
+  include /usr/share/gputils/header/p18f458.inc
+  radix dec
+  include ../iwjpictest/insn-aliases.inc
 
; include ../iwjpictest/clockvaries.inc
; include panic.inc
; include morse+auto.inc
; include i2clib.incm
+  include ../iwjpictest/clockvaries.inc
+  include panic.inc
+  include morse+auto.inc
+  include i2clib.incm
 
- include common.inc
 ;======================================================================
 ; NOTATION
 
@@ -113,13 +112,11 @@ i2cm_init
 
 ;----------
 i2cm_interrupt
- D 0x50 ;!P
                bt_f_if0 PIR1, SSPIF
                return
                ; We have an interrupt:
 ;...
 i2cm_interrupt_definite
- D 0x51 ;!P
                mov_ff  SSPSTAT, sspstat
                mov_ff  SSPCON1, sspcon1
                mov_ff  SSPCON2, sspcon2
@@ -130,12 +127,8 @@ i2cm_interrupt_definite
                and_wfw sspcon1
                bra_nz  m_event_bad
 
- mov_fw st ;!P
- call debugbyte ;!P
-
                ; No ?  Well, then the I2C should be idle now:
                mov_fw  sspcon2
- call debugbyte ;!P
                and_lw  ~((1<<ACKSTAT) | (1<<ACKDT)) ; those two are ok if set
                bra_nz  m_event_bad
                ; OK...
@@ -506,6 +499,4 @@ s_event_bad
   include program+externs.fin
   include i2clib.inc
 
- include variables+vars.fin
-
   end
index 296b11573f3ebd6fa983620a8dbbfa6895f7f555..5167a1329d09afc695f456520f227184c31b08a5 100644 (file)
@@ -1,7 +1,3 @@
- extern QQ_detect_slave_init
- extern QQ_i2csu_read_begin
- extern QQ_i2csu_read_another
-
 ;######################################################################
 ; i2clib.inc - I2C LIBRARY - DECLARATIONS AND DOCUMENTATION
 ;
index 4ed58a296112168746f7d4195a8a63b199e46261..552f39bd972f40a5b52be41c16ee47823a295f3f 100644 (file)
@@ -34,24 +34,10 @@ i2c_getwritebyte_yes @
   code
 ;----------------------------------------
 i2cmu_write_next_byte
- D 0x61
- mov_fw cwslave
- call debugbyte 
+       Dl 0x91
        ; add calls to getwritebyte_<foo> here:
- D 0x62
- mov_lfsr 0x5f+2, 0
- mov_fw INDF0
- call debugbyte 
        call    polarity_getwritebyte
- D 0x63
- mov_lfsr 0x5f+2, 0
- mov_fw INDF0
- call debugbyte 
        call    points_getwritebyte
- D 0x64
- mov_lfsr 0x5f+2, 0
- mov_fw INDF0
- call debugbyte 
        ; end of list of calls to getwritebyte_<foo>
        ; so, no-one wants this slave:
        bs_f    STATUS, Z
@@ -61,7 +47,7 @@ i2cmu_write_next_byte
 i2cm_intrl @
 ; handles i2c interrupt using i2cm_interrupt[_definite],
 ; according to the rules for <something>_intrl.
D 0x60
      Dl 0x90
        bt_f_if0 PIR1, SSPIF
        return
        call    i2cm_interrupt_definite
@@ -81,13 +67,11 @@ i2cmu_read_got_byte
                                ; W =           received byte
        mov_wf  b               ; W = b =       received byte
 
- D 0x70
- mov_fw cslot
- call debugbyte
- mov_fw cbyte
- call debugbyte
- mov_fw b
- call debugbyte
+       Dl 0x90
+       Df cslot
+       Df cbyte
+       Df b ; also restores b to W
+
        mov_lfsr slavetable, 1
        mov_ff  cslot, FSR1L    ; FSR1 ->       slave's flags
 
@@ -105,7 +89,6 @@ read_got_first_detectors     ; b =           MdBBdddd
        mov_fw  POSTINC1        ; W = detbasel; FSR1 -> lastd0
        rcall   read_got_detectbyte_prep ; b =  0d00dddd
                                         ; u =  0C00CCCC
- ;mov_ff b, xdebug+5
        bt_f_if1 b, 6           ; b bit         .d......
        bs_f    b, 4            ; b =           0d0ddddd
                                ;                ^ ^ copies of same bit
@@ -135,9 +118,6 @@ read_got_detectors_b1               ; b =           dddddddd
        add_lw  5               ; W = adjdetbasel
        bs_f    FSR1L, 2        ; FSR1L -> lastd1
        bc_f    cbyte, 4        ; cbyte =       M0B00000
- mov_ff xdebug+4, xdebug+5
- mov_ff xdebug+3, xdebug+4
- mov_ff b, xdebug+3
        rcall   read_got_detectbyte_prep
        goto    addmsgs_all
 
@@ -168,12 +148,12 @@ read_got_detectbyte_prep_ifsomething
 ;  FSR1 ->     lastd<n>
 ;
        mov_wf  u               ; u =           [C0]*
- D 0x74
- mov_fw FSR1L
- call debugbyte
- mov_fw u
- call debugbyte
-       xor_wff INDF1           ; lastd<n> =    [d0]*
+
+       Dl 0x74
+       Df FSR1L
+       Df u ; also restores u to W
+
+       xor_wff INDF1           ; lastd<n> =    [d0]*
        ; to force test of repeated detection notification,
        ;  comment out previous line
        mov_lw  0x07
@@ -220,11 +200,10 @@ read_got_detectbyte_prep
 ;  NOS         return address for i2cmu_read_got_byte
 ;
        mov_wf  t               ; t =           adjdetbasel
- D 0x73
- mov_fw INDF1
- call debugbyte
+       Dl 0x73
+       Df INDF1
        mov_fw  b               ; W =           [d0]*
- call debugbyte
+       Dv
        xor_wfw INDF1           ; W =           [C0]*, Z iff same
                        ;  where C set iff change to that detection segment
        bra_nz  read_got_detectbyte_prep_ifsomething
@@ -278,27 +257,18 @@ nextslave_nowrite
        bra     nextslave_looparound
        ; Ok, we have a slave:
 
D 0x71
      Dl 0x91
        mov_fw  INDF1           ; W = new slave number
        goto    i2cm_read_start
 
 nextslave_looparound
- bt_f_if1 xdebug+6,2
- goto boom2
-
- bt_f_if1 xdebug+6,1
- bs_f xdebug+6,2
-
        ; now we do our own detection
        mov_lw  (slavetable + ste_flags) & 0xff ; select our own slot
        mov_wf  cslot
D 0x72
      Dl 0x72
        call    read_detection_head_master
        goto    i2cmu_read_got_byte
 
-boom2
- panic morse_TI1
-
 ;----------------------------------------
 i2c_needwrite @
 ; Informs mascan that we need to write to some slave.
@@ -490,11 +460,8 @@ addmsg_one
 ;  TOS - 4 ->  bt_f_if1 u, b'bbb'
 ;  TOSL                ???bbb00
 ; other conditions on entry and exit as for entry to addmsgs_<kind>, above
- ;dec_f_ifz xdebug+7
- ;bra boom
- D 0x75
- mov_fw TOSL
- call debugbyte
+       Dl 0x75
+       Df TOSL
        rr_fw   TOSL            ; W =           0???bbb0
        rr_w                    ; W =           00???bbb
        ior_lw  0xf8            ; W =           11111bbb
@@ -510,19 +477,14 @@ addmsg_one
        bt_f_if0 STATUS, Z
        mov_lw  0x08            ; train: W = 0 000 0 000; none: W = 0 000 1 000
        xor_wfw INDF1           ; W =           1 001 Y SSS (det msg high byte)
- call debugbyte
+       Dv
        call    serial_addbyte
 
- ;bt_f_if1 xdebug+6, 0
- ;bra boom
-
        mov_fw  v               ; W =           0 SSSSSSS (det msg low byte)
- call debugbyte
+       Dv
        goto    serial_addbyte_another
 
 addmsg_bad panic morse_DJ
-boom
- panic morse_TI5
 
 ;======================================================================
   include final.inc
index d3bc3e6ef2e824342e2487623d6ec52527abcc93..ac50cffe4b97346a5af16aab13a0840e939e5e03 100644 (file)
@@ -369,7 +369,6 @@ cdu_discharged
 
 ;--------------------
 cdu_on @
- clr_f xdebug+0
        pin_h   p0_cdu_enable
        return
 
index 8c1db57ebe4859a2a3bb44df2b932b42ca853c64..dfa21b969f584b3b8e8e729c9102f5c5b1c20a30 100644 (file)
@@ -59,8 +59,6 @@ master_init
 ; Master-specific initialisation.
        call    memory_erase
        clr_f   flags
- set_f xdebug+7
- clr_f xdebug+6
        call    serial_init
        call    i2cm_init
        call    serialtxbuf_init
@@ -75,34 +73,19 @@ master_init
        call    power_polarising_init
        call    power_fault_init
        call    watchdog_init
- clr_f xdebug+0
        return
 
-boom3
- panic morse_TI3
-
 ;----------------------------------------
 master_interrupt_low @
        enter_interrupt_low
- D 0x80
- mov_lfsr 0x5f+2, 0
- mov_fw INDF0
- xor_lw 0x40
- bra_nz boom3
+       Dl 0x80
        call    tick_intrl
- D 0x01
        call    nmra_serialrx_intrl
- D 0x02
        call    power_fault_intrl
- D 0x03
        call    serialtxfc_intrl
- D 0x04
        call    serialtx_intrl
- D 0x05
        call    points_local_intrl
- D 0x06
        call    i2cm_intrl
- bs_f  xdebug+0, 5
        panic   morse_IL
 
 ;----------------------------------------------------------------------
@@ -163,7 +146,6 @@ command_ping
        call    serial_addbyte
        mov_fw  t
        bra_n   command_ping_bad
- mov_wf xdebug+6
        goto    serial_addbyte_another
 
 command_ping_bad panic morse_HP
index 302b805a2cef1a4e4422962bf8cce06e912b868e..95fbe32777d078d051b9a96eb1300266aa8c575d 100644 (file)
@@ -31,22 +31,6 @@ xdebug                       res     8
 cwslave                        res     1 ; slave we're currently actually writing to
                                  ; undefined except in <something>_needwrite
 
-qqtrislat_start equ 0x50
-qqtrislat_section udata qqtrislat_start
-qqtrislat res 15
-
-qqTRISA equ qqtrislat_start + 1
-qqTRISB equ qqtrislat_start + 2
-qqTRISC equ qqtrislat_start + 3
-qqTRISD equ qqtrislat_start + 4
-qqTRISE equ qqtrislat_start + 5
-
-qqLATA equ qqtrislat_start + 7
-qqLATB equ qqtrislat_start + 8
-qqLATC equ qqtrislat_start + 9
-qqLATD equ qqtrislat_start + 0xa
-qqLATE equ qqtrislat_start + 0xb
-
 ;----------------------------------------------------------------------
 ; NON-ACCESS-BANK SECTIONS (TABLES)