From abb595b78fd26f949923662337e58f5912ee174d Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 23 Dec 2005 01:04:42 +0000 Subject: [PATCH] reverse.asm uses slave_table instead of its own table; new file energy.asm compiles but is just stubs --- detpic/Makefile | 4 +++- detpic/energy.asm | 16 ++++++++++------ detpic/energy.fin | 2 +- detpic/final.inc | 2 +- detpic/morse.messages | 4 ++++ detpic/program.asm | 3 ++- detpic/reverse.asm | 43 ++++++++++++++++++------------------------- 7 files changed, 39 insertions(+), 35 deletions(-) diff --git a/detpic/Makefile b/detpic/Makefile index a6dfd84..b42be34 100644 --- a/detpic/Makefile +++ b/detpic/Makefile @@ -5,7 +5,8 @@ PICNOS= 0 1 2 PROGRAMS= program OBJS_program= vectors.o panic.o routines-led.o i2clib.o \ misc.o detect.o variables.o points.o serout.o \ - syncwrite.o mascan.o reverse.o nmra-stream.o + syncwrite.o mascan.o energy.o \ + reverse.o nmra-stream.o XCODEN_program= morse XCODE1_program= ours+pindata @@ -13,6 +14,7 @@ INCLUDES= \ ../iwjpictest/clockvaries.inc \ common.inc \ detect.inc \ + energy.fin \ final.inc \ i2clib.inc \ i2clib.incm \ diff --git a/detpic/energy.asm b/detpic/energy.asm index 8511e57..dab5b80 100644 --- a/detpic/energy.asm +++ b/detpic/energy.asm @@ -1,7 +1,13 @@ ;====================================================================== +; TRACK POWER AND SHORT CIRCUIT + include common.inc + code + +;====================================================================== command_power ; C 1 iff command is ON undefined + panic morse_UEC ;power_on ??? ; from cebpic/nmra-stream.asm's setup @@ -10,10 +16,8 @@ command_power bcf PORTB,0,0 ; user fault L or Z +power_polarising + panic morse_UER -master_interrupt_high -; either booster timer interrupt or short circuit - panic morse_UES ; fixme check short circuit - call nmra_interrupt_timer - -trackpower_polarising +;====================================================================== + include final.inc diff --git a/detpic/energy.fin b/detpic/energy.fin index c606e06..c0549db 100644 --- a/detpic/energy.fin +++ b/detpic/energy.fin @@ -1,2 +1,2 @@ extern command_power - extern power_reversing + extern power_polarising diff --git a/detpic/final.inc b/detpic/final.inc index d8c08c0..6e5ede9 100644 --- a/detpic/final.inc +++ b/detpic/final.inc @@ -1,12 +1,12 @@ include ../iwjpictest/syncwrite.inc include detect.inc + include energy.fin include i2clib.inc include mascan.fin include misc.fin include nmra-stream.fin include panic.fin include points.fin - include power.fin include program.fin include reverse.fin include routines-led.fin diff --git a/detpic/morse.messages b/detpic/morse.messages index 495fb4a..277d053 100644 --- a/detpic/morse.messages +++ b/detpic/morse.messages @@ -57,6 +57,10 @@ UC UI UG UX +UES +UER +UEC +URM UCI UCP diff --git a/detpic/program.asm b/detpic/program.asm index c4a436d..4495191 100644 --- a/detpic/program.asm +++ b/detpic/program.asm @@ -90,6 +90,8 @@ serialrx_table_section code 0x2000 ;-------------------- serialrx_generalmsg +;command_ has same calling convention: +; ; FSR0 -> start of message undefined ; *FSR0 message undefined ; @@ -160,7 +162,6 @@ serialrx_bad ;-------------------- command_ping -command_power command_point command_crashed panic morse_UC diff --git a/detpic/reverse.asm b/detpic/reverse.asm index c6829dd..892e535 100644 --- a/detpic/reverse.asm +++ b/detpic/reverse.asm @@ -13,13 +13,10 @@ maske res 1 ;---------------------------------------- ; MASTER - Access bank variables and other sections - udata -polarities_commanded_buffer res maxpics+1 - ; Each byte is: - ; 11RRRRRRR reverse command for slave, waiting to write - ; 000000001 that pic is not a reversers pic - ; 000000000 we have written any relevant command - ; 000000002 sentinel +; values for ste_revcmd: + ; 11RRRRRR reverse command for slave, waiting to write + ; 00000001 this is not a reversers pic + ; 00000000 we have written any relevant command ;====================================================================== ; LOCAL REVERSERS @@ -115,13 +112,7 @@ command_polarity ; and so on until f for bit 5. (See polarity_do_here, below.) ; ; we accumulate (`gather') the `g' bits in t. -; - - panic morse_UM -;; mov_lfsr message_buffer_start,0 - - - mov_lfsr polarities_commanded_buffer,1 + mov_lfsr slavetable + ste_revcmd, 1 mov_fw POSTINC0 ; W = 10010RRR mov_wf t ; t = 10010ggg xor_lw b'10001000' ; t = 00011ggg @@ -150,15 +141,19 @@ board ; FSR1 -> pic we've just filled ;... board_next_loop - dec_fw PREINC1 ; FSR1 -> pic after one we're testing - ; W = 1??????? existing reverse command + mov_lw ste_size + add_wff FSR1L ; FSR1 -> pic after one we're testing + if ste_szln2 + maxpics_ln2 == 8 + bra_c board_next_none + else + error "reliance on carry flag for incrementing FSR1 fails" + endif + dec_fw INDF1 ; W = 1??????? existing reverse command ; 00000000 not a reversers pic ; ffffffff no existing command - ; 00000001 sentinel bra_z board_next_loop ; not a reversers pic - bra_nn board_next_none ; sentinel - bt_f_if0 INDF1,7 ; 1....... existing command + bt_f_if0 INDF1, 7 ; 1....... existing command ; 0....... no existing command inc_f polarities_waiting return @@ -171,16 +166,14 @@ board_next_none ; now we're exiting from the loop in when_reverse_message_found pop ; that disposes of the call to `board' - goto trackpower_decide - ; that will turn it off, since polarities_waiting is nonzero + call power_polarising + mov_lfsr slavetable + ste_revcmd, 1 + mov_fw INDF1 ; there's always a board 0, us: + goto polarity_local_do ;---------- board_next_none_more_message panic morse_RL -;---------- -trackpower_decide - panic morse_UE - ;====================================================================== include final.inc -- 2.30.2