chiark / gitweb /
turn on booster (+); hex output ($) actually implemented; also panic_kill_hook
authorian <ian>
Thu, 1 Dec 2005 00:28:12 +0000 (00:28 +0000)
committerian <ian>
Thu, 1 Dec 2005 00:28:12 +0000 (00:28 +0000)
detpic/panic.asm
detpic/panic.fin
detpic/panic.inc
detpic/test-sofar.asm

index 35ea36e8fb15f00b1fd1ad206ab2a94ffd9cea16..9c72ae7d016bf8fdf4a496956e390177e86bc845 100644 (file)
@@ -46,6 +46,8 @@ panic_routine
         mov_wf   panic_address
        clr_f    STKPTR         ; avoids stack overruns
 
+       call    panic_kill_hook
+
 ; re-initialise timer0 config
        call    read_pic_no
        bra_z   panic_setup_if_master
index d3d298f7065e329f38d5f5d2d6796ec6b5bdab3c..d29eff319ecbcfa77bb15022c5fbc7eb94ea13c2 100644 (file)
@@ -1 +1,2 @@
  extern panic_routine
+ extern panic_kill_hook
index 82920d60f62217df2a7f1342c9c09a6b11501161..64e622df9e6863a1bd9928819a0311f6430bc02d 100644 (file)
@@ -1,6 +1,8 @@
 ;---------------------------------------------------------------------------
 ; macro is passed a message code morse_XY and panics displaying this message
-; by flashing the perpic LED
+; by flashing the perpic LED.  After disabling interrupts and resetting
+; the stack this will call panic_kill_hook (which should shut down any
+; scary peripherals).
 
 panic macro message
         movlw   (message - morse_messages_start)/4
index 07cbe66d5895a7137eca6d199f1b4146a1ae85d4..41b2362e057019731f0ec7eb7b67ee0adf8d1f19 100644 (file)
@@ -41,7 +41,8 @@
 ;      SPC     set buffer pointer to start, set that byte to 0xff
 ;      0       set buffer pointer to start, clear that byte
 ;      other   append char to buffer, clear byte at buffer pointer
-;      
+;
+;      +       turn on booster (polarity=L) and cdu
 ;      $       toggle hex mode for reading
 ;
 ;  Output characters:
@@ -163,6 +164,14 @@ serialu_read_char
        xor_wfw ch
        bra_z   m_ch_spc
 
+       mov_lw  '+'
+       xor_wfw ch
+       bra_z   m_ch_plus
+
+       mov_lw  '$'
+       xor_wfw ch
+       bra_z   m_ch_dollar
+
        mov_fw  ch
        add_lw  -('9'+1)
        bra_nn  m_ch_notdigit
@@ -189,6 +198,19 @@ m_ch_comma
 m_ch_stop
        goto    i2cm_read_done
 
+;----------
+m_ch_plus
+       pin_l   p0_booster_shutdown
+       pin_l   p0_booster_dirn
+       pin_h   p0_booster_pwm
+       pin_h   p0_cdu_enable
+       return
+
+;----------
+m_ch_dollar
+       bs_f    mode,mode_readhex
+       return
+
 ;----------
 m_ch_digit
 ; W now contains intended slave number
@@ -232,6 +254,15 @@ i2cmu_write_next_byte
        mov_fw  POSTINC2
        return
 
+;----------
+panic_kill_hook
+       bt_f_if0 idloc1,idloc1_master
+       return
+       ; master:
+       pin_h   p0_booster_shutdown
+       pin_l   p0_cdu_enable
+       return
+
 ;======================================================================
 
 m_delay4 rcall m_delay2