Mercurial > public > hwos_code
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 655:c7b7b8a358cd | 656:8af5aefbcdaf |
|---|---|
| 57 return ; 2: compass - will be updated separately (faster) in dive mode | 57 return ; 2: compass - will be updated separately (faster) in dive mode |
| 58 ELSE | 58 ELSE |
| 59 return ; 2: not available without compass | 59 return ; 2: not available without compass |
| 60 ENDIF | 60 ENDIF |
| 61 dcfsnz WREG,F ; | 61 dcfsnz WREG,F ; |
| 62 IFDEF _external_sensor | 62 IFDEF _external_sensor_eccr |
| 63 goto TFT_ppo2_sensors ; 3: ppO2 sensors | 63 goto TFT_ppo2_sensors ; 3: ppO2 sensors |
| 64 ELSE | 64 ELSE |
| 65 return ; 3: not available without external sensors | 65 return ; 3: not available without external sensors |
| 66 ENDIF | 66 ENDIF |
| 67 dcfsnz WREG,F ; | 67 dcfsnz WREG,F ; |
| 93 dcfsnz WREG,F ; | 93 dcfsnz WREG,F ; |
| 94 goto TFT_decoplan ; 9: deco plan | 94 goto TFT_decoplan ; 9: deco plan |
| 95 dcfsnz WREG,F ; | 95 dcfsnz WREG,F ; |
| 96 goto TFT_ceiling_GF_tissue ; 10: ceiling, current GF and tissues | 96 goto TFT_ceiling_GF_tissue ; 10: ceiling, current GF and tissues |
| 97 dcfsnz WREG,F ; | 97 dcfsnz WREG,F ; |
| 98 goto TFT_CNS ; 11: CNS values | 98 goto TFT_ceiling_GF_surfGF ; 11: ceiling, current GF and Surf_GF |
| 99 dcfsnz WREG,F ; | 99 dcfsnz WREG,F ; |
| 100 goto TFT_ppo2_ead_end_cns ; 12: ppO2, END/EAD and CNS / gas density | 100 goto TFT_CNS ; 12: CNS values |
| 101 dcfsnz WREG,F ; | 101 dcfsnz WREG,F ; |
| 102 goto TFT_clock_batt_surfpress ; 13: clock, battery and surface pressure | 102 goto TFT_ppo2_ead_end_cns ; 13: ppO2, END/EAD and CNS / gas density |
| 103 dcfsnz WREG,F ; | 103 dcfsnz WREG,F ; |
| 104 return ; 14: GF factors - static only | 104 goto TFT_clock_batt_surfpress ; 14: clock, battery and surface pressure |
| 105 dcfsnz WREG,F ; | |
| 106 return ; 15: GF factors - static only | |
| 105 dcfsnz WREG,F ; | 107 dcfsnz WREG,F ; |
| 106 IFDEF _cave_mode | 108 IFDEF _cave_mode |
| 107 goto TFT_cave_waypoints ; 15: cave waypoints | 109 goto TFT_cave_waypoints ; 16: cave waypoints |
| 108 ELSE | 110 ELSE |
| 109 return ; 15: not available without cave mode functions | 111 return ; 16: not available without cave mode functions |
| 110 ENDIF | 112 ENDIF |
| 111 return ; 0: do nothing | 113 return ; 0: do nothing |
| 112 | 114 |
| 113 | 115 |
| 114 ;============================================================================= | 116 ;============================================================================= |
| 145 surf_customview_mask: | 147 surf_customview_mask: |
| 146 | 148 |
| 147 ; prepare output of custom view title | 149 ; prepare output of custom view title |
| 148 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right | 150 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
| 149 WIN_TINY surf_customview_title_column,surf_customview_title_row ; set title position | 151 WIN_TINY surf_customview_title_column,surf_customview_title_row ; set title position |
| 150 FONT_COLOR color_greenish ; set title color | 152 FONT_COLOR color_green ; set title color |
| 151 | 153 |
| 152 ; jump table | 154 ; jump table |
| 153 movf active_customview,W ; get custom view to show | 155 movf active_customview,W ; get custom view to show |
| 154 movff WREG,customview_surfmode ; save number for later recall | 156 movff WREG,customview_surfmode ; save number for later recall |
| 155 dcfsnz WREG,F ; 1: | 157 dcfsnz WREG,F ; 1: |
| 255 ; ---- view 6: compass | 257 ; ---- view 6: compass |
| 256 ; | 258 ; |
| 257 surf_customview_init_view6: | 259 surf_customview_init_view6: |
| 258 IFDEF _compass | 260 IFDEF _compass |
| 259 call I2C_init_compass ; start compass | 261 call I2C_init_compass ; start compass |
| 262 btfss compass_present | |
| 263 bra surf_customview_toggle ; not available without compass compiled in, goto next view | |
| 260 call TFT_surface_compass_mask ; show compass mask | 264 call TFT_surface_compass_mask ; show compass mask |
| 261 bra surf_cv_toggle_exit ; done | 265 bra surf_cv_toggle_exit ; done |
| 262 ELSE | 266 ELSE |
| 263 bra surf_customview_toggle ; not available without compass compiled in, goto next view | 267 bra surf_customview_toggle ; not available without compass compiled in, goto next view |
| 264 ENDIF | 268 ENDIF |
| 283 | 287 |
| 284 | 288 |
| 285 ; ---- view 9: sensor mV at the surface ---- | 289 ; ---- view 9: sensor mV at the surface ---- |
| 286 ; | 290 ; |
| 287 surf_customview_init_view9: | 291 surf_customview_init_view9: |
| 288 IFDEF _external_sensor | 292 IFDEF _external_sensor_eccr |
| 289 btfsc FLAG_ccr_mode ; in CCR mode? | 293 btfsc FLAG_ccr_mode ; in CCR mode? |
| 290 bra surf_customview_init_view9a ; YES - show view | 294 bra surf_customview_init_view9a ; YES - show view |
| 291 btfsc FLAG_pscr_mode ; NO - in pSCR mode? | 295 btfsc FLAG_pscr_mode ; NO - in pSCR mode? |
| 292 bra surf_customview_init_view9a ; YES - show view | 296 bra surf_customview_init_view9a ; YES - show view |
| 293 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view | 297 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view |
| 626 dcfsnz WREG,F ; | 630 dcfsnz WREG,F ; |
| 627 bra init_decoplan ; 9: deco plan (next stops) | 631 bra init_decoplan ; 9: deco plan (next stops) |
| 628 dcfsnz WREG,F ; | 632 dcfsnz WREG,F ; |
| 629 bra init_ceiling_GF_tissue ; 10: ceiling, current GF and tissues | 633 bra init_ceiling_GF_tissue ; 10: ceiling, current GF and tissues |
| 630 dcfsnz WREG,F ; | 634 dcfsnz WREG,F ; |
| 631 bra init_CNS ; 11: CNS values | 635 bra init_ceiling_GF_surfGF ; 11: ceiling, current GF and surfGF |
| 632 dcfsnz WREG,F ; | 636 dcfsnz WREG,F ; |
| 633 bra init_ppo2_ead_end_cns ; 12: ppO2, END/EAD and CNS/gas density | 637 bra init_CNS ; 12: CNS values |
| 634 dcfsnz WREG,F ; | 638 dcfsnz WREG,F ; |
| 635 bra init_clock_batt_surfpress ; 13: clock, battery and surface pressure | 639 bra init_ppo2_ead_end_cns ; 13: ppO2, END/EAD and CNS/gas density |
| 636 dcfsnz WREG,F ; | 640 dcfsnz WREG,F ; |
| 637 bra init_gf_factors ; 14: GF factors | 641 bra init_clock_batt_surfpress ; 14: clock, battery and surface pressure |
| 638 dcfsnz WREG,F ; | 642 dcfsnz WREG,F ; |
| 639 bra init_cave_waypoints ; 15: cave waypoints | 643 bra init_gf_factors ; 15: GF factors |
| 644 dcfsnz WREG,F ; | |
| 645 bra init_cave_waypoints ; 16: cave waypoints | |
| 640 ;bra dive_cv_toggle_exit ; 0: no view (blank screen in custom view area) | 646 ;bra dive_cv_toggle_exit ; 0: no view (blank screen in custom view area) |
| 641 | 647 |
| 642 dive_cv_toggle_exit: | 648 dive_cv_toggle_exit: |
| 643 bcf request_next_custview ; clear request flag | 649 bcf request_next_custview ; clear request flag |
| 644 return ; done | 650 return ; done |
| 657 ; ---- view 2: compass ---- | 663 ; ---- view 2: compass ---- |
| 658 ; | 664 ; |
| 659 init_TFT_dive_compass: | 665 init_TFT_dive_compass: |
| 660 IFDEF _compass | 666 IFDEF _compass |
| 661 call I2C_init_compass ; start compass | 667 call I2C_init_compass ; start compass |
| 668 btfss compass_present | |
| 669 bra dive_customview_toggle ; not available without compass compiled in, goto next view | |
| 662 call TFT_dive_compass_mask ; mask for compass | 670 call TFT_dive_compass_mask ; mask for compass |
| 663 bra dive_cv_toggle_exit ; done | 671 bra dive_cv_toggle_exit ; done |
| 664 ELSE | 672 ELSE |
| 665 bra dive_customview_toggle ; not available without compass compiled in, goto next view | 673 bra dive_customview_toggle ; not available without compass compiled in, goto next view |
| 666 ENDIF | 674 ENDIF |
| 667 | 675 |
| 668 | 676 |
| 669 ; ---- view 3: ppO2 sensors --- | 677 ; ---- view 3: ppO2 sensors --- |
| 670 ; | 678 ; |
| 671 init_ppo2_sensors: | 679 init_ppo2_sensors: |
| 672 IFDEF _external_sensor | 680 IFDEF _external_sensor_eccr |
| 673 bsf trigger_temp_changed ; fake a change of the temperature to have the resettable dive time overwritten which was shown with the compass view | 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 |
| 674 btfsc FLAG_ccr_mode ; in CC mode? | 682 btfsc FLAG_ccr_mode ; in CC mode? |
| 675 bra init_ppo2_sensors_1 ; YES | 683 bra init_ppo2_sensors_1 ; YES |
| 676 btfsc FLAG_pscr_mode ; in pSCR mode? | 684 btfsc FLAG_pscr_mode ; in pSCR mode? |
| 677 bra init_ppo2_sensors_1 ; YES | 685 bra init_ppo2_sensors_1 ; YES |
| 679 init_ppo2_sensors_1: | 687 init_ppo2_sensors_1: |
| 680 btfsc ext_input_s8_ana ; do we have an S8/analog input? | 688 btfsc ext_input_s8_ana ; do we have an S8/analog input? |
| 681 bra init_ppo2_sensors_2 ; YES - show this view | 689 bra init_ppo2_sensors_2 ; YES - show this view |
| 682 btfsc ext_input_optical ; NO - do we have an optical input? | 690 btfsc ext_input_optical ; NO - do we have an optical input? |
| 683 bra init_ppo2_sensors_2 ; YES - show this view | 691 bra init_ppo2_sensors_2 ; YES - show this view |
| 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 | |
| 684 bra dive_customview_toggle ; NO - goto next view | 694 bra dive_customview_toggle ; NO - goto next view |
| 685 | 695 |
| 686 init_ppo2_sensors_2: | 696 init_ppo2_sensors_2: |
| 687 call TFT_ppo2_sensors_mask ; mask for ppO2 sensors | 697 call TFT_ppo2_sensors_mask ; mask for ppO2 sensors |
| 688 call TFT_ppo2_sensors ; data for ppO2 sensors | 698 call TFT_ppo2_sensors ; data for ppO2 sensors |
| 781 bra dive_customview_toggle ; YES - call next view | 791 bra dive_customview_toggle ; YES - call next view |
| 782 call TFT_ceiling_GF_tissue_mask ; NO - mask for ceiling, current GF and tissues | 792 call TFT_ceiling_GF_tissue_mask ; NO - mask for ceiling, current GF and tissues |
| 783 call TFT_ceiling_GF_tissue ; - data for ceiling, current GF and tissues | 793 call TFT_ceiling_GF_tissue ; - data for ceiling, current GF and tissues |
| 784 bra dive_cv_toggle_exit ; - done | 794 bra dive_cv_toggle_exit ; - done |
| 785 | 795 |
| 786 | 796 ; ---- view 11: ceiling, tissues and surf GF |
| 787 ; ---- view 11: CNS values ---- | 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 | |
| 812 | |
| 813 ; ---- view 12: CNS values ---- | |
| 788 ; | 814 ; |
| 789 init_CNS: ; CNS at end of dive | 815 init_CNS: ; CNS at end of dive |
| 790 btfsc FLAG_gauge_mode ; in gauge mode? | 816 btfsc FLAG_gauge_mode ; in gauge mode? |
| 791 bra dive_customview_toggle ; YES - call next view | 817 bra dive_customview_toggle ; YES - call next view |
| 792 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? | 818 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? |
| 794 call TFT_CNS_mask ; NO - mask for CNS values | 820 call TFT_CNS_mask ; NO - mask for CNS values |
| 795 call TFT_CNS ; - data for CNS values | 821 call TFT_CNS ; - data for CNS values |
| 796 bra dive_cv_toggle_exit ; - done | 822 bra dive_cv_toggle_exit ; - done |
| 797 | 823 |
| 798 | 824 |
| 799 ; ---- view 12: ppO2, END/EAD and CNS/gas density ---- | 825 ; ---- view 13: ppO2, END/EAD and CNS/gas density ---- |
| 800 ; | 826 ; |
| 801 init_ppo2_ead_end_cns: ; | 827 init_ppo2_ead_end_cns: ; |
| 802 btfsc FLAG_apnoe_mode ; in apnoe mode? | 828 btfsc FLAG_apnoe_mode ; in apnoe mode? |
| 803 bra dive_customview_toggle ; YES - goto next view | 829 bra dive_customview_toggle ; YES - goto next view |
| 804 btfsc FLAG_gauge_mode ; NO - in gauge mode? | 830 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
| 806 call TFT_ppo2_ead_end_cns_mask ; NO - mask for ppO2, END/EAD and CNS | 832 call TFT_ppo2_ead_end_cns_mask ; NO - mask for ppO2, END/EAD and CNS |
| 807 call TFT_ppo2_ead_end_cns ; - data for ppO2, END/EAD and CNS | 833 call TFT_ppo2_ead_end_cns ; - data for ppO2, END/EAD and CNS |
| 808 bra dive_cv_toggle_exit ; - done | 834 bra dive_cv_toggle_exit ; - done |
| 809 | 835 |
| 810 | 836 |
| 811 ; ---- view 13: clock, battery and surface pressure | 837 ; ---- view 14: clock, battery and surface pressure |
| 812 ; | 838 ; |
| 813 init_clock_batt_surfpress: | 839 init_clock_batt_surfpress: |
| 814 call TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure | 840 call TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure |
| 815 call TFT_clock_batt_surfpress ; data for clock, battery and surface pressure | 841 call TFT_clock_batt_surfpress ; data for clock, battery and surface pressure |
| 816 bra dive_cv_toggle_exit ; done | 842 bra dive_cv_toggle_exit ; done |
| 817 | 843 |
| 818 | 844 |
| 819 ; ---- view 14: GF factors | 845 ; ---- view 15: GF factors |
| 820 ; | 846 ; |
| 821 init_gf_factors: | 847 init_gf_factors: |
| 822 call TFT_gf_factors_mask ; show GF factors | 848 call TFT_gf_factors_mask ; show GF factors |
| 823 bra dive_cv_toggle_exit ; done | 849 bra dive_cv_toggle_exit ; done |
| 824 | 850 |
| 825 | 851 |
| 826 ; ---- view 15: cave waypoints ---- | 852 ; ---- view 16: cave waypoints ---- |
| 827 ; | 853 ; |
| 828 init_cave_waypoints: | 854 init_cave_waypoints: |
| 829 IFDEF _cave_mode | 855 IFDEF _cave_mode |
| 830 call TFT_cave_waypoints ; show waypoint graphics | 856 call TFT_cave_waypoints ; show waypoint graphics |
| 831 bra dive_cv_toggle_exit ; done | 857 bra dive_cv_toggle_exit ; done |
