Mercurial > public > hwos_code
annotate src/customview.asm @ 656:8af5aefbcdaf default tip
Update to 3.31 beta
| author | heinrichsweikamp |
|---|---|
| date | Thu, 27 Nov 2025 18:32:58 +0100 |
| parents | 75e90cd0c2c3 |
| children |
| rev | line source |
|---|---|
| 0 | 1 ;============================================================================= |
| 2 ; | |
| 634 | 3 ; File customview.asm * combined next generation V3.09.5 |
| 0 | 4 ; |
| 604 | 5 ; Custom Views in Surface and Dive Mode |
| 0 | 6 ; |
| 654 | 7 ; Copyright (c) 2011, JD Gascuel, heinrichs weikamp gmbh, all right reserved. |
| 0 | 8 ;============================================================================= |
| 9 ; HISTORY | |
| 10 ; 2011-08-10 : [mH] moving from OSTC code | |
| 11 | |
| 12 ;============================================================================= | |
| 13 | |
| 604 | 14 #include "hwos.inc" ; mandatory header |
| 582 | 15 #include "tft_outputs.inc" |
| 16 #include "strings.inc" | |
| 17 #include "tft.inc" | |
| 18 #include "wait.inc" | |
| 19 #include "surfmode.inc" | |
| 20 #include "convert.inc" | |
| 21 #include "divemode.inc" | |
| 22 #include "i2c.inc" | |
| 23 #include "start.inc" | |
| 634 | 24 #include "colorschemes.inc" |
| 0 | 25 |
| 582 | 26 |
| 634 | 27 extern gaslist_strcat_gas_PRODL |
| 631 | 28 extern char_I_model |
| 623 | 29 |
| 30 IFDEF _compass | |
| 582 | 31 extern TFT_surface_compass_mask |
| 32 extern TFT_dive_compass_mask | |
| 623 | 33 ENDIF |
| 34 | |
| 582 | 35 |
| 634 | 36 #DEFINE num_premenu_items .12 ; overall number of pre-menu items |
| 654 | 37 #DEFINE num_surface_cv .11 ; overall number of surface custom views |
| 623 | 38 |
| 39 | |
| 0 | 40 ;============================================================================= |
| 634 | 41 custview1 CODE |
| 42 ;============================================================================= | |
| 43 | |
| 44 ;----------------------------------------------------------------------------- | |
| 45 ; Jump Table for the every-second Tasks for the Custom View Area (Dive Mode) | |
| 604 | 46 ; |
| 47 ; Attention: the ordering must be in line with the init jump table and the | |
| 48 ; index numbers defined in hwos.inc! | |
| 634 | 49 ; |
| 623 | 50 global dive_customview_second |
| 51 dive_customview_second: | |
| 52 movf active_customview,W ; get current view | |
| 631 | 53 dcfsnz WREG,F ; |
| 54 goto TFT_avr_stopwatch ; 1: average depth and stopwatch | |
| 55 dcfsnz WREG,F ; | |
| 56 IFDEF _compass | |
| 57 return ; 2: compass - will be updated separately (faster) in dive mode | |
| 623 | 58 ELSE |
| 631 | 59 return ; 2: not available without compass |
| 623 | 60 ENDIF |
| 631 | 61 dcfsnz WREG,F ; |
| 656 | 62 IFDEF _external_sensor_eccr |
| 631 | 63 goto TFT_ppo2_sensors ; 3: ppO2 sensors |
| 623 | 64 ELSE |
| 631 | 65 return ; 3: not available without external sensors |
| 623 | 66 ENDIF |
| 631 | 67 dcfsnz WREG,F ; |
| 623 | 68 IFDEF _ccr_pscr |
| 631 | 69 goto TFT_sensor_check ; 4: sensor check |
| 623 | 70 ELSE |
| 631 | 71 return ; 4: not available without CCR / pSCR mode |
| 72 ENDIF | |
| 73 dcfsnz WREG,F ; | |
| 74 IFDEF _ccr_pscr | |
| 75 goto TFT_pscr_info ; 5: pSCR data | |
| 76 ELSE | |
| 77 return ; 5: not available without CCR / pSCR mode | |
| 623 | 78 ENDIF |
| 631 | 79 dcfsnz WREG,F ; |
| 604 | 80 IFDEF _rx_functions |
| 631 | 81 goto TFT_pressures_SAC ; 6: tank pressure and SAC rate |
| 604 | 82 ELSE |
| 631 | 83 return ; 6: not available without RX functions |
| 84 ENDIF | |
| 85 dcfsnz WREG,F ; | |
| 86 goto TFT_gas_needs ; 7: gas needs for ascent / cave return | |
| 87 dcfsnz WREG,F ; | |
| 88 IFDEF _cave_mode | |
| 89 goto TFT_cave_tts ; 8: cave mode TTS | |
| 90 ELSE | |
| 91 return ; 8: not available without cave mode functions | |
| 604 | 92 ENDIF |
| 631 | 93 dcfsnz WREG,F ; |
| 94 goto TFT_decoplan ; 9: deco plan | |
| 95 dcfsnz WREG,F ; | |
| 96 goto TFT_ceiling_GF_tissue ; 10: ceiling, current GF and tissues | |
| 97 dcfsnz WREG,F ; | |
| 656 | 98 goto TFT_ceiling_GF_surfGF ; 11: ceiling, current GF and Surf_GF |
| 631 | 99 dcfsnz WREG,F ; |
| 656 | 100 goto TFT_CNS ; 12: CNS values |
| 631 | 101 dcfsnz WREG,F ; |
| 656 | 102 goto TFT_ppo2_ead_end_cns ; 13: ppO2, END/EAD and CNS / gas density |
| 631 | 103 dcfsnz WREG,F ; |
| 656 | 104 goto TFT_clock_batt_surfpress ; 14: clock, battery and surface pressure |
| 105 dcfsnz WREG,F ; | |
| 106 return ; 15: GF factors - static only | |
| 631 | 107 dcfsnz WREG,F ; |
| 108 IFDEF _cave_mode | |
| 656 | 109 goto TFT_cave_waypoints ; 16: cave waypoints |
| 631 | 110 ELSE |
| 656 | 111 return ; 16: not available without cave mode functions |
| 631 | 112 ENDIF |
| 113 return ; 0: do nothing | |
| 0 | 114 |
| 634 | 115 |
| 116 ;============================================================================= | |
| 117 custview2 CODE | |
| 118 ;============================================================================= | |
| 119 | |
| 120 | |
| 623 | 121 ;----------------------------------------------------------------------------- |
| 634 | 122 ; Show next Surface Custom View |
| 123 ; | |
| 582 | 124 global surf_customview_toggle |
| 0 | 125 surf_customview_toggle: |
| 623 | 126 bcf switch_right ; clear button event |
| 634 | 127 incf active_customview,F ; set number of the next custom view to show |
| 604 | 128 |
| 623 | 129 IFDEF _compass |
| 634 | 130 movlw .6 ; load index of surface custom view compass |
| 131 cpfseq active_customview ; will the compass be shown in custom view? | |
| 132 call I2C_sleep_compass ; NO - can stop the compass to save on energy | |
| 623 | 133 ENDIF |
| 604 | 134 |
| 634 | 135 movlw num_surface_cv ; load number of custom views available |
| 136 cpfsgt active_customview ; beyond last view? | |
| 137 bra surf_customview_mask ; NO - show view | |
| 623 | 138 movlw .1 ; YES - wrap around to 1st view |
| 139 movwf active_customview ; - ... | |
| 634 | 140 ;bra surf_customview_mask ; - show view |
| 623 | 141 |
| 0 | 142 |
| 634 | 143 ;----------------------------------------------------------------------------- |
| 144 ; Show Surface Custom View | |
| 145 ; | |
| 582 | 146 global surf_customview_mask |
| 0 | 147 surf_customview_mask: |
| 634 | 148 |
| 149 ; prepare output of custom view title | |
| 582 | 150 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
| 634 | 151 WIN_TINY surf_customview_title_column,surf_customview_title_row ; set title position |
| 656 | 152 FONT_COLOR color_green ; set title color |
| 623 | 153 |
| 634 | 154 ; jump table |
| 623 | 155 movf active_customview,W ; get custom view to show |
| 156 movff WREG,customview_surfmode ; save number for later recall | |
| 604 | 157 dcfsnz WREG,F ; 1: |
| 158 bra surf_customview_init_view1 ; OC gas list | |
| 159 dcfsnz WREG,F ; 2: | |
| 160 bra surf_customview_init_view2 ; CC dil list | |
| 161 dcfsnz WREG,F ; 3: | |
| 582 | 162 bra surf_customview_init_view3 ; CC SP list |
| 604 | 163 dcfsnz WREG,F ; 4: |
| 164 bra surf_customview_init_view4 ; custom text | |
| 165 dcfsnz WREG,F ; 5: | |
| 166 bra surf_customview_init_view5 ; tissue diagram | |
| 167 dcfsnz WREG,F ; 6: | |
| 168 bra surf_customview_init_view6 ; compass | |
| 169 dcfsnz WREG,F ; 7: | |
| 170 bra surf_customview_init_view7 ; deco settings | |
| 171 dcfsnz WREG,F ; 8: | |
| 172 bra surf_customview_init_view8 ; last dive info | |
| 173 dcfsnz WREG,F ; 9: | |
| 174 bra surf_customview_init_view9 ; sensor mV readings | |
| 175 dcfsnz WREG,F ; 10: | |
| 176 bra surf_customview_init_view10 ; tank data | |
| 654 | 177 dcfsnz WREG,F ; 11: |
| 178 bra surf_customview_init_view11 ; Desat, noFly, CNS screen | |
| 634 | 179 bra surf_customview_init_view4 ; 0: default view after restart and loading of new firmware |
| 623 | 180 |
| 634 | 181 surf_cv_toggle_exit: |
| 182 bcf request_next_custview ; clear request flag | |
| 183 return ; done | |
| 0 | 184 |
| 634 | 185 ; ---- view 1: OC Gas list ---- |
| 186 ; | |
| 187 surf_customview_init_view1: | |
| 623 | 188 btfsc FLAG_gauge_mode ; in gauge mode? |
| 189 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | |
| 190 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 191 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | |
| 192 IFDEF _ccr_pscr | |
| 193 btfss FLAG_oc_mode ; in OC mode? | |
| 194 bra surf_customview_init_view1a ; NO - (1) | |
| 195 ENDIF | |
| 196 STRCPY_TEXT_PRINT tGaslist ; YES - title of custom view / OC mode | |
| 197 IFDEF _ccr_pscr | |
| 198 bra surf_customview_init_view1b ; - continue with common part | |
| 604 | 199 surf_customview_init_view1a: |
| 623 | 200 STRCPY_TEXT_PRINT tDiveBailout ; (1) - title of custom view / CCR & pSCR mode |
| 201 ENDIF | |
| 202 surf_customview_init_view1b: | |
| 634 | 203 call TFT_surf_cv_list_gas ; show gas list |
| 204 bra surf_cv_toggle_exit ; done | |
|
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
205 |
| 623 | 206 |
| 634 | 207 ; ---- view 2: CCR / pSCR diluent list ---- |
| 208 ; | |
| 209 surf_customview_init_view2: | |
| 623 | 210 IFDEF _ccr_pscr |
| 211 btfsc FLAG_ccr_mode ; in CCR mode? | |
| 212 bra surf_customview_init_view2a ; YES - (1) | |
| 213 btfsc FLAG_pscr_mode ; in pSCR mode? | |
| 214 bra surf_customview_init_view2a ; YES - (1) | |
| 215 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view | |
| 604 | 216 surf_customview_init_view2a: |
| 623 | 217 STRCPY_TEXT_PRINT tGaslistCC ; (1) - title of custom view |
| 634 | 218 call TFT_surf_cv_list_dil ; - show diluent list |
| 219 bra surf_cv_toggle_exit ; - done | |
| 623 | 220 ELSE |
| 221 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | |
| 222 ENDIF | |
| 223 | |
| 582 | 224 |
| 634 | 225 ; ---- view 3: CC SP list ---- |
| 226 ; | |
| 227 surf_customview_init_view3: | |
| 623 | 228 IFDEF _ccr_pscr |
| 229 btfss FLAG_ccr_mode ; in CCR mode? | |
| 230 bra surf_customview_toggle ; NO - not available if not in CCR mode, goto next view | |
| 231 STRCPY_TEXT_PRINT tFixedSetpoints ; YES - title of custom view | |
| 634 | 232 call TFT_surf_cv_list_sp ; - show setpoint list |
| 233 bra surf_cv_toggle_exit ; - done | |
| 623 | 234 ELSE |
| 235 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | |
| 236 ENDIF | |
| 237 | |
| 0 | 238 |
| 634 | 239 ; ---- view 4: custom text |
| 240 ; | |
| 241 surf_customview_init_view4: | |
| 242 call TFT_surf_cv_text ; show the custom text | |
| 243 bra surf_cv_toggle_exit ; done | |
| 623 | 244 |
| 0 | 245 |
| 634 | 246 ; ---- view 5: tissue diagram |
| 247 ; | |
| 248 surf_customview_init_view5: | |
| 623 | 249 btfsc FLAG_gauge_mode ; in gauge mode? |
| 250 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | |
| 251 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 252 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | |
| 634 | 253 call TFT_surf_cv_tissues ; show tissue diagram |
| 254 bra surf_cv_toggle_exit ; done | |
| 0 | 255 |
| 623 | 256 |
| 634 | 257 ; ---- view 6: compass |
| 258 ; | |
| 259 surf_customview_init_view6: | |
| 623 | 260 IFDEF _compass |
| 604 | 261 call I2C_init_compass ; start compass |
| 656 | 262 btfss compass_present |
| 263 bra surf_customview_toggle ; not available without compass compiled in, goto next view | |
| 604 | 264 call TFT_surface_compass_mask ; show compass mask |
| 634 | 265 bra surf_cv_toggle_exit ; done |
| 604 | 266 ELSE |
| 623 | 267 bra surf_customview_toggle ; not available without compass compiled in, goto next view |
| 604 | 268 ENDIF |
| 269 | |
| 270 | |
| 634 | 271 ; ---- view 7: deco settings ---- |
| 272 ; | |
| 273 surf_customview_init_view7: | |
| 623 | 274 btfsc FLAG_gauge_mode ; in gauge mode? |
| 275 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | |
| 276 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 277 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | |
| 634 | 278 call TFT_surf_cv_settings ; show all deco settings |
| 279 bra surf_cv_toggle_exit ; done | |
| 280 | |
| 281 | |
| 282 ; ---- view 8: last dive info ---- | |
| 283 ; | |
| 284 surf_customview_init_view8: | |
| 285 call TFT_surf_cv_lastdive ; show last dive info | |
| 286 bra surf_cv_toggle_exit ; done | |
| 623 | 287 |
| 288 | |
| 634 | 289 ; ---- view 9: sensor mV at the surface ---- |
| 290 ; | |
| 291 surf_customview_init_view9: | |
| 656 | 292 IFDEF _external_sensor_eccr |
| 634 | 293 btfsc FLAG_ccr_mode ; in CCR mode? |
| 294 bra surf_customview_init_view9a ; YES - show view | |
| 295 btfsc FLAG_pscr_mode ; NO - in pSCR mode? | |
| 296 bra surf_customview_init_view9a ; YES - show view | |
| 297 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view | |
| 298 | |
| 299 surf_customview_init_view9a: | |
| 300 movff opt_ccr_mode,WREG ; get SP mode (0: fixed SP, 1: Sensor, 2: auto SP) | |
| 301 decfsz WREG,W ; opt_ccr_mode = 1 (sensor)? | |
| 302 bra surf_customview_toggle ; NO - goto next view | |
| 303 STRCPY_TEXT_PRINT tSensorMilliVolt ; YES - title of custom view | |
| 304 call TFT_imprint_surf_mV ; - write sensor mV readings to screen | |
| 305 bra surf_cv_toggle_exit ; - done | |
| 306 ELSE | |
| 307 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | |
| 308 ENDIF | |
| 582 | 309 |
| 0 | 310 |
| 634 | 311 ; ---- view 10: transmitter data / debug ---- |
| 312 ; | |
| 313 surf_customview_init_view10: | |
| 623 | 314 IFDEF _rx_functions |
| 315 btfss tr_functions_activated ; TR functions activated? | |
| 316 bra surf_customview_toggle ; NO - show next view in list | |
| 317 STRCAT_PRINT "ID bar Volt" ; YES - title of custom view (none language-dependent) | |
| 634 | 318 call TFT_surf_cv_tankdata ; - show received data |
| 319 bra surf_cv_toggle_exit ; - done | |
| 623 | 320 ELSE |
| 321 bra surf_customview_toggle ; not available without RX functions compiled in, goto next view | |
| 322 ENDIF | |
| 323 | |
| 654 | 324 ; ---- view 11: Desat, NoFly, CNS ---- |
| 325 ; | |
| 326 surf_customview_init_view11: | |
| 327 btfsc FLAG_gauge_mode ; in gauge mode? | |
| 328 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | |
| 329 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 330 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | |
| 331 call TFT_surf_desat_nofly_cns ; Desat, NoFly, CNS | |
| 332 bra surf_cv_toggle_exit ; done | |
| 634 | 333 |
| 334 ;============================================================================= | |
| 335 custview3 CODE | |
| 336 ;============================================================================= | |
| 337 | |
| 338 | |
| 623 | 339 ;----------------------------------------------------------------------------- |
| 634 | 340 ; Show next Pre-Menu Item / Clear the Pre-Menu |
| 341 ; | |
| 582 | 342 global menuview_toggle |
| 634 | 343 menuview_toggle: |
| 623 | 344 bcf switch_left ; clear button event |
| 345 movlw divemode_timeout_premenu ; get timeout for dive mode pre-menu | |
| 634 | 346 call restart_timeout_time ; restart the timeout |
| 347 bsf dive_pre_menu ; flag that the pre-menu is shown | |
| 348 menuview_next_item: | |
| 349 incf active_premenu,F ; increment pre-menu item number | |
| 350 movlw num_premenu_items ; get number of pre-menu items | |
| 351 cpfsgt active_premenu ; beyond last item? | |
| 623 | 352 bra menuview_mask ; NO - show item |
| 634 | 353 ;bra menuview_toggle_reset ; YES - reset to first item |
| 354 | |
| 355 global menuview_toggle_reset | |
| 356 menuview_toggle_reset: | |
| 357 clrf active_premenu ; reset pre-menu item number | |
| 358 bcf dive_pre_menu ; flag that the pre-menu is not shown anymore | |
| 359 ;bra menuview_mask ; clear last item from display | |
| 360 | |
| 0 | 361 menuview_mask: |
| 623 | 362 WIN_BOX_BLACK dm_premenu_row, dm_premenu_bot, dm_premenu_col, dm_premenu_rgt ; top, bottom, left, right |
| 634 | 363 btfsc dive_pre_menu ; shall show pre-menu? |
| 364 bra menuview_show_item ; YES - show menu item | |
| 365 ;bra menuview_exit ; NO - done with pre-menu | |
| 631 | 366 |
| 634 | 367 menuview_exit: |
| 368 bcf win_invert ; clear inverse printing | |
| 369 btfss dive_pre_menu ; showing pre-menu? | |
| 370 goto TFT_show_temp_divemode ; NO - restore temperature display and return | |
| 371 return ; YES - done | |
| 372 | |
| 373 menuview_show_item: | |
| 374 WIN_SMALL dm_premenu_col,dm_premenu_row | |
| 375 FONT_COLOR_ATTENTION ; set color | |
| 623 | 376 bsf win_invert ; set inverse printing |
| 377 movf active_premenu,W ; get active pre-menu item | |
| 0 | 378 dcfsnz WREG,F |
| 631 | 379 bra menuview_view_gaschange ; 1: gas change (skipped if no better gas/dil cued) |
| 137 | 380 dcfsnz WREG,F |
| 634 | 381 bra menuview_view_ackn ; 2: "Ackn?" (skipped if no active advice/attention/warning sign) |
| 382 dcfsnz WREG,F | |
| 383 bra menuview_view_divemenu ; 3: "Menu?" (skipped in gauge and apnoe modes) | |
|
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
384 dcfsnz WREG,F |
| 631 | 385 IFDEF _cave_mode |
| 634 | 386 bra menuview_view_cavemenu ; 4: "Cave?" (skipped if not in cave mode) |
| 631 | 387 ELSE |
| 634 | 388 bra menuview_next_item ; 4: cave mode not implemented, goto next item |
| 631 | 389 ENDIF |
| 0 | 390 dcfsnz WREG,F |
| 634 | 391 bra menuview_view_sim_quit ; 5: "Quit?" (in simulation mode only) |
| 0 | 392 dcfsnz WREG,F |
| 634 | 393 bra menuview_view_sim_down ; 6: "Sim down" (in simulation mode only) |
| 0 | 394 dcfsnz WREG,F |
| 634 | 395 bra menuview_view_sim_up ; 7: "Sim up" (in simulation mode only) |
| 0 | 396 dcfsnz WREG,F |
| 634 | 397 bra menuview_view_sim_time ; 8: "Sim+5'" (in simulation mode only) |
| 631 | 398 dcfsnz WREG,F |
| 634 | 399 bra menuview_view_apnoe_quit ; 9: "Quit?" (in apnoe mode only) |
| 0 | 400 dcfsnz WREG,F |
| 634 | 401 bra menuview_view_gauge_reset ; 10: "Reset Avr" (in gauge mode only) |
|
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
402 dcfsnz WREG,F |
| 634 | 403 IFDEF _compass |
| 404 bra menuview_view_course ; 11: "Course" (only when compass is shown) | |
| 405 ELSE | |
| 406 bra menuview_next_item ; 11: compass not implemented, goto next item | |
| 407 ENDIF | |
| 408 dcfsnz WREG,F | |
| 409 bra menuview_view_layout ; 12: "Layout" (offer alternative layout, aka blind mode) | |
| 410 bra menuview_exit ; catch illegal item number | |
| 411 ; when adding or removing items, adjust the value num_premenu_items in the #DEFINE ! | |
| 137 | 412 |
| 413 | |
| 634 | 414 ; --- item 1: gas change advice --- |
| 415 ; | |
| 137 | 416 menuview_view_gaschange: |
| 634 | 417 btfsc request_gas_change ; last gas change request already executed? |
| 418 bra menuview_next_item ; YES - goto next option | |
| 623 | 419 IFDEF _ccr_pscr |
| 604 | 420 btfsc FLAG_oc_mode ; in OC mode? |
| 421 bra menuview_view_gaschange_OC ; YES | |
| 623 | 422 btfsc bailout_mode ; in bailout? |
| 604 | 423 bra menuview_view_gaschange_OC ; YES |
| 424 menuview_view_gaschange_DIL: | |
| 425 btfss better_dil_available ; is the better diluent still available? | |
| 634 | 426 bra menuview_next_item ; NO - goto next item |
| 604 | 427 movff best_dil_number,PRODL ; number (1-5) of the "best diluent" |
| 623 | 428 bsf is_diluent_menu ; setting up diluents |
| 634 | 429 bra menuview_view_gaschange_com ; continue with common part |
| 430 ENDIF ; _ccr_pscr | |
| 604 | 431 menuview_view_gaschange_OC: |
| 432 btfss better_gas_available ; is the better gas still available? | |
| 634 | 433 bra menuview_next_item ; NO - goto next item |
| 434 movff best_gas_number,PRODL ; YES - number (1-5) of the "best gas" | |
| 435 bcf is_diluent_menu ; - setting up OC gases | |
| 604 | 436 menuview_view_gaschange_com: |
| 437 decf PRODL,F ; (1-5) -> (0-4) | |
| 634 | 438 bsf short_gas_descriptions ; use short version of gaslist_strcat_gas_PRODL and gaslist_strcat_setpoint |
| 604 | 439 bsf better_gas_hint ; color-code as best gas/diluent |
| 634 | 440 call gaslist_strcat_gas_PRODL ; append gas description of gas #PRODL (0-4) to current string |
| 631 | 441 movlw .5 ; point to 6th character (5 chars are used for the gas/dil description) |
| 442 movwf FSR2L ; ... | |
| 634 | 443 PUTC_PRINT "?" ; append question and dump buffer to screen |
| 604 | 444 bra menuview_exit ; done |
| 445 | |
| 634 | 446 ; ---- item 2: acknowledge ---- |
| 447 ; | |
| 448 menuview_view_ackn: | |
| 449 btfss sign_shown ; advice, attention or warning sign shown? | |
| 450 bra menuview_next_item ; NO - goto next item | |
| 451 STRCAT_TEXT_PRINT tDiveAckn ; YES - print "Ackn?" | |
| 452 bra menuview_exit ; - done | |
| 453 | |
| 454 | |
| 455 ; ---- item 3: dive menu ---- | |
| 456 ; | |
| 631 | 457 menuview_view_divemenu: |
| 623 | 458 btfsc FLAG_apnoe_mode ; in apnoe mode? |
| 634 | 459 bra menuview_next_item ; YES - goto next item |
| 623 | 460 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
| 634 | 461 bra menuview_next_item ; YES - goto next item |
| 623 | 462 PUTC "\xb7" ; NO - print '->' symbol |
| 463 STRCAT_TEXT_PRINT tDivePreMenu ; - print "Menu?" | |
| 464 bra menuview_exit ; - done | |
| 604 | 465 |
| 634 | 466 |
| 467 ; ---- item 4: cave menu ---- | |
| 468 ; | |
| 631 | 469 IFDEF _cave_mode |
| 470 menuview_view_cavemenu: | |
| 471 TSTOSS opt_cave_mode ; cave mode switched on? | |
| 634 | 472 bra menuview_next_item ; NO - goto next item |
| 631 | 473 PUTC "\xb7" ; YES - print '->' symbol |
| 474 STRCAT_TEXT_PRINT tDivePreCave ; - print "Cave?" | |
| 475 bra menuview_exit ; - done | |
| 634 | 476 ENDIF ; _cave_mode |
| 477 | |
| 631 | 478 |
| 634 | 479 ; ---- item 5: quit simulator --- |
| 480 ; | |
| 631 | 481 menuview_view_sim_quit: |
| 623 | 482 btfss simulatormode ; in simulator mode? |
| 634 | 483 bra menuview_next_item ; NO - goto next item |
| 623 | 484 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Simulation?" |
| 485 bra menuview_exit ; - done | |
| 604 | 486 |
| 634 | 487 |
| 488 ; ---- item 6: simulator - go down ---- | |
| 489 ; | |
| 631 | 490 menuview_view_sim_down: |
| 623 | 491 btfss simulatormode ; in simulator mode? |
| 634 | 492 bra menuview_next_item ; NO - goto next item |
| 604 | 493 STRCPY_PRINT "Sim\xb8" ; print down arrow for going down |
| 494 bra menuview_exit ; done | |
| 495 | |
| 634 | 496 |
| 497 ; ---- item 7: simulator - go up ---- | |
| 498 ; | |
| 631 | 499 menuview_view_sim_up: |
| 623 | 500 btfss simulatormode ; in simulator mode? |
| 634 | 501 bra menuview_next_item ; NO - goto next item |
| 623 | 502 STRCPY_PRINT "Sim\xb9" ; YES - print up arrow for going up |
| 503 bra menuview_exit ; - done | |
| 604 | 504 |
| 634 | 505 |
| 506 ; ---- item 8: simulator - advance time ---- | |
| 507 ; | |
| 631 | 508 menuview_view_sim_time: |
| 623 | 509 btfss simulatormode ; in simulator mode? |
| 634 | 510 bra menuview_next_item ; NO - goto next item |
| 623 | 511 btfsc FLAG_gauge_mode ; YES - in gauge mode? |
| 634 | 512 bra menuview_next_item ; YES - goto next item |
| 623 | 513 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? |
| 634 | 514 bra menuview_next_item ; YES - goto next item |
| 623 | 515 STRCPY_PRINT "Sim+5'" ; NO - print "Sim+5'" |
| 516 bra menuview_exit ; - done | |
| 604 | 517 |
| 634 | 518 |
| 519 ; ---- item 9: apnoe mode - quit ---- | |
| 520 ; | |
| 631 | 521 menuview_view_apnoe_quit: |
| 522 btfss FLAG_apnoe_mode ; in apnoe mode? | |
| 634 | 523 bra menuview_next_item ; NO - goto next option |
| 631 | 524 btfss apnoe_at_surface ; YES - at the surface? |
| 634 | 525 bra menuview_next_item ; NO - goto next item |
| 631 | 526 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Apnea mode?" |
| 527 bra menuview_exit ; - done | |
| 528 | |
| 634 | 529 |
| 530 ; ---- item 10: gauge mode - reset average ---- | |
| 531 ; | |
| 631 | 532 menuview_view_gauge_reset: |
| 533 btfss FLAG_gauge_mode ; in gauge mode? | |
| 634 | 534 bra menuview_next_item ; NO - goto next item |
| 631 | 535 STRCPY_TEXT_PRINT tResetAvg ; YES - print "Reset Avg." |
| 536 bra menuview_exit ; - done | |
| 537 | |
| 634 | 538 |
| 539 ; ---- item 11: set bearing ---- | |
| 540 IFDEF _compass | |
| 631 | 541 menuview_view_course: |
| 604 | 542 movlw index_compass_dm ; index of compass view |
| 623 | 543 cpfseq active_customview ; in compass view? |
| 634 | 544 bra menuview_next_item ; NO - goto next item |
| 623 | 545 STRCPY_TEXT_PRINT tSetHeading ; YES - print "Heading" |
| 546 bra menuview_exit ; - done | |
| 547 ENDIF | |
| 604 | 548 |
| 634 | 549 |
| 550 ; ---- item 12: switch layout ---- | |
| 551 ; | |
| 631 | 552 menuview_view_layout: |
| 623 | 553 btfsc FLAG_apnoe_mode ; in apnoe mode? |
| 634 | 554 bra menuview_next_item ; YES - goto next item |
| 628 | 555 STRCPY_TEXT_PRINT tDiveLayout ; NO - print "Layout" |
| 623 | 556 bra menuview_exit ; - done |
| 582 | 557 |
| 634 | 558 |
| 559 ;============================================================================= | |
| 560 custview4 CODE | |
| 561 ;============================================================================= | |
| 604 | 562 |
| 631 | 563 |
| 634 | 564 ;----------------------------------------------------------------------------- |
| 565 ; Show a specific Dive Mode Custom View | |
| 566 ; | |
| 631 | 567 global dive_customview_show |
| 568 dive_customview_show: | |
| 569 btfss custom_view_locked ; custom view locked? | |
| 570 bra dive_customview_show_1 ; NO - call-up the view | |
| 571 movwf backup_customview ; YES - store requested custom view for later recall | |
| 572 return ; - done | |
| 573 dive_customview_show_1: | |
| 574 movwf active_customview ; set the requested custom view | |
| 575 bra dive_customview_callup ; call-up the custom view | |
| 576 | |
| 634 | 577 |
| 578 ;----------------------------------------------------------------------------- | |
| 579 ; Show again last Dive Mode Custom View | |
| 580 ; | |
| 631 | 581 global dive_customview_recall |
| 582 dive_customview_recall: | |
| 583 movff backup_customview,active_customview ; recall the saved custom view | |
| 584 bra dive_customview_callup ; call-up the custom view | |
| 585 | |
| 634 | 586 |
| 587 ;----------------------------------------------------------------------------- | |
| 588 ; Show next Dive Mode Custom View | |
| 589 ; | |
| 623 | 590 global dive_customview_toggle |
| 591 dive_customview_toggle: | |
| 592 incf active_customview,F ; increment number of custom view to show | |
| 634 | 593 movlw index_cv_dm_max ; get highest index in use in dive mode custom view |
| 594 cpfsgt active_customview ; beyond last view? | |
| 631 | 595 bra dive_customview_callup ; NO - call-up the custom view |
| 596 clrf active_customview ; YES - reset to zero (zero = blank custom view) | |
| 597 ;bra dive_customview_callup ; call-up the custom view | |
| 598 | |
| 634 | 599 |
| 600 ;----------------------------------------------------------------------------- | |
| 601 ; Show current Dive Mode Custom View | |
| 602 ; | |
| 631 | 603 global dive_customview_callup |
| 604 dive_customview_callup: | |
| 605 movlw index_compass_dm ; get index of compass custom view | |
| 606 cpfseq active_customview ; will compass be shown? | |
| 634 | 607 call I2C_sleep_compass ; NO - stop compass to save on energy |
| 582 | 608 |
| 623 | 609 ; clear custom view area in dive mode |
| 604 | 610 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right |
| 634 | 611 |
| 612 ; jump table | |
| 623 | 613 movf active_customview,W ; get custom view to show |
| 631 | 614 dcfsnz WREG,F ; |
| 615 bra init_avr_stopwatch ; 1: average depth and stopwatch | |
| 616 dcfsnz WREG,F ; | |
| 617 bra init_TFT_dive_compass ; 2: compass | |
| 618 dcfsnz WREG,F ; | |
| 619 bra init_ppo2_sensors ; 3: ppO2 sensors | |
| 620 dcfsnz WREG,F ; | |
| 621 bra init_sensor_check ; 4: sensor check | |
| 622 dcfsnz WREG,F ; | |
| 623 bra init_pscr_info ; 5: pSCR data | |
| 624 dcfsnz WREG,F ; | |
| 625 bra init_pressures_SAC ; 6: tank pressure and SAC rate | |
| 626 dcfsnz WREG,F ; | |
| 627 bra init_gas_needs_ascent ; 7: gas needs for ascent / cave return | |
| 628 dcfsnz WREG,F ; | |
| 629 bra init_cave_tts ; 8: cave mode TTS | |
| 630 dcfsnz WREG,F ; | |
| 631 bra init_decoplan ; 9: deco plan (next stops) | |
| 632 dcfsnz WREG,F ; | |
| 633 bra init_ceiling_GF_tissue ; 10: ceiling, current GF and tissues | |
| 634 dcfsnz WREG,F ; | |
| 656 | 635 bra init_ceiling_GF_surfGF ; 11: ceiling, current GF and surfGF |
| 631 | 636 dcfsnz WREG,F ; |
| 656 | 637 bra init_CNS ; 12: CNS values |
| 638 dcfsnz WREG,F ; | |
| 639 bra init_ppo2_ead_end_cns ; 13: ppO2, END/EAD and CNS/gas density | |
| 631 | 640 dcfsnz WREG,F ; |
| 656 | 641 bra init_clock_batt_surfpress ; 14: clock, battery and surface pressure |
| 631 | 642 dcfsnz WREG,F ; |
| 656 | 643 bra init_gf_factors ; 15: GF factors |
| 631 | 644 dcfsnz WREG,F ; |
| 656 | 645 bra init_cave_waypoints ; 16: cave waypoints |
| 634 | 646 ;bra dive_cv_toggle_exit ; 0: no view (blank screen in custom view area) |
| 647 | |
| 648 dive_cv_toggle_exit: | |
| 649 bcf request_next_custview ; clear request flag | |
| 650 return ; done | |
| 582 | 651 |
| 0 | 652 |
| 634 | 653 ; ---- view 1: average depth and stopwatch ---- |
| 654 ; | |
| 604 | 655 init_avr_stopwatch: |
| 656 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 623 | 657 bra dive_customview_toggle ; YES - goto next view |
| 658 call TFT_avr_stopwatch_mask ; NO - mask for average depth and stopwatch | |
| 659 call TFT_avr_stopwatch ; - data for average depth and stopwatch | |
| 634 | 660 bra dive_cv_toggle_exit ; - done |
| 661 | |
| 0 | 662 |
| 634 | 663 ; ---- view 2: compass ---- |
| 664 ; | |
| 665 init_TFT_dive_compass: | |
| 623 | 666 IFDEF _compass |
| 604 | 667 call I2C_init_compass ; start compass |
| 656 | 668 btfss compass_present |
| 669 bra dive_customview_toggle ; not available without compass compiled in, goto next view | |
| 634 | 670 call TFT_dive_compass_mask ; mask for compass |
| 671 bra dive_cv_toggle_exit ; done | |
| 623 | 672 ELSE |
| 673 bra dive_customview_toggle ; not available without compass compiled in, goto next view | |
| 674 ENDIF | |
|
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
675 |
| 634 | 676 |
| 677 ; ---- view 3: ppO2 sensors --- | |
| 678 ; | |
| 679 init_ppo2_sensors: | |
| 656 | 680 IFDEF _external_sensor_eccr |
| 634 | 681 bsf trigger_temp_changed ; fake a change of the temperature to have the resettable dive time overwritten which was shown with the compass view |
| 682 btfsc FLAG_ccr_mode ; in CC mode? | |
| 683 bra init_ppo2_sensors_1 ; YES | |
| 684 btfsc FLAG_pscr_mode ; in pSCR mode? | |
| 685 bra init_ppo2_sensors_1 ; YES | |
| 686 bra dive_customview_toggle ; NO to both, goto next view | |
| 687 init_ppo2_sensors_1: | |
| 688 btfsc ext_input_s8_ana ; do we have an S8/analog input? | |
| 689 bra init_ppo2_sensors_2 ; YES - show this view | |
| 690 btfsc ext_input_optical ; NO - do we have an optical input? | |
| 691 bra init_ppo2_sensors_2 ; YES - show this view | |
| 656 | 692 btfsc ext_s8_full_digital ; NO - are we in external S8 full digital mode? |
| 693 bra init_ppo2_sensors_2 ; YES - show this view | |
| 634 | 694 bra dive_customview_toggle ; NO - goto next view |
| 695 | |
| 696 init_ppo2_sensors_2: | |
| 697 call TFT_ppo2_sensors_mask ; mask for ppO2 sensors | |
| 698 call TFT_ppo2_sensors ; data for ppO2 sensors | |
| 699 bra dive_cv_toggle_exit ; done | |
| 700 ELSE | |
| 701 bra dive_customview_toggle ; not available without external sensors, got next view | |
| 702 ENDIF | |
| 703 | |
| 704 ; ---- view 4: sensor check ---- | |
| 705 ; | |
| 706 init_sensor_check: | |
| 707 IFDEF _ccr_pscr | |
| 708 btfss FLAG_ccr_mode ; in CCR mode? | |
| 709 bra dive_customview_toggle ; NO - goto next view | |
| 710 call TFT_sensor_check_mask ; YES - mask for sensor check | |
| 711 call TFT_sensor_check ; - data for sensor check | |
| 712 bra dive_cv_toggle_exit ; - done | |
| 713 ELSE | |
| 714 bra dive_customview_toggle ; not available without CCR mode compiled in, goto next view | |
| 715 ENDIF | |
| 716 | |
| 717 | |
| 718 ; ---- view 5: pSCR data ---- | |
| 719 ; | |
| 720 init_pscr_info: | |
| 721 IFDEF _ccr_pscr | |
| 722 btfss FLAG_pscr_mode ; in pSCR mode? | |
| 723 bra dive_customview_toggle ; NO - goto next view | |
| 724 call TFT_pscr_info_mask ; YES - mask for pSCR info | |
| 725 call TFT_pscr_info ; - data for pSCR info | |
| 726 bra dive_cv_toggle_exit ; - done | |
| 727 ELSE | |
| 728 bra dive_customview_toggle ; not available without CCR / pSCR mode, goto next view | |
| 729 ENDIF | |
| 730 | |
| 731 | |
| 732 ; view 6: tank pressure and SAC rate ---- | |
| 733 ; | |
| 734 init_pressures_SAC: | |
| 604 | 735 IFDEF _rx_functions |
| 623 | 736 btfss tr_functions_activated ; TR functions activated? |
| 737 bra dive_customview_toggle ; NO - goto next view | |
| 738 call TFT_pressures_SAC_mask ; YES - mask for pressures and SAC | |
| 739 call TFT_pressures_SAC ; - data for pressures and SAC | |
| 634 | 740 bra dive_cv_toggle_exit ; - done |
| 604 | 741 ELSE |
| 623 | 742 bra dive_customview_toggle ; not available without RX functions, got next view |
| 604 | 743 ENDIF |
|
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
744 |
|
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
745 |
| 634 | 746 ; ---- view 7: gas needs ---- |
| 747 ; | |
| 748 init_gas_needs_ascent: | |
| 604 | 749 btfsc FLAG_apnoe_mode ; in apnoe mode? |
| 623 | 750 bra dive_customview_toggle ; YES - goto next view |
| 751 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
| 752 bra dive_customview_toggle ; YES - goto next view | |
| 631 | 753 TSTOSS opt_calc_gasvolume ; NO - check if gas volume calculation is switched on |
| 623 | 754 bra dive_customview_toggle ; NO - goto next view |
| 631 | 755 call TFT_gas_needs_mask ; YES - mask for gas needs ascent |
| 756 call TFT_gas_needs ; - data for gas needs ascent | |
| 634 | 757 bra dive_cv_toggle_exit ; - done |
| 758 | |
| 582 | 759 |
| 634 | 760 ; ---- view 8: cave mode TTS ---- |
| 761 init_cave_tts: | |
| 631 | 762 IFDEF _cave_mode |
| 763 btfss cave_mode ; in cave mode? | |
| 764 bra dive_customview_toggle ; NO - goto next view | |
| 765 call TFT_cave_tts_mask ; YES - show mask | |
| 766 call TFT_cave_tts ; - show data | |
| 634 | 767 bra dive_cv_toggle_exit ; - done |
| 631 | 768 ELSE |
| 769 bra dive_customview_toggle ; not available without cave mode, goto next view | |
| 770 ENDIF | |
| 771 | |
| 772 | |
| 634 | 773 ; ---- view 9: deco plan ---- |
| 774 ; | |
| 775 init_decoplan: | |
| 776 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 777 bra dive_customview_toggle ; YES - goto next view | |
| 778 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
| 779 bra dive_customview_toggle ; YES - goto next view | |
| 780 call TFT_decoplan_mask ; NO - mask for deco plan | |
| 781 call TFT_decoplan ; - data for deco plan | |
| 782 bra dive_cv_toggle_exit ; - done | |
| 783 | |
| 784 | |
| 785 ; ---- view 10: ceiling, tissues and current GF | |
| 786 ; | |
| 787 init_ceiling_GF_tissue: | |
| 788 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 789 bra dive_customview_toggle ; YES - goto next view | |
| 790 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
| 791 bra dive_customview_toggle ; YES - call next view | |
| 792 call TFT_ceiling_GF_tissue_mask ; NO - mask for ceiling, current GF and tissues | |
| 793 call TFT_ceiling_GF_tissue ; - data for ceiling, current GF and tissues | |
| 794 bra dive_cv_toggle_exit ; - done | |
| 795 | |
| 656 | 796 ; ---- view 11: ceiling, tissues and surf GF |
| 797 ; | |
| 798 init_ceiling_GF_surfGF: | |
| 799 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 800 bra dive_customview_toggle ; YES - goto next view | |
| 801 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
| 802 bra dive_customview_toggle ; YES - call next view | |
| 803 movff char_I_model,WREG ; get model | |
| 804 iorwf WREG ; GF enabled? | |
| 805 bnz init_ceiling_GF_surfGF1 ; YES | |
| 806 bra dive_customview_toggle ; NO - call next view | |
| 807 init_ceiling_GF_surfGF1: | |
| 808 call TFT_ceiling_GF_surfGF_mask ; NO - mask for ceiling, current GF and surf GF | |
| 809 call TFT_ceiling_GF_surfGF ; - data for ceiling, current GF and surf GF | |
| 810 bra dive_cv_toggle_exit ; - done | |
| 811 | |
| 634 | 812 |
| 656 | 813 ; ---- view 12: CNS values ---- |
| 634 | 814 ; |
| 815 init_CNS: ; CNS at end of dive | |
| 816 btfsc FLAG_gauge_mode ; in gauge mode? | |
| 817 bra dive_customview_toggle ; YES - call next view | |
| 818 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? | |
| 819 bra dive_customview_toggle ; YES - call next view | |
| 820 call TFT_CNS_mask ; NO - mask for CNS values | |
| 821 call TFT_CNS ; - data for CNS values | |
| 822 bra dive_cv_toggle_exit ; - done | |
| 823 | |
| 824 | |
| 656 | 825 ; ---- view 13: ppO2, END/EAD and CNS/gas density ---- |
| 634 | 826 ; |
| 827 init_ppo2_ead_end_cns: ; | |
| 828 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 829 bra dive_customview_toggle ; YES - goto next view | |
| 830 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
| 831 bra dive_customview_toggle ; YES - goto next view | |
| 832 call TFT_ppo2_ead_end_cns_mask ; NO - mask for ppO2, END/EAD and CNS | |
| 833 call TFT_ppo2_ead_end_cns ; - data for ppO2, END/EAD and CNS | |
| 834 bra dive_cv_toggle_exit ; - done | |
| 835 | |
| 836 | |
| 656 | 837 ; ---- view 14: clock, battery and surface pressure |
| 634 | 838 ; |
| 839 init_clock_batt_surfpress: | |
| 840 call TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure | |
| 841 call TFT_clock_batt_surfpress ; data for clock, battery and surface pressure | |
| 842 bra dive_cv_toggle_exit ; done | |
| 843 | |
| 844 | |
| 656 | 845 ; ---- view 15: GF factors |
| 634 | 846 ; |
| 847 init_gf_factors: | |
| 848 call TFT_gf_factors_mask ; show GF factors | |
| 849 bra dive_cv_toggle_exit ; done | |
| 850 | |
| 851 | |
| 656 | 852 ; ---- view 16: cave waypoints ---- |
| 634 | 853 ; |
| 854 init_cave_waypoints: | |
| 855 IFDEF _cave_mode | |
| 856 call TFT_cave_waypoints ; show waypoint graphics | |
| 857 bra dive_cv_toggle_exit ; done | |
| 858 ELSE | |
| 859 bra dive_customview_toggle ; not available without cave mode, goto next view | |
| 860 ENDIF | |
| 0 | 861 |
| 623 | 862 ;----------------------------------------------------------------------------- |
| 0 | 863 |
| 623 | 864 END |
