annotate src/divemenu_tree.asm @ 630:4cd81bdbf15c

3.08 stable release
author heinrichsweikamp
date Fri, 21 Feb 2020 10:51:36 +0100
parents c40025d8e750
children 185ba2f91f59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
3 ; File divemenu_tree.asm combined next generation V3.03.4
0
heinrichsweikamp
parents:
diff changeset
4 ;
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 249
diff changeset
5 ; OSTC dive mode menu
0
heinrichsweikamp
parents:
diff changeset
6 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all rights reserved.
0
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2013-02-02 : [mH] Made out of menu_tree.asm
heinrichsweikamp
parents:
diff changeset
11
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
12 #include "hwos.inc" ; Mandatory header
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
13 #include "menu_processor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
14 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
15 #include "tft_outputs.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
16 #include "customview.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
17 #include "strings.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
18 #include "calibrate.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
19
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
20 extern timeout_divemode_menu2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
21 extern restart_deco_engine_wo_ceiling
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
22 extern diveloop_menu_exit
0
heinrichsweikamp
parents:
diff changeset
23
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
24
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
25 dmenu_tree CODE
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
26
0
heinrichsweikamp
parents:
diff changeset
27 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
28 ; Main Menu
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
29
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
30 do_return_main_divemenu:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
31 call menu_processor_double_pop ; drop exit line and back to last line
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
32 incf selected_item,W ; item numbers start with 0, menu positions with 1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
33 movwf menu_pos_cur ; position cursor where we came from
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
34 bra do_main_divemenu_common
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
35
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
36 global do_main_divemenu
0
heinrichsweikamp
parents:
diff changeset
37 do_main_divemenu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
38 call menu_processor_reset ; restart from first icon
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
39 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
40 movwf menu_pos_cur ; set to first option in dive mode menu
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
41
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
42 do_main_divemenu_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
43 IFDEF _ccr_pscr
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
44 btfsc FLAG_ccr_mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
45 bra main_divemenu_loop ; goto CCR / pSCR Menu menu
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
46 btfsc FLAG_pscr_mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
47 bra main_divemenu_loop ; goto CCR / pSCR Menu menu
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
48 ENDIF
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
49
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
50 main_divemenu_OC:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
51 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
52 bcf is_diluent_menu ; selecting OC gases ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
53 bcf is_bailout_menu ; ... not for bailout reason
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
54 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
55
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
56 IFDEF _cave_mode
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
57 btfss cave_mode ; in cave mode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
58 bra main_divemenu_OC_no_cave ; NO - do OC menu without turn option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
59
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
60 MENU_BEGIN tMainMenu, .6
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
61 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
62 MENU_CALL tDivemenu_ResetAvg, do_reset_average
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
63 MENU_DYNAMIC do_toggle_gf_label, do_toggle_gf
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
64 MENU_CALL tDivemenu_Marker, do_set_marker
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
65 MENU_DYNAMIC do_turn_dive_label, do_turn_dive
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
66 MENU_CALL tExit, do_exit_divemode_menu
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
67 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
68 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
69
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
70 main_divemenu_OC_no_cave:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
71 MENU_BEGIN tMainMenu, .5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
72 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
73 MENU_CALL tDivemenu_ResetAvg, do_reset_average
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
74 MENU_DYNAMIC do_toggle_gf_label, do_toggle_gf
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
75 MENU_CALL tDivemenu_Marker, do_set_marker
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
76 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
77 MENU_END
0
heinrichsweikamp
parents:
diff changeset
78
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
79 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
80
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
81 IFDEF _ccr_pscr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
82
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
83 main_divemenu_loop:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
84 bsf is_diluent_menu ; selecting diluents ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
85 bcf is_bailout_menu ; ... (definitely) not for bailout reason
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
86 btfsc FLAG_pscr_mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
87 bra main_divemenu_pscr ; pSCR menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
88
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
89 MENU_BEGIN tMainMenu, .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
90 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
91 MENU_CALL tDivemenu_Setpoint, do_divemode_splist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
92 MENU_CALL tDivemenu_Diluent, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
93 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
94 MENU_DYNAMIC do_toggle_gf_label, do_toggle_gf
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
95 MENU_CALL tExit, do_exit_divemode_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
96 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
97
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
98
485
18e047102e49 3.14 BETA release
heinrichsweikamp
parents: 437
diff changeset
99 main_divemenu_pscr:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
100
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
101 IFDEF _external_sensor
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
102 btfsc analog_o2_input ; do we have an analog input (OSTC cR)?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
103 bra main_divemenu_pscr_sensors ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
104 btfsc optical_input ; do we have an optical input (OSTC 3)?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
105 bra main_divemenu_pscr_sensors ; YES
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
106 ENDIF
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
107
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
108 main_divemenu_pscr_no_sensors:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
109 MENU_BEGIN tMainMenu, .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
110 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
111 MENU_CALL tDivemenu_Premix, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
112 MENU_CALL tBackToLoop, do_switch_sp_calc
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
113 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
114 MENU_DYNAMIC do_toggle_gf_label, do_toggle_gf
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
115 MENU_CALL tExit, do_exit_divemode_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
116 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
117
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
118
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
119 IFDEF _external_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
120 main_divemenu_pscr_sensors:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
121 MENU_BEGIN tMainMenu, .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
122 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
123 MENU_CALL tCCRSensor, do_divemode_setpoint_pscr
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
124 MENU_CALL tDivemenu_Premix, do_divemode_gaslist
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
125 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
126 MENU_DYNAMIC do_toggle_gf_label, do_toggle_gf
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
127 MENU_CALL tExit, do_exit_divemode_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
128 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
129 ENDIF ; _external_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
130
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
131 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
132
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
133 ;=============================================================================
0
heinrichsweikamp
parents:
diff changeset
134
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
135 do_toggle_gf:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
136 TSTOSS char_I_deco_model ; toggle GF only in GF modes - in GF mode? (0 = ZH-L16, 1 = ZH-L16-GF)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
137 bra do_main_divemenu_common ; NO - do nothing and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
138 TSTOSS opt_enable_aGF ; =1: aGF can be selected underwater
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
139 bra do_main_divemenu_common ; NO - do nothing and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
140 movlw index_gf_factors-1 ; custom view number one below GF factors
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
141 movwf active_customview ; set custom view number
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
142 bsf request_next_custview ; initiate toggle to desired custom view -> GF factors
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
143 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
144 movwf menu_pos_cur ; set to first option in dive mode menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
145
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
146 MENU_BEGIN tDivemenu_ToggleGF, .2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
147 MENU_CALL tDivemenu_ToggleGF, do_togglegf
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
148 MENU_CALL tBack, do_return_main_divemenu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
149 MENU_END
0
heinrichsweikamp
parents:
diff changeset
150
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
151 do_togglegf:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
152 bsf request_toggle_GF ; set request flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
153 bra do_exit_divemode_menu ; continue with exiting menu code
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
154
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
155
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
156 do_reset_avg_set_mkr:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
157 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
158 movwf menu_pos_cur ; set to first option in dive mode menu
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
159
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
160 IFDEF _cave_mode
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
161 btfss cave_mode ; in cave mode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
162 bra do_reset_average_no_cave ; NO - do menu without turn option
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
163
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
164 MENU_BEGIN tDivemenu_Avg_Mkr, .4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
165 MENU_CALL tDivemenu_ResetAvg, do_reset_average
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
166 MENU_CALL tDivemenu_Marker, do_set_marker
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
167 MENU_DYNAMIC do_turn_dive_label, do_turn_dive
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
168 MENU_CALL tBack, do_return_main_divemenu
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
169 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
170 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
171
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
172 do_reset_average_no_cave:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
173 MENU_BEGIN tDivemenu_Avg_Mkr, .3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
174 MENU_CALL tDivemenu_ResetAvg, do_reset_average
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
175 MENU_CALL tDivemenu_Marker, do_set_marker
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
176 MENU_CALL tBack, do_return_main_divemenu
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
177 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
178
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
179
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
180 do_reset_average:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
181 bsf request_reset_avg ; request reset of resettable average depth and dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
182 IFDEF _min_depth_option
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
183 bsf reset_trip_pressure ; request ISR to reset the min and max trip-wise pressures
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
184 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
185 bra do_exit_divemode_menu ; exit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
186
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
187
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
188 do_set_marker:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
189 bsf request_set_marker ; set request flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
190 bra do_exit_divemode_menu ; exit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
191
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
192
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
193 IFDEF _cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
194 do_turn_dive:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
195 bsf request_turn_dive ; set request flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
196 bra do_exit_divemode_menu ; exit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
197 ENDIF
0
heinrichsweikamp
parents:
diff changeset
198
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
199
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
200 IFDEF _external_sensor
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
201 do_switch_sensor: ; entry point when coming from switch to sensor
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
202 movlw .1 ; switch to sensor
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
203 movff WREG,opt_ccr_mode ; =0: fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
204 bra do_switch_sp_com ; continue with common part
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
205 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
206
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
207 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
208
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
209 IFDEF _ccr_pscr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
210
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
211 do_switch_sp: ; entry point when coming from manual setpoint selection (CCR)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
212 decf menu_pos_cur,W ; 1-5 -> 0-4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
213 lfsr FSR1,opt_setpoint_cbar
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
214 movff PLUSW1,char_I_const_ppO2 ; setup fixed setpoint
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
215 IFDEF _external_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
216 call transmit_setpoint ; transmit current setpoint from WREG (in cbar) to external electronics
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
217 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
218 bcf sp_fallback ; clear fallback condition (stops fallback warning)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
219 clrf WREG ; switch to fixed SP
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
220 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
221 bra do_switch_sp_com
0
heinrichsweikamp
parents:
diff changeset
222
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
223
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
224 do_switch_sp_calc: ; entry point when coming from switch to calculated ppO2 (pSCR)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
225 bcf sp_fallback ; clear fallback condition (stops fallback warning)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
226 clrf WREG ; switch to fixed SP
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
227 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
228 movff WREG,char_I_const_ppO2 ; set setpoint to 0, this forces deco engine to take the computed ppO2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
229 ;bra do_switch_sp_com
97
53a99a2dc6a1 CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents: 53
diff changeset
230
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
231
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
232 do_switch_sp_com: ; common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
233 bsf event_occured ; set global event byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
234 bsf event_SP_change ; set setpoint event flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
235
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
236 ; Clear some flags in case we were in bailout before...
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
237 bcf bailout_mode ; end bailout mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
238 bcf better_gas_available ; =1: a better gas is available and a gas change is advised in dive mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
239 bcf better_dil_available ; =1: a better diluent is available and a gas change is advised in dive mode
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
240 bcf better_gas_blinking ; clear blinking flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
241 bcf better_dil_blinking ; clear blinking flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
242 call dive_customview_mask ; redraw custom view mask to (eventually) rewrite "ppO2(Dil)" to "ppO2" or SAC label
0
heinrichsweikamp
parents:
diff changeset
243
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
244 bsf request_back_to_loop ; indicate that it is a switchback from OC bailout to CCR/pSCR loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
245 bsf request_gaschange ; initiate reconfiguration to loop mode on last diluent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
246
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
247 bra do_exit_divemode_menu ; continue with exiting menu code
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
248
0
heinrichsweikamp
parents:
diff changeset
249
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
250 do_divemode_gaslist_bail: ; entry point from CCR/pSCR to bailout to OC gases
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
251 bcf is_diluent_menu ; select OC gases
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
252 bsf is_bailout_menu ; flag it is a bailout action
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
253 ;bra do_divemode_gaslist
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
254
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
255 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
256
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
257 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
258
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
259 do_divemode_gaslist: ; entry point for switching: OC -> gases, loop -> diluents
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
260 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
261 btfsc bailout_mode ; in bailout mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
262 bcf is_diluent_menu ; YES - for safety reasons, redirect to selecting OC (bailout) gases
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
263 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
264 bsf short_gas_descriptions ; do not show "Gas x" etc.
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
265 bsf better_gas_hint ; mark the gas which is the best gas/diluent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
266 movf best_gas_number,W ; load number of best gas (1-5)into WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
267 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
268 btfsc is_diluent_menu ; in diluent selection?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
269 movf best_dil_number,W ; YES - overwrite with best diluent (1-5)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
270 ENDIF
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
271 bnz do_divemode_gaslist_1 ; best gas/dil number = 0 (none available) ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
272 movlw .1 ; YES - default to first gas/dil
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
273 btfsc WREG,7 ; best gas/dil number >= 128 (not computed yet) ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
274 movlw .1 ; YES - default to first gas/dil
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
275 do_divemode_gaslist_1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
276 movwf menu_pos_cur ; position cursor to best gas/dil (or first option if none avail)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
277 MENU_BEGIN tGaslist, .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
278 MENU_DYNAMIC gaslist_strcat_gas_cd, do_switch_gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
279 MENU_DYNAMIC gaslist_strcat_gas_cd, do_switch_gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
280 MENU_DYNAMIC gaslist_strcat_gas_cd, do_switch_gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
281 MENU_DYNAMIC gaslist_strcat_gas_cd, do_switch_gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
282 MENU_DYNAMIC gaslist_strcat_gas_cd, do_switch_gas
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
283 MENU_CALL tMore, do_divemode_gaslist_more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
284 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
285
0
heinrichsweikamp
parents:
diff changeset
286
heinrichsweikamp
parents:
diff changeset
287 do_divemode_gaslist_more:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
288 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
289 movwf menu_pos_cur ; set to first option in dive mode menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
290
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
291 movff char_I_O2_ratio,gas6_O2_ratio ; initialize gas6 with currently breathed gas - O2 ratio
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
292 IFDEF _helium
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
293 movff char_I_He_ratio,gas6_He_ratio ; initialize gas6 with currently breathed gas - He ratio
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
294 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
295
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
296 do_divemode_gaslist_more_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
297 IFDEF _helium
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
298 MENU_BEGIN tGaslist, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
299 MENU_CALL tO2Plus, do_dive_pO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
300 MENU_CALL tO2Minus, do_dive_mO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
301 MENU_CALL tHePlus, do_dive_pHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
302 MENU_CALL tHeMinus, do_dive_mHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
303 MENU_DYNAMIC gaslist_strcat_gas6, do_switch_gas6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
304 MENU_CALL tDivemenu_LostGas, do_lost_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
305 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
306 ELSE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
307 MENU_BEGIN tGaslist, .4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
308 MENU_CALL tO2Plus, do_dive_pO2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
309 MENU_CALL tO2Minus, do_dive_mO2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
310 MENU_DYNAMIC gaslist_strcat_gas6, do_switch_gas6
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
311 MENU_CALL tDivemenu_LostGas, do_lost_gas
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
312 MENU_CALL tExit, do_exit_divemode_menu
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
313 MENU_END
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
314 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
315
403
6e60012bb3fc NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents: 401
diff changeset
316
6e60012bb3fc NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents: 401
diff changeset
317 do_lost_gas:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
318 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
319 movwf menu_pos_cur ; set to first option in dive mode menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
320 do_lost_gas_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
321 bsf short_gas_descriptions ; do not show "Gas x" etc.
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
322 bcf better_gas_hint ; do not mark the best gas/diluent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
323 MENU_BEGIN tDivemenu_LostGas, .6
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
324 MENU_DYNAMIC gaslist_strcat_gas_cd, do_toggle_active ; toggle the gas (in)active
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
325 MENU_DYNAMIC gaslist_strcat_gas_cd, do_toggle_active ; toggle the gas (in)active
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
326 MENU_DYNAMIC gaslist_strcat_gas_cd, do_toggle_active ; toggle the gas (in)active
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
327 MENU_DYNAMIC gaslist_strcat_gas_cd, do_toggle_active ; toggle the gas (in)active
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
328 MENU_DYNAMIC gaslist_strcat_gas_cd, do_toggle_active ; toggle the gas (in)active
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
329 MENU_CALL tExit, do_exit_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
330 MENU_END
0
heinrichsweikamp
parents:
diff changeset
331
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
332
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
333 do_switch_gas6:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
334 movlw .6 ; gas 6
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
335 movwf menu_pos_cur ; transfer register for selected gas towards gas_switched_common
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
336 bsf event_gas_change_gas6 ; set flag for profile recording
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
337 ;bra do_switch_gas ; continue with common gas-switched code
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
338
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
339
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
340 do_switch_gas:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
341 bsf request_gaschange ; initiate gas change, will also trigger restart of deco_engine
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
342 btfss is_bailout_menu ; doing a bailout?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
343 bra do_switch_gas_1 ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
344 bsf bailout_mode ; YES - begin bailout mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
345 IFDEF _cave_mode
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
346 btfsc cave_mode ; - in cave mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
347 bsf dive_turned ; YES - set dive as turned
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
348 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
349 do_switch_gas_1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
350 bcf sp_fallback ; eventually terminate fallback mode and get rid of its warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
351 call dive_customview_mask ; redraw custom view mask to (eventually) rewrite "ppO2(Dil)" to "ppO2" or SAC label
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
352 ;bra do_exit_divemode_menu ; continue with exiting menu code
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
353
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
354
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
355 do_exit_divemode_menu:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
356 call timeout_divemode_menu2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
357 clrf STKPTR
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
358 goto diveloop_menu_exit
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
359
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
360
403
6e60012bb3fc NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents: 401
diff changeset
361 do_toggle_active:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
362 movlw .5
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
363 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
364 btfsc is_diluent_menu ; operating on diluents?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
365 addwf menu_pos_cur,F ; YES - add offset of 5 to shift 1-5 -> 6-10
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
366 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
367 decf menu_pos_cur,W ; 1-10 -> 0-4 for gases / 5-9 for diluents
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
368 lfsr FSR1,opt_gas_type ; load base address of gas types
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
369 movff PLUSW1,lo ; get gas/dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
370 tstfsz lo ; already disabled?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
371 bra do_toggle_active_disable ; NO - disable now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
372 do_toggle_active_enable ; YES - re-enable now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
373 lfsr FSR1,opt_gas_type_backup ; load base address of backed-up gas types
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
374 movff PLUSW1,lo ; get backed-up gas/dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
375 lfsr FSR1,opt_gas_type ; load base address of gas types
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
376 movff lo,PLUSW1 ; restore gas type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
377 bra do_toggle_active_common
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
378 do_toggle_active_disable: ; disable gas / diluent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
379 ;lfsr FSR1,opt_gas_type ; (still set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
380 clrf PLUSW1 ; set type to disabled (0=disabled, 1=first, 2=travel/normal, 3=deco/-)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
381 do_toggle_active_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
382 movlw .5
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
383 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
384 btfsc is_diluent_menu ; operating on diluents?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
385 subwf menu_pos_cur,F ; YES - back to 1-5
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
386 bcf better_dil_blinking ; clear blinking flag for diluents to avoid "leftovers"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
387 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
388 bcf better_gas_blinking ; clear blinking flag for gases to avoid "leftovers"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
389 call restart_deco_engine_wo_ceiling ; invalidate deco data (but not the ceiling) and restart deco engine
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
390 bra do_lost_gas_common
0
heinrichsweikamp
parents:
diff changeset
391
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
392
0
heinrichsweikamp
parents:
diff changeset
393 do_dive_pO2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
394 incf gas6_O2_ratio,F ; O2++
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
395 IFDEF _helium
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
396 movf gas6_He_ratio,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
397 addwf gas6_O2_ratio,W
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
398 ELSE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
399 movf gas6_O2_ratio,W
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
400 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
401 movwf lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
402 movlw .101
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
403 cpfslt lo ; O2 + He < 101 ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
404 decf gas6_O2_ratio,F ; O2-- (unchanged)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
405 bra do_divemode_gaslist_more_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
406
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
407
0
heinrichsweikamp
parents:
diff changeset
408 do_dive_mO2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
409 decf gas6_O2_ratio,F ; O2--
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
410 movlw gaslist_min_o2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
411 cpfslt gas6_O2_ratio ; O2 < minimum allowed %O2 ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
412 bra do_dive_mO2_done ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
413 movlw gaslist_min_o2 ; YES - restore minimum
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
414 movwf gas6_O2_ratio
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
415 do_dive_mO2_done:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
416 bra do_divemode_gaslist_more_common
0
heinrichsweikamp
parents:
diff changeset
417
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
418 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
419
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
420 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
421
0
heinrichsweikamp
parents:
diff changeset
422 do_dive_pHe:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
423 incf gas6_He_ratio,F ; He++
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
424 movf gas6_He_ratio,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
425 addwf gas6_O2_ratio,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
426 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
427 movlw .101
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
428 cpfslt lo ; O2 + He < 101 ?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
429 decf gas6_He_ratio,F ; YES - He-- (unchanged)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
430 bra do_divemode_gaslist_more_common
0
heinrichsweikamp
parents:
diff changeset
431
heinrichsweikamp
parents:
diff changeset
432 do_dive_mHe:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
433 decf gas6_He_ratio,F ; He--
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
434 bnn do_dive_mHe_done ; H2 < 0 ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
435 clrf gas6_He_ratio ; YES - reset to 0
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
436 do_dive_mHe_done:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
437 bra do_divemode_gaslist_more_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
438
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
439 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
440
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
441 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
442
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
443 IFDEF _ccr_pscr
0
heinrichsweikamp
parents:
diff changeset
444
heinrichsweikamp
parents:
diff changeset
445 do_divemode_splist:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
446 bsf short_gas_descriptions ; do not show "SP" etc.
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
447 movlw .1 ; default to first menu item
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
448 movff opt_ccr_mode,lo ; get CCR mode (0: Fixed SP, 1: Sensor, 2: Auto SP)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
449 dcfsnz lo,F ; mode = sensor ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
450 movlw .6 ; YES - load menu item number for 'sensor'
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
451 btfsc sp_fallback ; in fallback condition?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
452 movlw .1 ; YES - revert to first menu item
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
453 movwf menu_pos_cur ; set cursor position
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
454
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
455 do_divemode_splist_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
456
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
457 IFDEF _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
458 btfsc analog_o2_input ; do we have an analog or S8 digital input (OSTC cR)?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
459 bra do_divemode_splist_sensor ; YES
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
460 btfsc optical_input ; do we have an optical input (OSTC 3)?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
461 bra do_divemode_splist_sensor ; YES
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
462 ENDIF
0
heinrichsweikamp
parents:
diff changeset
463
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
464 do_divemode_splist_no_sensor:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
465 MENU_BEGIN tGaslist, .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
466 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
467 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
468 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
469 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
470 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
471 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
472
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
473
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
474 IFDEF _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
475
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
476 do_divemode_splist_sensor:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
477 MENU_BEGIN tGaslist, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
478 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
479 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
480 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
481 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
482 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
483 MENU_CALL tCCRSensor, do_divemode_sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
484 MENU_END
249
94bf757690cf ignore sensor for non-sensor hardware
heinrichsweikamp
parents: 195
diff changeset
485
94bf757690cf ignore sensor for non-sensor hardware
heinrichsweikamp
parents: 195
diff changeset
486
0
heinrichsweikamp
parents:
diff changeset
487 do_divemode_sensor:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 583
diff changeset
488 movlw index_ppo2_sensors-1 ; custom view number one below ppO2 sensors
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
489 movwf active_customview ; set custom view number
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
490 bsf request_next_custview ; initiate toggle to desired custom view -> ppO2 sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
491 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
492 movwf menu_pos_cur ; set to 1st option: use sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
493
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
494 do_return_divemode_sensor:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
495 MENU_BEGIN tGaslist, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
496 MENU_CALL tDivemenu_UseSensor, do_switch_sensor
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
497 MENU_CALL tBack, do_divemode_splist
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
498 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
499 MENU_CALL tDiveHudMask1, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
500 MENU_CALL tDiveHudMask2, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
501 MENU_CALL tDiveHudMask3, do_toggle_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
502 MENU_END
0
heinrichsweikamp
parents:
diff changeset
503
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
504
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
505 do_divemode_setpoint_pscr:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
506 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
507 movwf menu_pos_cur ; set to 1st option: use calculated ppO2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
508 MENU_BEGIN tGaslist, .6
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
509 MENU_CALL tCalculated, do_switch_sp_calc
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
510 MENU_CALL tDivemenu_UseSensor, do_switch_sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
511 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
512 MENU_CALL tDiveHudMask1, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
513 MENU_CALL tDiveHudMask2, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
514 MENU_CALL tDiveHudMask3, do_toggle_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
515 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
516
0
heinrichsweikamp
parents:
diff changeset
517
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
518 do_toggle_sensor:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
519 movff menu_pos_cur,lo ; backup position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
520 decf menu_pos_cur,f ; 4, 5, 6 -> 3, 4, 5
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
521 decf menu_pos_cur,f ; 3, 4, 5 -> 2, 3, 4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
522 decf menu_pos_cur,f ; 2, 3, 4 -> 1, 2, 3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
523 dcfsnz menu_pos_cur ; 1, 2, 3 -> 0, 1, 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
524 btg use_O2_sensor1 ; =
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
525 dcfsnz menu_pos_cur ; 0, 1, 2 -> -1, 0, 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
526 btg use_O2_sensor2 ; =
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
527 dcfsnz menu_pos_cur ; -1,0, 1 -> -2,-1, 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
528 btg use_O2_sensor3 ; =
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
529 movff lo,menu_pos_cur ; restore position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
530 bra do_return_divemode_sensor
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
531
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
532 ENDIF ; _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
533 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
534
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
535 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
536
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 604
diff changeset
537 END