Mercurial > public > hwos_code
annotate src/customview.asm @ 476:7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
| author | heinrichsweikamp |
|---|---|
| date | Mon, 16 Jan 2017 11:05:02 +0100 |
| parents | 4fdf6886004b |
| children | c0ee33f1f399 |
| rev | line source |
|---|---|
| 0 | 1 ;============================================================================= |
| 2 ; | |
| 3 ; File customview.asm | |
| 4 ; | |
| 5 ; Customview in Surfacemode and Divemode | |
| 6 ; | |
| 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
| 8 ;============================================================================= | |
| 9 ; HISTORY | |
| 10 ; 2011-08-10 : [mH] moving from OSTC code | |
| 11 | |
| 12 ;============================================================================= | |
| 13 | |
| 275 | 14 #include "hwos.inc" ; Mandatory header |
| 0 | 15 #include "tft_outputs.inc" |
| 16 #include "strings.inc" | |
| 17 #include "tft.inc" | |
| 18 #include "isr.inc" | |
| 19 #include "wait.inc" | |
| 20 #include "surfmode.inc" | |
| 21 #include "convert.inc" | |
| 22 #include "divemode.inc" | |
| 23 #include "i2c.inc" | |
| 24 | |
| 25 gui CODE | |
| 26 | |
| 27 ;============================================================================= | |
| 28 ; Do every-second tasks for the custom view area (Dive mode) | |
| 29 | |
| 30 global customview_second | |
| 31 customview_second: | |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
32 movff menupos3,WREG ; copy current view (1-...) |
| 0 | 33 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
34 goto TFT_update_ppo2_sensors ; Update Sensor data ; and return |
| 0 | 35 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
36 goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return |
| 0 | 37 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
38 goto TFT_decoplan ; Show decoplan ; and return |
| 0 | 39 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
40 goto TFT_battinfo_tissues_clock ; Update Battery, Tissues and clock ; and return |
| 0 | 41 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
42 goto TFT_gf_info ; Update GF informations ; and return |
|
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
43 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
44 return ; Compass updated seperately (Faster) in divemode; |
|
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
45 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
46 goto TFT_dyn_gaslist ; Update the gaslist ; and return |
|
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
47 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
48 goto TFT_hud_voltages ; Show HUD details ; and return |
| 123 | 49 dcfsnz WREG,F |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
50 bra customview_1sec_view9 ; Make sure to change value in "check_ppo2_display:" when moving around custom views |
|
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
51 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
52 goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
53 dcfsnz WREG,F |
|
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
471
diff
changeset
|
54 goto TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS; and return |
| 0 | 55 ; Menupos3=0, do nothing |
| 56 return | |
| 57 | |
| 123 | 58 customview_1sec_view9: ; Ceiling |
| 59 call TFT_ceiling ; Show Ceiling | |
|
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
60 ; ppO2 value |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
61 call TFT_display_ppo2_val |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
62 ; current GF value |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
63 extern char_I_deco_model |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
64 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
65 return ; No GF info for non-GF modes |
| 428 | 66 goto TFT_gf_info ; Update GF informations ; and return |
| 123 | 67 |
|
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
68 |
| 0 | 69 |
| 70 ;============================================================================= | |
| 71 ; Do every-minute tasks for the custom view area | |
| 72 | |
| 73 global customview_minute | |
| 74 customview_minute: | |
| 75 return | |
| 76 ; movff menupos3,WREG ; copy | |
| 77 ; dcfsnz WREG,F | |
| 78 ; bra customview_1min_view1 | |
| 79 ; dcfsnz WREG,F | |
| 80 ; bra customview_1min_view2 | |
| 81 ; dcfsnz WREG,F | |
| 82 ; bra customview_1min_view3 | |
| 83 ; dcfsnz WREG,F | |
| 84 ; bra customview_1min_view4 | |
| 85 ; dcfsnz WREG,F | |
| 86 ; bra customview_1min_view5 | |
| 87 ; dcfsnz WREG,F | |
| 88 ; bra customview_1min_view6 | |
| 89 ; dcfsnz WREG,F | |
| 90 ; bra customview_1min_view7 | |
| 91 ; dcfsnz WREG,F | |
| 92 ; bra customview_1min_view8 | |
| 93 ; dcfsnz WREG,F | |
| 94 ; bra customview_1min_view9 | |
| 95 ; dcfsnz WREG,F | |
| 96 ; bra customview_1min_view10 | |
| 97 ; dcfsnz WREG,F | |
| 98 ; bra customview_1min_view11 | |
| 99 ; ; Menupos3=0, do nothing | |
| 100 ; return | |
| 101 ; | |
| 102 ;customview_1min_view1: | |
| 103 ;customview_1min_view2: | |
| 104 ;customview_1min_view3: | |
| 105 ;customview_1min_view4: | |
| 106 ;customview_1min_view5: | |
| 107 ;customview_1min_view6: | |
| 108 ;customview_1min_view7: | |
| 109 ;customview_1min_view8: | |
| 110 ;customview_1min_view9: | |
| 111 ;customview_1min_view10: | |
| 112 ;customview_1min_view11: | |
| 113 ; return | |
| 114 | |
| 115 global surf_customview_toggle | |
| 116 surf_customview_toggle: | |
| 117 bcf switch_right | |
| 118 incf menupos3,F ; Number of customview to show | |
| 41 | 119 movlw d'7' ; Max number of customsviews in surface mode |
| 0 | 120 cpfsgt menupos3 ; Max reached? |
| 121 bra surf_customview_mask ; No, show | |
| 122 movlw .1 | |
| 123 movwf menupos3 ; Reset to one (Always one custom view visible) | |
| 124 | |
| 125 global surf_customview_mask | |
| 126 surf_customview_mask: | |
| 48 | 127 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
|
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
128 ; Prepare title |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
129 WIN_TINY surf_customview_title_column,surf_customview_title_row |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
130 WIN_COLOR color_greenish |
| 0 | 131 movff menupos3,WREG ; Menupos3 holds number of customview function |
| 132 dcfsnz WREG,F | |
| 133 bra surf_customview_init_view1 ; OC Gas list | |
| 134 dcfsnz WREG,F | |
| 135 bra surf_customview_init_view2 ; CC Dil list | |
| 136 dcfsnz WREG,F | |
| 137 bra surf_customview_init_view3 ; CC SP list | |
| 138 dcfsnz WREG,F | |
| 139 bra surf_customview_init_view4 ; Custom Text | |
| 140 dcfsnz WREG,F | |
| 141 bra surf_customview_init_view5 ; Tissue Diagram | |
| 41 | 142 dcfsnz WREG,F |
| 0 | 143 bra surf_customview_init_view6 ; Compass |
| 41 | 144 dcfsnz WREG,F |
| 145 bra surf_customview_init_view7 ; Deco settings | |
| 0 | 146 |
| 147 call I2C_sleep_accelerometer ; Stop accelerometer | |
| 148 call I2C_sleep_compass ; Stop compass | |
| 149 | |
| 150 movlw .1 | |
| 151 movwf menupos3 ; Reset to one (Always one custom view visible) | |
| 152 | |
| 153 surf_customview_init_view1: ; View1: OC Gas list | |
| 154 btfsc FLAG_gauge_mode | |
| 155 bra surf_customview_toggle | |
| 156 btfsc FLAG_apnoe_mode | |
| 157 bra surf_customview_toggle | |
|
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
158 btfsc FLAG_ccr_mode |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
159 bra surf_customview_init_view1_bail ; Bailoutversion |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
160 STRCPY_TEXT_PRINT tGaslist ; Title of customview |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
161 call TFT_standard_color |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
162 call TFT_gaslist_surfmode ; Show gas list |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
163 bra customview_toggle_exit ; Done. |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
164 |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
165 surf_customview_init_view1_bail: |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
166 STRCPY_TEXT_PRINT tDiveBailout ; Title of customview |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
167 call TFT_standard_color |
| 0 | 168 call TFT_gaslist_surfmode ; Show gas list |
| 169 bra customview_toggle_exit ; Done. | |
| 170 | |
| 171 surf_customview_init_view2: ; View2: CC Dil list | |
| 172 btfss FLAG_ccr_mode | |
| 173 bra surf_customview_toggle | |
| 174 btfsc FLAG_gauge_mode | |
| 175 bra surf_customview_toggle | |
| 176 btfsc FLAG_apnoe_mode | |
| 177 bra surf_customview_toggle | |
|
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
178 STRCPY_TEXT_PRINT tGaslistCC ; Title of customview |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
179 call TFT_standard_color |
| 0 | 180 call TFT_dillist_surfmode ; Show diluent list |
| 181 bra customview_toggle_exit ; Done. | |
| 182 | |
| 183 surf_customview_init_view3: ; View3: CC SP list | |
| 184 btfss FLAG_ccr_mode | |
| 185 bra surf_customview_toggle | |
| 186 btfsc FLAG_gauge_mode | |
| 187 bra surf_customview_toggle | |
| 188 btfsc FLAG_apnoe_mode | |
| 189 bra surf_customview_toggle | |
|
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
190 STRCPY_TEXT_PRINT tFixedSetpoints ; Title of customview |
|
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
191 call TFT_standard_color |
| 0 | 192 call TFT_splist_surfmode ; Show Setpoint list |
| 193 bra customview_toggle_exit ; Done. | |
| 194 | |
| 195 surf_customview_init_view4: ; View4: Custom text | |
|
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
196 call TFT_standard_color |
| 0 | 197 call TFT_custom_text ; Show the custom text |
| 198 bra customview_toggle_exit ; Done. | |
| 199 | |
| 200 surf_customview_init_view5: ; View5: Tissue Diagram | |
| 201 btfsc FLAG_gauge_mode | |
| 202 bra surf_customview_toggle | |
| 203 btfsc FLAG_apnoe_mode | |
| 204 bra surf_customview_toggle | |
|
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
205 call TFT_standard_color |
| 0 | 206 call TFT_surface_tissues ; Show Tissue diagram |
| 207 bra customview_toggle_exit ; Done. | |
| 208 | |
| 209 surf_customview_init_view6: ; View6: Compass | |
| 210 call I2C_init_accelerometer ; Start accelerometer | |
| 211 call I2C_init_compass ; Start compass | |
|
256
5b4ef0b9090d
place compass display code into compass_ops.asm
heinrichsweikamp
parents:
254
diff
changeset
|
212 extern TFT_surface_compass_mask |
| 0 | 213 call TFT_surface_compass_mask ; Show compass |
| 214 bra customview_toggle_exit ; Done. | |
| 41 | 215 surf_customview_init_view7: |
| 216 btfsc FLAG_gauge_mode | |
| 217 bra surf_customview_toggle | |
| 218 btfsc FLAG_apnoe_mode | |
| 219 bra surf_customview_toggle | |
| 220 extern deco_setup_dive | |
| 221 call deco_setup_dive | |
| 222 call TFT_surface_decosettings ; Show all deco settings | |
| 223 bra customview_toggle_exit ; Done. | |
| 0 | 224 |
| 225 global menuview_toggle | |
| 226 menuview_toggle: ; Show Menu or the simulator tasks | |
| 227 movlw divemode_menuview_timeout | |
| 228 movwf timeout_counter3 | |
| 229 bsf menuview | |
| 230 bcf switch_left | |
| 231 incf menupos2,F ; Number of options to show | |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
232 movlw d'9' ; Max number of options in divemode |
| 0 | 233 cpfsgt menupos2 ; Max reached? |
| 234 bra menuview_mask ; No, show | |
| 235 global menuview_toggle_reset | |
| 236 menuview_toggle_reset: ; Timeout occured | |
| 237 clrf menupos2 | |
| 238 bcf menuview | |
| 239 menuview_mask: | |
|
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
240 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column, dm_simtext_column+.49 ; top, bottom, left, right |
| 0 | 241 btfss FLAG_gauge_mode |
| 242 bra menuview_mask2 | |
|
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
300
diff
changeset
|
243 ; Clear some more in gauge mode -- "Reset Avg." text is longer than normal simtext |
|
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
244 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column+.50, dm_simtext_column+.70 ; top, bottom, left, right |
|
327
ca5df826437a
Small fix for the custom grid layout
janos_kovacs <kovjanos@gmail.com>
parents:
315
diff
changeset
|
245 menuview_mask2: |
|
315
4f83470dcece
VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents:
300
diff
changeset
|
246 call TFT_draw_gassep_line |
| 0 | 247 movlw color_yellow |
| 248 call TFT_set_color | |
|
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
249 bsf win_invert ; Set invert flag |
|
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
250 WIN_SMALL dm_simtext_column,dm_simtext_row |
| 0 | 251 movff menupos2,WREG ; Menupos2 holds number of menu option to show |
| 252 dcfsnz WREG,F | |
| 137 | 253 bra menuview_view_gaschange ; If a better gas is indicated |
| 254 dcfsnz WREG,F | |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
255 bra menuview_view1 ; "Menu?" (Not in Gauge and Anpnoe) |
|
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
256 dcfsnz WREG,F |
|
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
257 bra menuview_view2 ; "Quit Simulation?" (Sim only) |
| 0 | 258 dcfsnz WREG,F |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
259 bra menuview_view3 ; "Descent 1m" (Sim only) |
| 0 | 260 dcfsnz WREG,F |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
261 bra menuview_view4 ; "Ascend 1m" (Sim only) |
| 0 | 262 dcfsnz WREG,F |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
263 bra menuview_view5 ; "Quit Apnea mode?" (Apnea only) |
| 0 | 264 dcfsnz WREG,F |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
265 bra menuview_view6 ; "Reset Avr." (Gauge only) |
| 0 | 266 dcfsnz WREG,F |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
267 bra menuview_view7 ; "Sim:+5mins" (Sim only) |
|
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
268 dcfsnz WREG,F |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
269 bra menuview_view8 ; "Heading" (When compass is shown) |
| 0 | 270 menuview_exit: |
| 271 call TFT_standard_color | |
|
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
188
diff
changeset
|
272 bcf win_invert ; Reset invert flag |
| 0 | 273 return ; Menupos2 = 0, Show nothing |
| 137 | 274 |
| 275 | |
| 276 menuview_view_gaschange: | |
| 277 extern gaslist_strcat_gas_mod | |
| 278 btfss better_gas_available ; =1: A better gas is available | |
| 279 bra menuview_toggle ; No, call next option | |
|
138
2852b0bd6391
minor: some extra protection against wrong gas selection
heinrichsweikamp
parents:
137
diff
changeset
|
280 btfsc divemode_gaschange ; Skip if the last gas change is not done yet. |
|
2852b0bd6391
minor: some extra protection against wrong gas selection
heinrichsweikamp
parents:
137
diff
changeset
|
281 bra menuview_toggle |
| 137 | 282 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
| 283 movff better_gas_number,PRODL ; number (1-5) of the "better gas" in divemode, =0: no better gas available | |
| 284 decf PRODL,F | |
| 285 call gaslist_strcat_gas_mod ; Append gas description of gas #PRODL (0-4) to current string | |
| 286 movlw .5 | |
| 287 movwf FSR2L ; Point to char 6 (5 chars gas description only) | |
| 288 STRCAT_PRINT "?" | |
| 289 bra menuview_exit ; Done. | |
| 0 | 290 menuview_view1: |
| 291 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
| 292 bra menuview_toggle ; Call next option | |
| 293 btfsc FLAG_gauge_mode ; In Gauge mode? | |
| 294 bra menuview_toggle ; Call next option | |
| 295 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?" | |
| 296 bra menuview_exit ; Done. | |
| 297 menuview_view2: | |
| 298 btfss simulatormode_active ; View only for simulator mode | |
| 299 bra menuview_toggle ; Call next option | |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
300 STRCPY_TEXT_PRINT tQuitSim ; "Quit Simulation?" |
| 0 | 301 bra menuview_exit ; Done. |
| 302 menuview_view3: | |
| 303 btfss simulatormode_active ; View only for simulator mode | |
| 304 bra menuview_toggle ; Call next option | |
| 428 | 305 STRCPY_PRINT "Sim:-1m" |
| 0 | 306 bra menuview_exit ; Done. |
| 307 menuview_view4: | |
| 308 btfss simulatormode_active ; View only for simulator mode | |
| 309 bra menuview_toggle ; Call next option | |
| 428 | 310 STRCPY_PRINT "Sim:+1m" |
| 0 | 311 bra menuview_exit ; Done. |
| 312 menuview_view5: | |
| 313 btfss FLAG_apnoe_mode ; In Apnoe mode? | |
| 314 bra menuview_toggle ; No, call next option | |
|
184
faa06c58e977
BUGFIX: Quit Apnea mode on the surface manually
heinrichsweikamp
parents:
148
diff
changeset
|
315 btfss FLAG_active_descent ; Are we descending? |
| 0 | 316 bra menuview_toggle ; Yes |
| 317 ; We are at the surface: | |
| 148 | 318 STRCPY_TEXT_PRINT tQuitSim ; "Quit Apnea mode?" |
| 0 | 319 bra menuview_exit ; Done. |
| 320 menuview_view6: | |
| 321 btfss FLAG_gauge_mode ; In Gauge mode? | |
| 322 bra menuview_toggle ; No, call next option | |
| 437 | 323 STRCPY_TEXT_PRINT tDivemenu_ResetAvg ; "Reset Avg." |
| 0 | 324 bra menuview_exit ; Done. |
|
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
325 menuview_view7: |
|
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
326 btfss simulatormode_active ; View only for simulator mode |
|
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
327 bra menuview_toggle ; Call next option |
|
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
328 btfsc FLAG_gauge_mode ; In Gauge mode? |
|
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
329 bra menuview_toggle ; Yes, call next option |
|
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
330 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
|
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
331 bra menuview_toggle ; Yes, call next option |
| 428 | 332 STRCPY_PRINT "Sim:+5'" |
|
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
333 bra menuview_exit ; Done. |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
334 menuview_view8: |
|
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
335 movlw .6 |
|
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
336 cpfseq menupos3 ; in compass view? |
|
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
337 bra menuview_toggle ; No, call next option |
|
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
338 STRCPY_TEXT_PRINT tSetHeading ; "Heading" |
|
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
339 bra menuview_exit ; Done. |
| 0 | 340 |
| 341 | |
| 342 ;============================================================================= | |
| 343 ; Show next customview (and delete this flag) | |
| 344 global customview_toggle | |
| 345 customview_toggle: | |
| 346 bcf switch_right | |
| 347 incf menupos3,F ; Number of customview to show | |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
348 movlw d'11' ; Max number of customsviews in divemode |
| 0 | 349 cpfsgt menupos3 ; Max reached? |
| 350 bra customview_mask ; No, show | |
| 351 customview_toggle_reset: ; Timeout occured | |
| 352 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
|
39
e4e91fe8b09d
remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents:
0
diff
changeset
|
353 global customview_mask |
| 0 | 354 customview_mask: |
|
353
573f2251cf49
NEW: Quit Simulator automatically when starting a real dive
heinrichsweikamp
parents:
337
diff
changeset
|
355 ; Clear custom view area in divemode |
|
573f2251cf49
NEW: Quit Simulator automatically when starting a real dive
heinrichsweikamp
parents:
337
diff
changeset
|
356 WIN_BOX_BLACK dm_customview_row, dm_customview_bot, dm_customview_column, dm_customview_rgt ; top, bottom, left, right |
|
300
5ad479f2a868
Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents:
275
diff
changeset
|
357 WIN_SMALL dm_customview_column,dm_customview_row |
| 0 | 358 call TFT_standard_color |
| 359 movff menupos3,WREG ; Menupos3 holds number of customview function | |
| 360 dcfsnz WREG,F | |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
361 bra customview_init_view1 ; Update Sensor data |
| 0 | 362 dcfsnz WREG,F |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
363 bra customview_init_view2 ; average depth and stopwatch |
| 0 | 364 dcfsnz WREG,F |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
365 bra customview_init_view3 ; Decoplan |
| 0 | 366 dcfsnz WREG,F |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
367 bra customview_init_view4 ; Battery info, Tissues and clock |
| 0 | 368 dcfsnz WREG,F |
| 369 bra customview_init_view5 ; GF informations | |
| 370 dcfsnz WREG,F | |
| 371 bra customview_init_view6 ; Compass | |
|
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
372 dcfsnz WREG,F |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
373 bra customview_init_view7 ; Dynamic gaslist |
| 105 | 374 dcfsnz WREG,F |
| 375 bra customview_init_view8 ; HUD voltages | |
| 123 | 376 dcfsnz WREG,F |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
377 bra customview_init_view9 ; ppO2, Ceiling and current GF |
|
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
378 dcfsnz WREG,F |
|
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
379 bra customview_init_view10 ; Sensor check |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
380 dcfsnz WREG,F |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
381 bra customview_init_view11 ; ppO2, END/EAD and CNS |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
382 |
| 0 | 383 customview_init_nocustomview: |
| 384 call I2C_sleep_accelerometer ; Stop accelerometer | |
| 385 call I2C_sleep_compass ; Stop compass | |
| 386 bra customview_toggle_exit | |
| 387 | |
| 388 customview_init_view1: | |
| 389 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
| 390 bra customview_toggle ; yes, Call next view... | |
| 391 btfss FLAG_ccr_mode ; In CC mode? | |
| 392 bra customview_toggle ; no, Call next view... | |
| 249 | 393 movf hardware_flag,W |
| 394 sublw 0x11 ; 2 with BLE | |
| 395 btfsc STATUS,Z | |
| 396 bra customview_toggle ; no, Call next view... | |
|
476
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
397 movf hardware_flag,W |
|
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
398 sublw 0x13 ; + |
|
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
399 btfsc STATUS,Z |
|
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
400 bra customview_toggle ; no, Call next view... |
| 0 | 401 |
| 402 bsf dive_hud1_displayed ; Set display flag | |
| 403 bsf dive_hud2_displayed ; Set display flag | |
| 404 bsf dive_hud3_displayed ; Set display flag | |
| 405 call TFT_hud_mask ; Setup HUD mask | |
| 192 | 406 call TFT_update_ppo2_sensors ; Update Sensor data |
| 0 | 407 bra customview_toggle_exit |
| 408 | |
| 409 customview_init_view2: | |
| 410 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
| 411 bra customview_toggle ; Yes, Call next view... | |
| 412 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch | |
| 413 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
| 414 bra customview_toggle_exit | |
| 415 | |
| 416 customview_init_view3: | |
| 417 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
| 418 bra customview_toggle ; Yes, Call next view... | |
| 419 btfsc FLAG_gauge_mode ; In Gauge mode? | |
| 420 bra customview_toggle ; Yes, Call next view... | |
| 421 call TFT_decoplan ; Show decoplan | |
| 422 bra customview_toggle_exit | |
| 423 | |
| 424 customview_init_view4: | |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
425 call TFT_battinfo_tissues_clock_mask ; Setup Mask |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
426 call TFT_battinfo_tissues_clock ; Show Battery info, Tissues and clock |
| 0 | 427 bra customview_toggle_exit |
| 428 | |
| 429 customview_init_view5: | |
| 430 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
| 431 bra customview_toggle ; Yes, Call next view... | |
| 432 btfsc FLAG_gauge_mode ; In Gauge mode? | |
| 433 bra customview_toggle ; Yes, Call next view... | |
| 119 | 434 |
| 435 extern char_I_deco_model | |
| 436 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF | |
| 437 bra customview_toggle ; No GF info for non-GF modes | |
| 438 | |
| 0 | 439 call TFT_gf_mask ; Setup Mask |
| 440 call TFT_gf_info ; Show GF informations | |
| 441 bra customview_toggle_exit | |
| 442 | |
| 443 customview_init_view6: ; Compass (View 6) | |
| 444 call I2C_init_accelerometer ; Start accelerometer | |
| 445 call I2C_init_compass ; Start compass | |
|
256
5b4ef0b9090d
place compass display code into compass_ops.asm
heinrichsweikamp
parents:
254
diff
changeset
|
446 extern TFT_dive_compass_mask |
| 0 | 447 call TFT_dive_compass_mask ; Show compass |
| 448 bra customview_toggle_exit | |
| 449 | |
|
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
450 customview_init_view7: ; Dynamic gaslist (View 7) |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
451 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
452 bra customview_toggle ; Yes, Call next view... |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
453 btfsc FLAG_ccr_mode ; In CC mode? |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
454 bra customview_toggle ; Yes, Call next view... |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
455 call TFT_dyn_gaslist ; Show the dyn gaslist |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
456 bra customview_toggle_exit |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
457 |
|
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
458 customview_init_view8: ; Sensor millivolts |
| 136 | 459 btfsc FLAG_gauge_mode ; In Gauge mode? |
| 460 bra customview_toggle ; Yes, Call next view... | |
|
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
461 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
|
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
462 bra customview_toggle ; yes, Call next view... |
|
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
463 btfss FLAG_ccr_mode ; In CC mode? |
|
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
464 bra customview_toggle ; no, Call next view... |
|
476
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
465 |
|
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
466 movf hardware_flag,W |
|
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
467 sublw 0x13 ; + |
|
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
468 btfsc STATUS,Z |
|
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
469 bra customview_toggle ; no, Call next view... |
|
7c10557c248e
no sensors in surface mode if the computer has no sensor inputs
heinrichsweikamp
parents:
472
diff
changeset
|
470 |
|
337
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
471 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP |
|
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
472 sublw .1 ; opt_ccr_mode = 1 (Sensor)? |
|
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
333
diff
changeset
|
473 bnz customview_toggle ; no, Call next view... |
|
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
474 call TFT_hud_mask ; Setup HUD mask |
|
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
475 call TFT_hud_voltages ; Show HUD details |
|
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
476 bra customview_toggle_exit |
|
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
477 |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
478 customview_init_view9: ; ppO2, Ceiling and current GF |
| 123 | 479 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
| 480 bra customview_toggle ; yes, Call next view... | |
| 481 btfsc FLAG_gauge_mode ; In Gauge mode? | |
| 482 bra customview_toggle ; Yes, Call next view... | |
| 483 call TFT_ceiling_mask ; Setup mask | |
| 484 call TFT_ceiling ; Show Ceiling | |
|
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
485 |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
486 ; ppO2 value |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
487 call TFT_mask_ppo2 |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
488 call TFT_display_ppo2_val |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
489 |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
490 ; current GF value |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
491 extern char_I_deco_model |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
492 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
493 bra customview_toggle_exit ; No GF info for non-GF modes |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
494 call TFT_gf_mask_cGF ; Setup Mask - current GF only |
|
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
495 call TFT_gf_info ; Show GF informations |
| 123 | 496 bra customview_toggle_exit |
| 497 | |
|
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
498 customview_init_view10: ; Sensor check |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
499 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
500 bra customview_toggle ; yes, Call next view... |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
501 btfsc FLAG_gauge_mode ; In Gauge mode? |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
502 bra customview_toggle ; Yes, Call next view... |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
503 btfss FLAG_ccr_mode ; In CC mode? |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
504 bra customview_toggle ; no, Call next view... |
|
413
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
505 |
|
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
506 call TFT_sensor_check_mask ; Show ppO2 of O2 and Diluent mask |
|
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
507 call TFT_sensor_check ; Show ppO2 of O2 and Diluent |
|
12e85930d95c
NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents:
376
diff
changeset
|
508 bra customview_toggle_exit |
| 123 | 509 |
|
471
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
510 customview_init_view11: ; ppO2, END/EAD and CNS |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
511 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
512 bra customview_toggle ; yes, Call next view... |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
513 btfsc FLAG_gauge_mode ; In Gauge mode? |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
514 bra customview_toggle ; Yes, Call next view... |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
515 |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
516 call TFT_ppo2_ead_end_cns_mask ; Show ppO2, END/EAD and CNS mask |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
517 call TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
518 bra customview_toggle_exit |
|
9edb1359ce43
NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents:
437
diff
changeset
|
519 |
| 0 | 520 customview_toggle_exit: |
| 521 call TFT_standard_color | |
| 522 bcf toggle_customview ; Clear flag | |
| 523 return | |
| 524 | |
| 525 global customview_show_change_depth | |
| 526 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2 | |
| 527 PUTC " " | |
| 528 TSTOSS opt_units ; 0=m, 1=ft | |
| 529 bra customview_show_mix_metric | |
| 530 movf lo,W | |
| 531 mullw .100 ; convert meters to mbar | |
| 532 movff PRODL,lo | |
| 533 movff PRODH,hi | |
| 534 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
| 535 bsf leftbind | |
| 536 output_16 ; Change depth in lo:hi | |
| 537 bcf leftbind | |
| 538 STRCAT_TEXT tFeets | |
| 539 return | |
| 540 customview_show_mix_metric: | |
| 541 output_99 ; Change depth in lo | |
| 542 STRCAT_TEXT tMeters | |
| 543 return | |
| 544 | |
| 545 | |
| 546 global customview_show_mix | |
| 547 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 | |
| 548 tstfsz hi ; He=0? | |
| 549 bra customview_show_mix5 ; No, Show a TX | |
| 550 movlw .21 | |
| 551 cpfseq lo ; Air? | |
| 552 bra customview_show_mix2 ; No | |
| 553 STRCAT_TEXT tSelectAir ; Yes, show "Air" | |
| 554 bra customview_show_mix4b | |
| 555 customview_show_mix2: | |
| 556 movlw .100 | |
| 557 cpfseq lo ; O2? | |
| 558 bra customview_show_mix3 ; No | |
| 559 STRCAT_TEXT tSelectO2 ; Yes, show "O2" | |
| 560 bra customview_show_mix4b | |
| 561 | |
| 562 customview_show_mix3: | |
| 563 movlw .21 | |
| 564 cpfslt lo ; < Nx21? | |
| 565 bra customview_show_mix4 ; No | |
| 566 STRCAT_TEXT tGasErr ; Yes, show "Err" | |
| 567 output_99 ; O2 ratio is still in "lo" | |
| 568 bra customview_show_mix4c | |
| 569 | |
| 570 customview_show_mix4: | |
| 571 STRCAT_TEXT tSelectNx ; Show "Nx" | |
| 572 output_99 ; O2 ratio is still in "lo" | |
| 573 customview_show_mix4b: | |
| 574 STRCAT " " | |
| 575 customview_show_mix4c: | |
| 576 btfsc divemode ; In divemode | |
| 577 return ; Yes | |
| 578 STRCAT " " | |
| 579 return | |
| 580 | |
| 581 customview_show_mix5: | |
| 582 btfsc divemode | |
| 583 bra customview_show_mix6 | |
| 584 STRCAT_TEXT tSelectTx ; Show "Tx" | |
| 585 customview_show_mix6: | |
| 586 output_99 ; O2 ratio is still in "lo" | |
| 587 PUTC "/" | |
| 588 movff hi,lo | |
| 589 output_99 ; He ratio | |
| 590 return | |
| 591 | |
| 592 END |
