comparison src/isr.asm @ 631:185ba2f91f59

3.09 beta 1 release
author heinrichsweikamp
date Fri, 28 Feb 2020 15:45:07 +0100
parents 237931377539
children 4050675965ea
comparison
equal deleted inserted replaced
630:4cd81bdbf15c 631:185ba2f91f59
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File isr.asm combined next generation V3.06.2 3 ; File isr.asm combined next generation V3.08.8
4 ; 4 ;
5 ; INTERUPT subroutines 5 ; INTERUPT subroutines
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
608 btfsc simulatormode ; YES - in simulator mode? 608 btfsc simulatormode ; YES - in simulator mode?
609 rcall inc_surface_interval_secs ; NO - YES - increment the surface interval (seconds timer) 609 rcall inc_surface_interval_secs ; NO - YES - increment the surface interval (seconds timer)
610 610
611 ; reset the surface interval timers if requested 611 ; reset the surface interval timers if requested
612 btfsc reset_surface_interval ; shall reset both surface interval timers? 612 btfsc reset_surface_interval ; shall reset both surface interval timers?
613 call clr_surface_interval ; YES 613 call rst_surface_interval ; YES
614 614
615 ; reset the timebase if requested 615 ; reset the timebase if requested
616 btfss reset_timebase ; shall reset the timebase? 616 btfss reset_timebase ; shall reset the timebase?
617 bra isr_rtcc_3 ; NO 617 bra isr_rtcc_3 ; NO
618 bcf reset_timebase ; YES - clear request flag 618 bcf reset_timebase ; YES - clear request flag
714 ; MOVLI .55556,isr_mpr ; 0.2 Ah / 3600 seconds per hour * 1e9s = nAs 714 ; MOVLI .55556,isr_mpr ; 0.2 Ah / 3600 seconds per hour * 1e9s = nAs
715 ; 715 ;
716 ; Remark: although all the constants are named current_xxxx, in reality they mean charge! 716 ; Remark: although all the constants are named current_xxxx, in reality they mean charge!
717 717
718 ; Calculate current consumption for LED backlight: 47*CCPR1L+272 (according to values in hwos.inc: 115*CCPR1L+216) 718 ; Calculate current consumption for LED backlight: 47*CCPR1L+272 (according to values in hwos.inc: 115*CCPR1L+216)
719 movf CCPR1L,W ; get CCPR1L into WREG 719 movlw .70 ; screen type 3 has a fix backlight current slope
720 mullw current_backlight_multi ; PRODH:PRODL = k * WREG = current_backlight_multi * CCPR1L 720 btfss screen_type3 ; does the OSTC have a screen type 3 ?
721 ADDLI current_backlight_offset,PRODL ; PRODH:PRODL += current_backlight_offset 721 movf CCPR1L,W ; NO - for screen types 0, 1 and 2 get the slope from CCPR1L
722 mullw current_backlight_multi ; multiply with backlight factor current_backlight_multi
723 ADDLI current_backlight_offset,PRODL ; add backlight offset current_backlight_offset
722 MOVII PRODL,isr_mpr ; copy result to isr_mpr 724 MOVII PRODL,isr_mpr ; copy result to isr_mpr
723 725
724 ; Add current for CPU and GPU 726 ; Add current for CPU and GPU
725 ; cpu_speed_state = ECO 3.10 mA -> 861 nAs 727 ; cpu_speed_state = ECO 3.10 mA -> 861 nAs
726 ; = NORMAL 5.50 mA -> 1528 nAs 728 ; = NORMAL 5.50 mA -> 1528 nAs
934 iorwf isr_lo,W ; inclusive-or low & high byte, desaturation time = 0 ? 936 iorwf isr_lo,W ; inclusive-or low & high byte, desaturation time = 0 ?
935 bz clr_surface_interval_mins ; YES - reset surface interval minutes counter 937 bz clr_surface_interval_mins ; YES - reset surface interval minutes counter
936 INCI surface_interval_mins ; NO - increment surface interval 938 INCI surface_interval_mins ; NO - increment surface interval
937 return ; - done 939 return ; - done
938 940
939 clr_surface_interval: 941 rst_surface_interval:
940 bcf reset_surface_interval ; reset request flag 942 bcf reset_surface_interval ; reset request flag
941 ; clear the surface interval counted in seconds 943 ; reset the surface interval counted in seconds
942 clrf surface_interval_secs+0 ; reset surface interval (seconds), lowest byte 944 clrf surface_interval_secs+0 ; reset surface interval (seconds), lowest byte
943 clrf surface_interval_secs+1 ; ... 945 clrf surface_interval_secs+1 ; ...
944 clrf surface_interval_secs+2 ; ... 946 clrf surface_interval_secs+2 ; ...
945 clrf surface_interval_secs+3 ; reset surface interval (seconds), highest byte 947 clrf surface_interval_secs+3 ; reset surface interval (seconds), highest byte
946 clr_surface_interval_mins: 948 ; reset the surface interval counted in minutes
947 ; clear the surface interval counted in minutes
948 movff opt_diveTimeout,surface_interval_mins+0 ; set surface interval (minutes), low byte, to dive timeout offset 949 movff opt_diveTimeout,surface_interval_mins+0 ; set surface interval (minutes), low byte, to dive timeout offset
949 clrf surface_interval_mins+1 ; reset surface interval (minutes), high byte 950 clrf surface_interval_mins+1 ; reset surface interval (minutes), high byte
950
951 return ; done 951 return ; done
952 952
953 clr_surface_interval_mins:
954 clrf surface_interval_mins+0 ; reset surface interval (minutes), low byte
955 clrf surface_interval_mins+1 ; reset surface interval (minutes), high byte
956 return ; done
957
958
953 ;============================================================================= 959 ;=============================================================================
954 960
955 END 961 END