From: ian Date: Thu, 1 Dec 2005 00:28:12 +0000 (+0000) Subject: turn on booster (+); hex output ($) actually implemented; also panic_kill_hook X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=a74f8def903eb9784aed6c7d5e1cc01ee6b045f8;p=trains.git turn on booster (+); hex output ($) actually implemented; also panic_kill_hook --- diff --git a/detpic/panic.asm b/detpic/panic.asm index 35ea36e..9c72ae7 100644 --- a/detpic/panic.asm +++ b/detpic/panic.asm @@ -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 diff --git a/detpic/panic.fin b/detpic/panic.fin index d3d298f..d29eff3 100644 --- a/detpic/panic.fin +++ b/detpic/panic.fin @@ -1 +1,2 @@ extern panic_routine + extern panic_kill_hook diff --git a/detpic/panic.inc b/detpic/panic.inc index 82920d6..64e622d 100644 --- a/detpic/panic.inc +++ b/detpic/panic.inc @@ -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 diff --git a/detpic/test-sofar.asm b/detpic/test-sofar.asm index 07cbe66..41b2362 100644 --- a/detpic/test-sofar.asm +++ b/detpic/test-sofar.asm @@ -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