chiark / gitweb /
new make-externs automatically generates " extern whatever" from "whatever @"...
authorian <ian>
Thu, 29 Dec 2005 14:01:18 +0000 (14:01 +0000)
committerian <ian>
Thu, 29 Dec 2005 14:01:18 +0000 (14:01 +0000)
31 files changed:
detpic/.cvsignore
detpic/Makefile
detpic/common.inc
detpic/detect.asm
detpic/detect.inc [deleted file]
detpic/energy.asm
detpic/energy.fin [deleted file]
detpic/final.inc
detpic/i2clib.asm
detpic/make-externs [new file with mode: 0755]
detpic/mascan.asm
detpic/mascan.fin [deleted file]
detpic/misc.asm
detpic/misc.fin [deleted file]
detpic/nmra-stream.asm
detpic/nmra-stream.fin [deleted file]
detpic/panic.asm
detpic/panic.fin [deleted file]
detpic/points.asm
detpic/points.fin [deleted file]
detpic/program.asm
detpic/program.fin [deleted file]
detpic/reverse.asm
detpic/reverse.fin [deleted file]
detpic/routines-led.asm
detpic/routines-led.fin [deleted file]
detpic/serout.asm
detpic/serout.fin [deleted file]
detpic/tick.asm
detpic/tick.fin [deleted file]
detpic/vectors.fin [deleted file]

index 5730ae99657f716aac1e9de02ee16b05b9487434..854df3e99f19f5cd5488d433729c439b7ba2f9a3 100644 (file)
@@ -1,5 +1,6 @@
 *+morse.asm
 *+clocks.inc
+*+externs.fin
 *.cod
 *.hex
 *.lst
index 11444b01d3a89e2887e56f2e553df1c80b7b8ecf..9603e279950845564c22533a6788f55759e6cbbc 100644 (file)
@@ -2,37 +2,28 @@
 CEBPIC=                ../cebpic/
 PICNOS=                0 1 2
 
+FILES=                 variables vectors                               \
+                       panic routines-led i2clib+panic                 \
+                       misc detect points serout                       \
+                       syncwrite mascan energy                         \
+                       reverse nmra-stream tick
+
 PROGRAMS=              program
-OBJS_program=          variables.o vectors.o                           \
-                       panic.o routines-led.o i2clib+panic.o           \
-                       misc.o detect.o points.o serout.o               \
-                       syncwrite.o mascan.o energy.o                   \
-                       reverse.o nmra-stream.o tick.o
+OBJS_program=          $(addsuffix .o, $(FILES))
 XCODEN_program=        morse
 XCODE1_program=        ours+pindata
 
-INCLUDES=                                      \
-               ../iwjpictest/clockvaries.inc   \
-               common.inc                      \
-               detect.inc                      \
-               energy.fin                      \
-               final.inc                       \
-               i2clib+panic.inc                \
-               i2clib.incm                     \
-               misc.fin                        \
-               mascan.fin                      \
-               nmra-stream.fin                 \
-               panic.fin                       \
-               panic.inc                       \
-               pindata.inc                     \
-               points.fin                      \
-               program+clocks.inc              \
-               program.fin                     \
-               reverse.fin                     \
-               routines-led.fin                \
-               serout.fin                      \
-               tick.fin                        \
-               vectors.fin                     \
+INCLUDES=                                              \
+               common.inc                              \
+                       panic.inc                       \
+                       ../iwjpictest/clockvaries.inc   \
+                       pindata.inc                     \
+                       program+clocks.inc              \
+                       i2clib.incm                     \
+               final.inc                               \
+                       ../iwjpictest/syncwrite.inc     \
+                       i2clib+panic.inc                \
+                       program+externs.fin
 
 VARSFILES=     variables
 SYNCWRITES=    syncwrite.asm syncwritehex.asm
@@ -45,6 +36,10 @@ bessar:              program+program.map
 $(SYNCWRITES): %: ../iwjpictest/%
                cp $< $@
 
+%+externs.fin: make-externs %.asm $(addsuffix .asm, $(FILES))
+               ./$+ >$@.new
+               diff -q $@ $@.new || mv -vf $@.new $@
+
 i2clib+panic.%:        make-panicworthy i2clib+panic.mangles i2clib.%
                ./$+ -Ii2clib.inc,i2clib+panic.inc $o
 
index 0cb0f146a5733a79b622eb2547b3c7963c230e9b..ed166bf8ec0a332acfafbc9c9c54b9198e67d66a 100644 (file)
@@ -119,6 +119,9 @@ tickdiv_us equ tick_us * tickdiv
 ;----------------------------------------------------------------------
 ; MACROS
 
+@ macro
+  endm
+
 ;----------------------------------------
 ; For entering and leaving Low ISR, saving and restoring STATUS and W
 ; See above under <something>_intrl, and {master,slave}_interrupt_low
index f5553e6414ddb29ecd6bb9c144927d8a91104b2d..f2c557ff782695f98f1a008837ad14ed5afee160 100644 (file)
@@ -113,7 +113,7 @@ message_buffer_end  res     0
        code
 
 ;----------
-detect_local_init
+detect_local_init @
        mov_lw  b'111'  ; turn off comparator, or we can't use pins
        mov_wf  CMCON   ;   RD0-RD4 as digital inputs
        mov_lw  b'0110' ; turn off A/D except perhaps for pin
@@ -137,14 +137,14 @@ detect_local_init
        return
 
 ;----------
-detect_slave_init
+detect_slave_init @
        mov_lfsr outbuf, 2
        clr_f   outmsg_end
 
        goto    reset_detectread
 
 ;----------------------------------------
-slave_add_short_message
+slave_add_short_message @
 ; Queues a message byte for transmission to the master.
 ; It will be transmitted as an extra message byte, when we are polled.
 ;  W           message         unchanged
@@ -234,7 +234,7 @@ i2csu_read_another
                ; on the left, above.
 
 ;----------
-backgroundloop_detectors
+backgroundloop_detectors @
        rr_fw   PORTB   ; W     xx xx xx xx  04 20 17 xx (now)
        and_wff scanb   ; b     xx xx xx xx  04 20 17 xx (cumulative)
        rl_fw   PORTA   ; W     19 09 12 15  18 xx xx xx (now)
@@ -381,7 +381,7 @@ backgroundloop_reversers_core macro
        bt_f_if0 PORTE,2 ;                      02       (now)
        bc_f    buf0,4  ; buf0  MM zz zz 02  zz ss zz zz (cumulative)
        endm
-backgroundloop_reversers
+backgroundloop_reversers @
        backgroundloop_reversers_core
        backgroundloop_again backgroundloop_reversers
 
@@ -408,12 +408,12 @@ i2csu_read_begin_reversers
 ; FOR MASTER
 
 ;----------
-backgroundloop_master
+backgroundloop_master @
        backgroundloop_reversers_core
        bra     backgroundloop_master
 
 ;----------
-read_detection_head_master
+read_detection_head_master @
        read_begin_calc_buf0_reversers
        bra_n   read_detection_head_master_badmore
        set_f   scana
diff --git a/detpic/detect.inc b/detpic/detect.inc
deleted file mode 100644 (file)
index 9d18003..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-  extern detect_local_init
-  extern detect_slave_init
-  extern slave_add_short_message
-  extern read_detection_head_master
-  extern backgroundloop_master
-  extern backgroundloop_reversers
-  extern backgroundloop_detectors
index 5bbbbeda97ddccb1ade986040428e97865b5f461..9fb51ef33b6f0b23f7026a03d8758521e76b838d 100644 (file)
@@ -33,13 +33,13 @@ retry_wait  res     1
 ;----------------------------------------------------------------------
 
 ;--------------------
-power_polarising_init
+power_polarising_init @
        clr_f   settling
        pin_h   p0_booster_pwm
        return
 
 ;--------------------
-power_polarising_begin
+power_polarising_begin @
        pin_vl  p0_booster_pwm
        bc_f    INTCON, TMR0IE ; disables NMRA interrupt
        bs_f    flags, flags_polarising
@@ -47,7 +47,7 @@ power_polarising_begin
        return
 
 ;--------------------
-power_polarising_settling
+power_polarising_settling @
 ; idempotent
        tst_f_ifnz settling
        return
@@ -56,7 +56,7 @@ power_polarising_settling
        return
 
 ;--------------------
-power_polarising_tick
+power_polarising_tick @
        tst_f_ifnz settling
        dec_f_ifnz settling ; decrement if not zero
        return ; return if not dec'd, or if decrement didn't make zero
@@ -93,7 +93,7 @@ power_polarising_tick
 ;                              (uses tickdiv)  (uses tick)
 
 ;--------------------
-power_fault_init
+power_fault_init @
        bs_f    INTCON2, INTEDG1 ; rising edge
        bc_f    INTCON3, INT1IP
        bc_f    INTCON3, INT1IF
@@ -106,7 +106,7 @@ power_fault_init
        return
 
 ;--------------------
-command_power
+command_power @
        bra_nc  command_power_off
        ; command is ON:
 
@@ -137,7 +137,7 @@ power_off_now
        goto    cdu_off
 
 ;--------------------
-power_fault_intrl
+power_fault_intrl @
        bt_f_if0 INTCON3, INT1IF
        return
        ; we have a fault:
@@ -169,7 +169,7 @@ power_fault_stop
        intrl_handled_nostack
 
 ;--------------------
-power_fault_tick
+power_fault_tick @
        tst_f_ifnz retry_wait
        dec_f_ifnz retry_wait
        return
@@ -197,7 +197,7 @@ power_stop_doflash
        return
 
 ;--------------------
-power_fault_tickdiv
+power_fault_tickdiv @
        tst_f_ifnz stop_wait
        dec_f_ifnz stop_wait
        return
@@ -211,7 +211,7 @@ power_retry
        return
 
 ;--------------------
-power_panichook
+power_panichook @
        pin_vh  p0_booster_shutdown
        pin_vl  p0_booster_pwm
        pin_vh  p0_booster_userfault
diff --git a/detpic/energy.fin b/detpic/energy.fin
deleted file mode 100644 (file)
index 8a7d95a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-  extern command_power
-  extern power_polarising_init
-  extern power_polarising_tick
-  extern power_polarising_begin
-  extern power_polarising_settling
-  extern power_fault_init
-  extern power_fault_intrl
-  extern power_fault_tick
-  extern power_fault_tickdiv
-  extern power_panichook
index e28c80b95453d95b1bb5c1f2c52acd73b03439cf..debcb40c4571f81faba052884f9e342a2d747ca5 100644 (file)
@@ -1,18 +1,6 @@
   include ../iwjpictest/syncwrite.inc
-  include detect.inc
-  include energy.fin
   include i2clib+panic.inc
-  include mascan.fin
-  include misc.fin
-  include nmra-stream.fin
-  include panic.fin
-  include points.fin
-  include program.fin
-  include reverse.fin
-  include routines-led.fin
-  include serout.fin
-  include tick.fin
   include variables+vars.fin
-  include vectors.fin
+  include program+externs.fin
 
        end
index 777f3d9531f9a49ddb35f668fd169b613880057b..eb1bcdac1c02a0d0c301255d6efd5fba3cfcd4f7 100644 (file)
@@ -493,7 +493,7 @@ s_event_bad
 
 ;======================================================================
 
-  include panic.fin
+  include program+externs.fin
   include i2clib.inc
 
   end
diff --git a/detpic/make-externs b/detpic/make-externs
new file mode 100755 (executable)
index 0000000..008ba23
--- /dev/null
@@ -0,0 +1,4 @@
+#!/usr/bin/perl -n
+BEGIN { print "; autogenerated - do not edit\n;  @ARGV\n;\n\n" or die $!; }
+next unless m/^(\w+)\s+\@\s*(?:\;.*)?$/;
+printf "  extern %-40s ; %s\n", $1, $ARGV or die $!;
index 77a9edc77e4070dc394fef73a2bd206a8b2da3aa..ad3eb8dc9156415aff6c7f56c3e2f355911e0001 100644 (file)
@@ -26,7 +26,7 @@ outmsg_targetlen      res 1 ;
 
 near_getwritebyteyes code
 ;----------------------------------------
-i2c_getwritebyte_yes
+i2c_getwritebyte_yes @
        pop             ; we don't care where we were in i2cmu_write_next_byte
        bc_f    STATUS, Z       ; yes, we want to write this byte
        return          ; from i2cmu_write_next_byte
@@ -43,7 +43,7 @@ i2cmu_write_next_byte
        return
 
 ;----------------------------------------
-i2cm_intrl
+i2cm_intrl @
 ; handles i2c interrupt using i2cm_interrupt[_definite],
 ; according to the rules for <something>_intrl.
        bt_f_if0 PIR1, SSPIF
@@ -257,7 +257,7 @@ i2cmu_done
        bra     nextslave_nowrite
 
 ;----------------------------------------
-i2c_needwrite
+i2c_needwrite @
 ; Informs mascan that we need to write to some slave.
 ; Some time after this, mascan will call getwritebyte_<everything>
 ; and this must yield at least one byte to write.
@@ -276,7 +276,7 @@ arrange_write
        goto    i2cm_write_start
 
 ;----------------------------------------
-i2c_consider_restartread
+i2c_consider_restartread @
        bt_f_if0 cbyte, cbyte_halted
        return
        bra     nextslave_nowrite
@@ -284,7 +284,7 @@ i2c_consider_restartread
 ;======================================================================
 ; INITIALISATION
 
-mascan_init
+mascan_init @
        mov_lw  (slavetable + ste_flags + ste_size) & 0xff
                 ; start with 1st actual slave
        mov_wf  cslot
@@ -361,9 +361,9 @@ mascan_bad_toomany panic morse_DG
 
 near_gots code
 ;----------------------------------------
-process_got_extra
+process_got_extra @
        mov_fw  b
-loopback_read_byte
+loopback_read_byte @
 ;...
 ;  W           message
        xor_lw  0x00 ^ 0x20
diff --git a/detpic/mascan.fin b/detpic/mascan.fin
deleted file mode 100644 (file)
index d81342d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-  extern i2cm_intrl
-  extern mascan_init
-  extern loopback_read_byte
-  extern i2c_needwrite
-  extern i2c_consider_restartread
-  extern i2c_getwritebyte_yes
index fe6695a8d661a510d7bf3d3372f93b5ce9fa98f5..ad5769682d3f8b63e508b44bdc12cfffd96b2bc4 100644 (file)
@@ -7,7 +7,7 @@
 ; GENERALLY USEFUL ROUTINES
 
 ;----------
-read_pic_no
+read_pic_no @
 ; read pic no from ID locations and return it
 ;      W               undefined               pic number from ID loc 0
 ;      status Z        undefined               1 iff master PIC
@@ -23,7 +23,7 @@ read_pic_no
        return
 
 ;----------
-idlocs_init
+idlocs_init @
 ; read id locations and store in canonical place
 ;      W               undefined               undefined
 ;      picno           undefined               pic number (from 20000)
@@ -39,7 +39,7 @@ idlocs_init
        return
 
 ;----------
-bitnum2bit_init
+bitnum2bit_init @
 ; populate bitnum2bit
        mov_lw  0x80
        mov_lfsr bitnum2bit,0
diff --git a/detpic/misc.fin b/detpic/misc.fin
deleted file mode 100644 (file)
index b0ca143..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-  extern read_pic_no
-  extern idlocs_init
-  extern bitnum2bit_init
index 3d2e05299b0e5a019e503ad89a861e3b461d49ca..2a13bd1f0afc40ac536457abe8b058ac5128dcff 100644 (file)
@@ -97,7 +97,7 @@ waitfortsr
 
 ;****************************************************************************
 
-serial_init
+serial_init @
 ; serial set-up
 ; initial config - TXSTA register p181
         bc_fa     TXSTA,6      ; p181, set 8-bit mode
@@ -123,7 +123,7 @@ serial_init
 
 ;----------------------------------------------------------------------------
 
-nmra_init
+nmra_init @
 ; timer 0 set-up
 ; timer0 initial config for NMRA timer
 
@@ -172,7 +172,7 @@ nmra_init
        bs_fa   nmractrl,nextaction
        bs_fa   nmractrl,transmitbit
 
-nmra_restartmessage    ; Entrypoint from power_polarising_tick, at end
+nmra_restartmessage @  ; Entrypoint from power_polarising_tick, at end
                        ;  of settle time.  Goes back to beginning of
                        ;  current message (if any) and retransmits it.
                        ;  Also, enables booster PWM and Timer 0 interrupts.
@@ -207,7 +207,7 @@ nmra_restartmessage ; Entrypoint from power_polarising_tick, at end
 
 ;****************************************************************************
 
-nmra_serialrx_intrl
+nmra_serialrx_intrl @
        bt_f_if0 PIR1,RCIF      ; check whether serial recv interrupt bit set
        return
 
@@ -291,7 +291,7 @@ near_interrupt_high code
 master_interrupt_high_notnmra
        panic   morse_IH
 
-master_interrupt_high
+master_interrupt_high @
        bt_f_if0 INTCON,TMR0IF  ; check whether timer0 interrupt set
        bra     master_interrupt_high_notnmra
        ; timer0 interrupt
diff --git a/detpic/nmra-stream.fin b/detpic/nmra-stream.fin
deleted file mode 100644 (file)
index eeb8986..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-  extern nmra_init
-  extern serial_init
-  extern serial_interrupts_init
-  extern nmra_serialrx_intrl
-  extern nmra_restartmessage
index ec1721af2a2dc8fef539883c6531aa33d294e2c2..afc0e0139daa1a555fb68c40f2168b776ad165c0 100644 (file)
@@ -57,7 +57,7 @@ pan_ code
 ;****************************************************************************
 
 
-panic_routine
+panic_routine @
 ; switch off interrupts and power
 ; reconfigure timer0 for writing diagnostic msg to the LED
 
@@ -532,13 +532,13 @@ pan_i2csu_read_another
 
 near_gots code
 ;----------
-got_aargh
+got_aargh @
        panic   morse_T
 
 near_serialrx_table code 0x2100
 ;----------
-command_crashed
-panic_crashread_commanded
+command_crashed @
+panic_crashread_commanded @
        bs_f    panicst, panicst_acked ; since we were asked to
        panic   morse_E
 
diff --git a/detpic/panic.fin b/detpic/panic.fin
deleted file mode 100644 (file)
index 1f807e1..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-  extern panic_routine
-  extern panic_kill_hook
-  extern panic_crashread_setpointer
-  extern panic_crashread_commanded
-  extern i2csu_write_panicd
-  extern i2csu_read_begin_panicd
-  extern i2csu_read_another_panicd
-  extern command_crashed
-  extern got_aargh
index 196dadd0f80b1db577c8cfb8a547aec38f80e5b5..2c1fcf0893fba4eb0b6edff7b6ce7a75363f0b19 100644 (file)
@@ -47,7 +47,7 @@ slave2ptinfo_anypoints        equ     0
 
 near_local_do code
 ;----------------------------------------
-point_local_do
+point_local_do @
 ; On slave, called during i2c receive, ie High ISR
 ; On master, called during serial receive, ie Low ISR
 ;              W       fire point msg          undefined
@@ -70,7 +70,7 @@ point_clash
 
 points_section code
 ;----------------------------------------
-points_local_intrl
+points_local_intrl @
        bt_f_if0 PIR2, TMR3IF
        return
        ; OK, it's us, and we're done changing a point:
@@ -124,7 +124,7 @@ point_nonexistent
 ; LOCAL POINTS - INITIALISATION
 
 ;----------------------------------------
-points_local_init
+points_local_init @
 ; Initialises tables for points
 ; Clears TRIS* bits for all points and sets each pin to `not triggering'
 
@@ -253,7 +253,7 @@ point_timer_init_endif_masterslave
 ; MASTER
 
 ;----------------------------------------------------------------------
-points_master_init
+points_master_init @
        clr_f   pointslave
        clr_f   pointmsg
 
@@ -276,7 +276,7 @@ points_master_init_byte_loop
        return
 
 ;----------------------------------------------------------------------
-command_point
+command_point @
                                        ; FSR0 -> 1 0100 TTT  O TTTTTTT
                                        ; ie            1010 0SSS
                                        ;               OssT tttt
@@ -322,7 +322,7 @@ command_point_ifslave
        panic   morse_PS
 
 ;----------
-points_needwrite
+points_needwrite @
        rr_fw   pointslave              ; W =           000S SSss
        bt_f_if1 STATUS, Z ; nothing ?
        return
@@ -334,7 +334,7 @@ point_needwrite_yes
        goto    i2c_needwrite
 
 ;----------
-points_getwritebyte
+points_getwritebyte @
        rr_fw   pointslave
        xor_wfw cwslave
        bt_f_if0 STATUS, Z ; right slave ?
@@ -348,13 +348,13 @@ points_getwritebyte
 ; CDU
 
 ;--------------------
-cdu_init
+cdu_init @
        clr_f   pointslave
        clr_f   pointmsg
 ;...
 ;-----
-cdu_off
-cdu_panichook
+cdu_off @
+cdu_panichook @
        pin_l   p0_cdu_enable
 ;...
 ;-----
@@ -364,12 +364,12 @@ cdu_discharged
        return
 
 ;--------------------
-cdu_on
+cdu_on @
        pin_h   p0_cdu_enable
        return
 
 ;--------------------
-cdu_tickdiv
+cdu_tickdiv @
        pinlat_ifl p0_cdu_enable
        return
 
@@ -384,7 +384,7 @@ cdu_tickdiv
 
 near_gots code
 ;--------------------
-got_pointed
+got_pointed @
        tst_f_ifnz cducharging
        bra     pointed_already_charging
 
diff --git a/detpic/points.fin b/detpic/points.fin
deleted file mode 100644 (file)
index 5200239..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-  extern command_point
-  extern points_master_init
-  extern point_local_do
-  extern points_local_init
-  extern points_local_intrl
-  extern points_needwrite
-  extern points_getwritebyte
-  extern got_pointed
-  extern cdu_init
-  extern cdu_tickdiv
-  extern cdu_on
-  extern cdu_off
-  extern cdu_panichook
index c83bc2a12b7b46e52e2dcc104bbe6b111aff17aa..860bf63083998288f9acb9062d1513d2300a5ac7 100644 (file)
@@ -8,7 +8,7 @@
 ; COMMON TO MASTER AND SLAVE
 
 ;----------------------------------------
-vector_reset
+vector_reset @
 
  set_f qqTRISA
  set_f qqTRISB
@@ -55,13 +55,13 @@ common_local_init
        return
 
 ;----------------------------------------
-panic_kill_hook
+panic_kill_hook @
        call    power_panichook
        call    cdu_panichook
        return
 
 ;----------
-intrl_handled_routine
+intrl_handled_routine @
        mov_ff  isr_low_save_stkptr, STKPTR
        intrl_handled_core
 
@@ -86,7 +86,7 @@ master_init
        return
 
 ;----------------------------------------
-master_interrupt_low
+master_interrupt_low @
        enter_interrupt_low
  mov_ff INTCON, xdebug+0
  mov_ff INTCON2, xdebug+1
@@ -107,7 +107,7 @@ master_interrupt_low
 serialrx_table_section code    0x2000
 
 ;--------------------
-serialrx_generalmsg
+serialrx_generalmsg @
 ;command_<something>  has same calling convention:
 ;
 ;  FSR0 ->     start of message                undefined
@@ -186,7 +186,7 @@ slave_init
        return
 
 ;----------------------------------------
-slave_interrupt_low
+slave_interrupt_low @
        enter_interrupt_low
        call    points_local_intrl
        panic   morse_IL
@@ -220,7 +220,7 @@ code3 code
 ; MASTER/SLAVE deviations
 
 ;----------
-message_for_master
+message_for_master @
 ; Either transmits the message to the master, or if we are the master,
 ; handles it as an incoming message from the notional `slave 0'.
 ;  W           message         unchanged
diff --git a/detpic/program.fin b/detpic/program.fin
deleted file mode 100644 (file)
index 039d81f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-  extern serialrx_generalmsg
-  extern message_for_master
-  extern master_interrupt_high_notnmra
index 227742a225e203cfade5a0ffed7b40966dcfd4ac..13eaa3eaa98790e0e88ad93e21d4baee8dbe1018 100644 (file)
@@ -28,7 +28,7 @@ polarity_cmds_section udata polarity_cmds
 
 near_local_do code
 ;----------
-polarity_local_do
+polarity_local_do @
 ; On slave, called during i2c receive, ie High ISR
 ; On master, called during serial receive, ie Low ISR
 ; See common.inc !
@@ -69,7 +69,7 @@ polarity_local_do
 
   code
 ;----------
-polarity_local_init
+polarity_local_init @
        load_perpic_tblptr picno2revmasks, 2
 
        tblrd_postinc_fixup
@@ -95,7 +95,7 @@ polarity_local_init
 ; MASTER
 
 ;----------
-command_polarity
+command_polarity @
 ; message format
 ;              SS zz zz SS  ZZ 2f 2e 2d        g is board 2
 ;              MM 2c 0f 0e  0d 0c 0b 0a        board 0
@@ -174,7 +174,7 @@ board_next_none_more_message
        panic   morse_RL
 
 ;----------------------------------------------------------------------
-polarity_master_init
+polarity_master_init @
 
        load_tblptr picno2revmasks
        mov_lfsr polarity_cmds - 1, 0
@@ -221,7 +221,7 @@ polarity_bad_masternotused panic morse_RF
 polarity_bad_lastpicused panic morse_RG
 
 ;----------------------------------------------------------------------
-polarity_needwrite
+polarity_needwrite @
 ;  needwrite_<something> will see if we need to talk to a slave
 ;    if not it will simply return
 ;    if we _do_, it will put the slave no. in W, and then pop
@@ -250,7 +250,7 @@ polarity_needwrite_found
 
 near_getwritebyteyes code
 ;----------------------------------------------------------------------
-polarity_getwritebyte
+polarity_getwritebyte @
 ;  getwritebyte_<something> finds a byte to write to a particular
 ;   slave.  If we have something to write, puts the byte in W
 ;   and does `goto getwritebyte_yes'.  Otherwise simply returns.
diff --git a/detpic/reverse.fin b/detpic/reverse.fin
deleted file mode 100644 (file)
index 2b9bb45..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-  extern command_polarity
-  extern polarity_local_do
-  extern polarity_local_init
-  extern polarity_master_init
-  extern polarity_needwrite
-  extern polarity_getwritebyte
index 35621bfa79919c2cd529ae8bcb79d6d89da5e3ae..1586cab8d20dc793f525f254bf450ff70b429f20 100644 (file)
@@ -7,7 +7,7 @@
        code
 
 ;----------------------------------------
-led_red
+led_red @
 ; makes the LED be red (or orange), no matter its previous state
 ; no RAM locations used or modified
 ; W is unchanged
@@ -16,7 +16,7 @@ led_red
        return
 
 ;----------------------------------------
-led_green
+led_green @
 ; makes the LED be green (or blue), no matter its previous state
 ; no RAM locations used or modified
 ; W is unchanged
@@ -25,7 +25,7 @@ led_green
        return
 
 ;----------------------------------------
-led_black
+led_black @
 ; makes the LED be black (off), no matter its previous state
 ; no RAM locations used or modified
 ; W is unchanged
diff --git a/detpic/routines-led.fin b/detpic/routines-led.fin
deleted file mode 100644 (file)
index d294b25..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-       extern  led_green
-       extern  led_red
-       extern  led_black
index e0835c4b868d353dced83c071c2530eda429319a..48b5081423a70d2a930fd84ef59e041ffc12372c 100644 (file)
@@ -11,7 +11,7 @@
 addbyte_toomany panic morse_HB
 
 ;----------------------------------------
-serial_addbyte
+serial_addbyte @
 ;  W                   byte to xmit to host    trashed
 ;  FSR0                        any                     set for serial_addbyte_another
 ;  outbuf, outmsg_*    buffer not full         adjusted appropriately
@@ -22,7 +22,7 @@ serial_addbyte
        mov_ff  outmsg_end, FSR0L
 ;...
 ;----------------------------------------
-serial_addbyte_another
+serial_addbyte_another @
 ;  W                   byte to xmit to host    trashed
 ;  FSR0                        from _addbyte[_another] updated for ..._another again
 ;  outbuf, outmsg_*    buffer not full         adjusted appropriately
@@ -47,7 +47,7 @@ serial_addbyte_another
 
 ;...
 ;----------------------------------------
-portb_read
+portb_read @
 ;
 ;  W                   undefined       value from PORTB
 ;  TXIE                        any             enabled iff host allows us to xmit
@@ -73,7 +73,7 @@ txfc_disable
        goto    led_red ; flow control forces us not to transmit
 
 ;----------------------------------------------------------------------
-serialtxfc_intrl
+serialtxfc_intrl @
        bt_f_if0 INTCON, RBIF
        return
        ; yes, it's us:
@@ -82,7 +82,7 @@ serialtxfc_intrl
        intrl_handled_nostack
 
 ;----------------------------------------------------------------------
-serialtxfc_init
+serialtxfc_init @
        bc_f    INTCON2, RBIP
        bs_f    INTCON, RBIE
        rcall   portb_read
@@ -93,7 +93,7 @@ serialtxfc_init
 ; ACTUAL TRANSMISSION
 
 ;----------------------------------------------------------------------
-serialtx_intrl
+serialtx_intrl @
        ; are we ready to transmit ?
        bt_f_if0 PIR1, TXIF
        return
@@ -145,7 +145,7 @@ tx_bufempty
        intrl_handled_nostack
 
 ;----------------------------------------------------------------------
-serialtxbuf_init
+serialtxbuf_init @
        clr_f   outmsg_end
        clr_f   outmsg_begin
        mov_lw  b'00001001'
diff --git a/detpic/serout.fin b/detpic/serout.fin
deleted file mode 100644 (file)
index f3a3546..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-  extern serial_addbyte
-  extern serial_addbyte_another
-  extern serialtx_intrl
-  extern serialtxfc_intrl
-  extern serialtxfc_init
-  extern serialtxbuf_init
-  extern portb_read
index 00ac3802a450c973f0c6b6edd135a1ded2f9c397..56ff9ae18d5400f4991925145021ac87c5f389bf 100644 (file)
@@ -11,7 +11,7 @@ tickdiv_count res     1
 
   code
 ;----------------------------------------
-tick_init
+tick_init @
 ;  Timer 2             any                     used for tick
        mov_lw  tick_master_t2scale ; disable (in case already running)
        mov_wf  T2CON
@@ -26,7 +26,7 @@ tick_init
        return
 
 ;----------------------------------------
-tick_intrl
+tick_intrl @
        bt_f_if0 PIR1, TMR2IF
        return
        ; we have an interrupt
diff --git a/detpic/tick.fin b/detpic/tick.fin
deleted file mode 100644 (file)
index a0013e4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-  extern tick_init
-  extern tick_intrl
diff --git a/detpic/vectors.fin b/detpic/vectors.fin
deleted file mode 100644 (file)
index e7345c8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-  extern vector_reset
-  extern master_interrupt_low
-  extern master_interrupt_high
-  extern slave_interrupt_low