comparison src/divemode.asm @ 513:3f6d5cf91f64

minor
author heinrichsweikamp
date Tue, 11 Jul 2017 14:34:56 +0200
parents 4e6f5c36f4cc
children 2ef8cf6b320d
comparison
equal deleted inserted replaced
512:f9cc49750736 513:3f6d5cf91f64
82 82
83 diveloop_loop1b: 83 diveloop_loop1b:
84 ; Tasks only for Apnoe mode 84 ; Tasks only for Apnoe mode
85 rcall divemode_apnoe_tasks ; 1 sec. Apnoe tasks 85 rcall divemode_apnoe_tasks ; 1 sec. Apnoe tasks
86 call customview_second ; Do every-second tasks for the custom view area 86 call customview_second ; Do every-second tasks for the custom view area
87 bra diveloop_loop1x ; Common Tasks 87 ; bra diveloop_loop1x ; Common Tasks
88 88
89 diveloop_loop1x: 89 diveloop_loop1x:
90 ; Common 1sec. tasks for all modes 90 ; Common 1sec. tasks for all modes
91 rcall timeout_divemode ; dive finished? This routine sets the required flags 91 rcall timeout_divemode ; dive finished? This routine sets the required flags
92 rcall set_dive_modes ; tests if depth>threshold 92 rcall set_dive_modes ; tests if depth>threshold
942 dcfsnz WREG,F 942 dcfsnz WREG,F
943 bra divemode_option6 ; +5mins simulation 943 bra divemode_option6 ; +5mins simulation
944 dcfsnz WREG,F 944 dcfsnz WREG,F
945 bra divemode_option7 ; Store heading 945 bra divemode_option7 ; Store heading
946 return 946 return
947
948 ;test_switches_divemode2:
949 ; goto menuview_toggle ; Menu or Simulator tasks; and return...
950 ; return
951 947
952 gas_switched_common: 948 gas_switched_common:
953 bcf divemode_gaschange ; Clear flag 949 bcf divemode_gaschange ; Clear flag
954 950
955 tstfsz menupos ; menupos=0? 951 tstfsz menupos ; menupos=0?
1481 call divemode_setup_sensor_values ; setup sensor values 1477 call divemode_setup_sensor_values ; setup sensor values
1482 1478
1483 ; Setup first SP for Fixed or Auto mode 1479 ; Setup first SP for Fixed or Auto mode
1484 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP 1480 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP
1485 sublw .1 ; opt_ccr_mode = 1 (Sensor)? 1481 sublw .1 ; opt_ccr_mode = 1 (Sensor)?
1482 bnz dive_boot_cc2 ; No, Skip
1486 movff char_I_setpoint_cbar+0,char_I_const_ppO2 ; No, setup fixed Setpoint (Always start with SP1) 1483 movff char_I_setpoint_cbar+0,char_I_const_ppO2 ; No, setup fixed Setpoint (Always start with SP1)
1487 movff char_I_const_ppO2,WREG 1484 movff char_I_const_ppO2,WREG
1485 dive_boot_cc2:
1488 call transmit_setpoint ; Transmit current setpoint from WREG (in cbar) to external electronics 1486 call transmit_setpoint ; Transmit current setpoint from WREG (in cbar) to external electronics
1489 bsf setpoint_changed ; Set flag (For profile) 1487 bsf setpoint_changed ; Set flag (For profile)
1490 bcf sp2_switched ; =1: This setpoint has been autoselected already 1488 bcf sp2_switched ; =1: This setpoint has been autoselected already
1491 bcf sp3_switched ; =1: This setpoint has been autoselected already 1489 bcf sp3_switched ; =1: This setpoint has been autoselected already
1492 bcf sp4_switched ; =1: This setpoint has been autoselected already 1490 bcf sp4_switched ; =1: This setpoint has been autoselected already
1558 movff opt_OC_bail_gas_change+1,opt_OC_bail_gas_change_backup+1 ; Gas change depths OC/Bailout 1556 movff opt_OC_bail_gas_change+1,opt_OC_bail_gas_change_backup+1 ; Gas change depths OC/Bailout
1559 movff opt_OC_bail_gas_change+2,opt_OC_bail_gas_change_backup+2 ; Gas change depths OC/Bailout 1557 movff opt_OC_bail_gas_change+2,opt_OC_bail_gas_change_backup+2 ; Gas change depths OC/Bailout
1560 movff opt_OC_bail_gas_change+3,opt_OC_bail_gas_change_backup+3 ; Gas change depths OC/Bailout 1558 movff opt_OC_bail_gas_change+3,opt_OC_bail_gas_change_backup+3 ; Gas change depths OC/Bailout
1561 movff opt_OC_bail_gas_change+4,opt_OC_bail_gas_change_backup+4 ; Gas change depths OC/Bailout 1559 movff opt_OC_bail_gas_change+4,opt_OC_bail_gas_change_backup+4 ; Gas change depths OC/Bailout
1562 1560
1563 bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode
1564 clrf better_gas_number ; Clear better gas register 1561 clrf better_gas_number ; Clear better gas register
1565 1562
1566 bcf show_safety_stop ;=1: Show the safety stop 1563 bcf show_safety_stop ;=1: Show the safety stop
1567 clrf safety_stop_countdown ; Clear count-down 1564 clrf safety_stop_countdown ; Clear count-down
1568 1565
1731 cpfseq menupos3 ; battery shown in Custom View 4? 1728 cpfseq menupos3 ; battery shown in Custom View 4?
1732 bra check_warn_battery2 ; No 1729 bra check_warn_battery2 ; No
1733 return ; Yes, do not show twice (in custom view and in warning area) 1730 return ; Yes, do not show twice (in custom view and in warning area)
1734 check_warn_battery2: 1731 check_warn_battery2:
1735 incf warning_counter,F ; increase counter 1732 incf warning_counter,F ; increase counter
1736 call TFT_update_batt_percent_divemode ; Show percent 1733 goto TFT_update_batt_percent_divemode ; Show percent (And return)
1737 return 1734
1738
1739 check_divetimeout: 1735 check_divetimeout:
1740 btfsc divemode2 1736 btfsc divemode2
1741 return ; displayed divetime is not running 1737 return ; displayed divetime is not running
1742 incf warning_counter,F ; increase counter 1738 incf warning_counter,F ; increase counter
1743 goto TFT_divetimeout ; Show timeout counter (and return) 1739 goto TFT_divetimeout ; Show timeout counter (and return)