chiark / gitweb /
fixes from nye debugging
authorian <ian>
Sat, 31 Dec 2005 19:00:37 +0000 (19:00 +0000)
committerian <ian>
Sat, 31 Dec 2005 19:00:37 +0000 (19:00 +0000)
detpic/energy.asm
detpic/i2clib.asm
detpic/make-panicworthy
detpic/mascan.asm
detpic/points.asm
detpic/program.asm
detpic/reverse.asm

index e196fb0922dec5f14aec0781e71b836045ad2e8c..7229d2b73c6fce34c9a1cb2c01c0ffddeda4b5c0 100644 (file)
@@ -121,7 +121,7 @@ command_power_on @
        ; must be Off:
 
        pin_vl  p0_booster_shutdown
- D 0x60
+ D 0x81
  bt_f_if1 xdebug+6, 0
  bs_f xdebug+6, 1
        goto    cdu_on
index 633657d6b555753e095803a2c5f21e1fefda2fe2..ed70623894d8717b6bd8fcbe811697833e4c6b57 100644 (file)
@@ -3,15 +3,16 @@
 ;
 ; 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
 
@@ -112,11 +113,13 @@ 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
@@ -127,8 +130,12 @@ 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...
index 94db34fefd8a70a1a7a6f4a8f60ee13afad0cfe4..6b1ddbe097e5e3199a600a2d921d582b28177609 100755 (executable)
@@ -43,7 +43,8 @@ if (m/^(\w*)\s+code\b/) {
        mangle($1) if m/^(\w+)\b/;
        s/\b(\w+)\b/ $mangle{$1} ? "$pfx$1" : $1 /ge;
     }
-    $codesection .= $_;
+    $codesection .= $_
+       unless m/\;\!P\s*$/;
 } elsif (m/^\;\#MANGLE\# (\w+)$/) {
     $mangle{$1}= 1;
     $l= '';
index 27811ee02996be458f2ec6da615537ea271dc9bc..4ed58a296112168746f7d4195a8a63b199e46261 100644 (file)
@@ -34,9 +34,24 @@ i2c_getwritebyte_yes @
   code
 ;----------------------------------------
 i2cmu_write_next_byte
+ D 0x61
+ mov_fw cwslave
+ call debugbyte 
        ; 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
@@ -46,6 +61,7 @@ i2cmu_write_next_byte
 i2cm_intrl @
 ; handles i2c interrupt using i2cm_interrupt[_definite],
 ; according to the rules for <something>_intrl.
+ D 0x60
        bt_f_if0 PIR1, SSPIF
        return
        call    i2cm_interrupt_definite
index 5ec694c470fbb17560949456547ad0f4aef0e422..d3bc3e6ef2e824342e2487623d6ec52527abcc93 100644 (file)
@@ -23,6 +23,7 @@
 ;  (according to CDU Enable LAT bit)
 
 cdu_timeout    equ     200 ; ms
+cdu_inittimeout        equ     750 ; ms
 
 ptix2latbit equ 0x300 ; has to be a multiple of 0x100
 ptix2latbit_section udata ptix2latbit
@@ -356,7 +357,10 @@ cdu_init @
 cdu_off @
 cdu_panichook @
        pin_l   p0_cdu_enable
-;...
+       mov_lw  (cdu_inittimeout * 1000) / tickdiv_us + 1
+       mov_wf  cducharging
+       return
+
 ;-----
 cdu_discharged
        mov_lw  (cdu_timeout * 1000) / tickdiv_us + 1
index c4ea72ddae54e73ee42cdb7f71b99e6986058c4c..8c1db57ebe4859a2a3bb44df2b932b42ca853c64 100644 (file)
@@ -78,22 +78,29 @@ master_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
        call    tick_intrl
;Dl 0x01
D 0x01
        call    nmra_serialrx_intrl
;Dl 0x02
D 0x02
        call    power_fault_intrl
;Dl 0x03
D 0x03
        call    serialtxfc_intrl
;Dl 0x04
D 0x04
        call    serialtx_intrl
;Dl 0x05
D 0x05
        call    points_local_intrl
;Dl 0x06
D 0x06
        call    i2cm_intrl
  bs_f  xdebug+0, 5
        panic   morse_IL
index 678919a78441e33fc48a629b62619375006c5e40..725edfc4908ab077e5cc033fc3db3ed5a40638dc 100644 (file)
@@ -262,12 +262,13 @@ polarity_getwritebyte @
        mov_lfsr polarity_cmds, 0
        mov_fw  cwslave
        add_wff FSR0L
+       bt_f_if0 INDF0, 7
+       return
+       ; yes, we have something:
+
        mov_fw  INDF0
        clr_f   INDF0 ; we're about to write this
-       bra_n   i2c_getwritebyte_yes
-       ; no:
-       bs_f xdebug+0, 7
-       return
+       bra     i2c_getwritebyte_yes
 
 ;======================================================================
   include final.inc