chiark / gitweb /
use timer3 initialisation values from make-clocks
authorian <ian>
Mon, 19 Dec 2005 02:47:53 +0000 (02:47 +0000)
committerian <ian>
Mon, 19 Dec 2005 02:47:53 +0000 (02:47 +0000)
detpic/points.asm

index c4bf89a725f5527fa8d1a220e61e7a2df6edc442..e5dfe1611b2847d4d5086534e6f95c564ffdfa35 100644 (file)
@@ -18,9 +18,6 @@ ptix2bitlat_section udata ptix2bitlat
  udata_acs
 pointmsg               res     1
 
-pt_timer13_prescale equ 0
-pt_timer13_inithigh equ 0
-
 ;======================================================================
  code
 
@@ -42,7 +39,7 @@ point_local_do
        mov_wf  pointmsg        ; pointmsg = SS zz zz pp  pp pp pp pp
        rcall   point_set_pin
 
-       set_f   TMR3L           ; also copies TMR3H into actual timer register
+       clr_f   TMR3L           ; also copies TMR3H into actual timer register
        bs_f    T3CON, TMR3ON
        panic   morse_UP
        return
@@ -230,13 +227,24 @@ point_initing_bad_point
 
 ;----------
 point_timer_init
-       mov_lw  (1<<RD16) | (1<<T3ECCP1) | pt_timer13_prescale ; Fcy; !TMR3ON
+       bt_f_if1 idloc1,idloc1_master
+       bra     point_timer_init_if_master
+       ; slave:
+       mov_lw  (1<<RD16)|(1<<T3ECCP1)| points_slave_t3scale; Fcy;!TMR3ON
+       mov_wf  T3CON
+       mov_lw  points_slave_t3inith
+       bra     point_timer_init_endif_masterslave
+point_timer_init_if_master
+       mov_lw  (1<<RD16)|(1<<T3ECCP1)| points_master_t3scale; Fcy;!TMR3ON
        mov_wf  T3CON
+       mov_lw  points_master_t3inith
+point_timer_init_endif_masterslave
+       mov_wf  TMR3H   ; We just leave this here.
+                       ; Since we never read TMR3L, it is never overwritten
+
        bc_f    PIR2, TMR3IF
        bs_f    PIE2, TMR3IE
        bc_f    IPR2, TMR3IP
-       mov_lw  pt_timer13_inithigh
-       mov_wf  TMR3H ; we just leave this here, since we never read TMR3L
        return
 
 ;======================================================================