comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 784:46ef1e1388f1

Merge
author heinrichsweikamp
date Mon, 23 Jun 2014 17:29:59 +0200
parents de7fa2316913
children 53425d598585
comparison
equal deleted inserted replaced
783:e57e8045527d 784:46ef1e1388f1
50 btfsc FLAG_apnoe_mode 50 btfsc FLAG_apnoe_mode
51 bra diveloop_loop ; Skip in apnoe mode 51 bra diveloop_loop ; Skip in apnoe mode
52 52
53 ; Startup Tasks for deco modes 53 ; Startup Tasks for deco modes
54 call DISP_display_ndl_mask ; display "no stop" if not in gauge or apnoe mode 54 call DISP_display_ndl_mask ; display "no stop" if not in gauge or apnoe mode
55 GETCUSTOM8 d'55'
56 movwf apnoe_surface_mins
57 clrf apnoe_surface_secs
55 58
56 btfss FLAG_const_ppO2_mode ; only in const_ppO2_mode 59 btfss FLAG_const_ppO2_mode ; only in const_ppO2_mode
57 bra diveloop_loop ; OC modes, skip 60 bra diveloop_loop ; OC modes, skip
58 bsf setpoint_changed ; Add a setpoint change to the first depth sample in CC mode 61 bsf setpoint_changed ; Add a setpoint change to the first depth sample in CC mode
59 bsf event_occured ; set global event flag 62 bsf event_occured ; set global event flag
81 btfsc premenu ; Is the divemode menu active? 84 btfsc premenu ; Is the divemode menu active?
82 bra diveloop_loop1z ; Yes 85 bra diveloop_loop1z ; Yes
83 call DISP_divemins ; Display (new) divetime! 86 call DISP_divemins ; Display (new) divetime!
84 diveloop_loop1z: 87 diveloop_loop1z:
85 bcf update_divetime ; clear flag 88 bcf update_divetime ; clear flag
89
90 call DISP_show_gas_change_countdown ; Show the gas change countdown (If required)
86 91
87 btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode 92 btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode
88 bra diveloop_loop1c ; One Second Tasks in const_ppO2 mode 93 bra diveloop_loop1c ; One Second Tasks in const_ppO2 mode
89 94
90 ; Tasks only for OC modes 95 ; Tasks only for OC modes
1905 bra set_powersafe1 ; Still to low 1910 bra set_powersafe1 ; Still to low
1906 bcf low_battery_state ; clear flag for battery warning mode 1911 bcf low_battery_state ; clear flag for battery warning mode
1907 return 1912 return
1908 1913
1909 calc_average_depth: 1914 calc_average_depth:
1910 btfsc reset_average_depth ; Reset the Avewrage depth? 1915 btfsc reset_average_depth ; Reset the Average depth?
1911 rcall reset_average1 ; Reset the resettable average depth 1916 rcall reset_average1 ; Reset the resettable average depth
1912 1917
1913 ; 1. Add new 2xdepth to the Sum of depths registers 1918 ; 1. Add new 2xdepth to the Sum of depths registers
1914 SAFE_2BYTE_COPY rel_pressure, b0_lo ; Buffer... 1919 SAFE_2BYTE_COPY rel_pressure, b0_lo ; Buffer...
1915 1920
2012 2017
2013 movlw d'1' 2018 movlw d'1'
2014 movwf apnoe_max_pressure+0 2019 movwf apnoe_max_pressure+0
2015 clrf apnoe_max_pressure+1 2020 clrf apnoe_max_pressure+1
2016 clrf apnoe_surface_mins 2021 clrf apnoe_surface_mins
2017 clrf apnoe_surface_secs
2018 clrf apnoe_mins 2022 clrf apnoe_mins
2019 clrf apnoe_secs 2023 clrf apnoe_secs
2020 clrf divemins+0 2024 clrf divemins+0
2021 clrf divemins+1 2025 clrf divemins+1
2022 clrf total_divetime_seconds+0 2026 clrf total_divetime_seconds+0
2055 bcf is_bailout ;=1: CC mode, but bailout active! 2059 bcf is_bailout ;=1: CC mode, but bailout active!
2056 bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode 2060 bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode
2057 bcf tts_extra_time ;=1: Compute TTS if extra time spent at current depth 2061 bcf tts_extra_time ;=1: Compute TTS if extra time spent at current depth
2058 bcf show_safety_stop ;=1: Show the safety stop 2062 bcf show_safety_stop ;=1: Show the safety stop
2059 clrf safety_stop_countdown ; Clear count-down 2063 clrf safety_stop_countdown ; Clear count-down
2064 bcf gaschange_cnt_active ; Do not show the countdown on start
2060 2065
2061 call get_free_EEPROM_location ; get last position in external EEPROM, may be up to 2 secs! 2066 call get_free_EEPROM_location ; get last position in external EEPROM, may be up to 2 secs!
2062 2067
2063 btfsc simulatormode_active 2068 btfsc simulatormode_active
2064 bra diveloop_boot_1 2069 bra diveloop_boot_1