annotate src/tft_outputs.asm @ 594:b891cd260d1b

2.97 SP1 release
author heinrichsweikamp
date Thu, 17 May 2018 20:46:33 +0200
parents 8a7d2d8bcd33
children 08a0162d3ca1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3 ; File tft_outputs.asm REFACTORED VERSION V2.97 SP1
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; Startup subroutines
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-08-07 : [mH] moving from OSTC code
heinrichsweikamp
parents:
diff changeset
11
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
12 #include "hwos.inc" ; Mandatory header
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
13 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
14 #include "tft.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
15 #include "start.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
16 #include "wait.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
17 #include "strings.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
18 #include "convert.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
19 #include "varargs.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
20 #include "math.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
21 #include "isr.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
22 #include "eeprom_rs232.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
23 #include "adc_lightsensor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
24 #include "surfmode.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
25 #include "divemode.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
26 #include "external_flash.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
27 #include "ghostwriter.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
28 #include "customview.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
29 #include "i2c.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
30 #include "colorschemes.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
31 #include "calibrate.inc"
0
heinrichsweikamp
parents:
diff changeset
32
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
33
0
heinrichsweikamp
parents:
diff changeset
34 extern aa_wordprocessor
heinrichsweikamp
parents:
diff changeset
35
heinrichsweikamp
parents:
diff changeset
36 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
37
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
38 gui CODE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
39
0
heinrichsweikamp
parents:
diff changeset
40 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
41
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
42 global TFT_divemask_color
0
heinrichsweikamp
parents:
diff changeset
43 TFT_divemask_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
44 movlw color_green
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
45 btfsc divemode ; in Divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
46 rcall TFT_divemask_color_dive
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
47 bra TFT_standard_color0
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
48
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
49 TFT_divemask_color_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
50 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
51 incf WREG
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
52 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
53 retlw color_scheme_divemode_mask1 ;0
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
54 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
55 retlw color_scheme_divemode_mask2 ;1
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
56 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
57 retlw color_scheme_divemode_mask3 ;2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
58 retlw color_scheme_divemode_mask4 ;3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
59
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
60
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
61 global TFT_attention_color
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
62 TFT_attention_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
63 movlw color_yellow ; make this configurable?
0
heinrichsweikamp
parents:
diff changeset
64 bra TFT_standard_color0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
65 TFT_attention_color_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
66 retlw color_yellow ; make this configurable?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
67
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
68
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
69 global TFT_warnings_color
0
heinrichsweikamp
parents:
diff changeset
70 TFT_warnings_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
71 movlw color_red ; make this configurable?
0
heinrichsweikamp
parents:
diff changeset
72 bra TFT_standard_color0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
73 TFT_warnings_color_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
74 retlw color_red ; make this configurable?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
75
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
76
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
77 global TFT_disabled_color
0
heinrichsweikamp
parents:
diff changeset
78 TFT_disabled_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
79 ;movlw color_grey ; Default to OSTC grey (dark blue)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
80 movlw color_lightblue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
81 btfsc divemode ; in Divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
82 rcall TFT_disabled_color_dive ; YES
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
83 bra TFT_standard_color0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
84
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
85 TFT_disabled_color_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
86 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
87 incf WREG
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
88 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
89 retlw color_scheme_divemode_dis1 ; 0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
90 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
91 retlw color_scheme_divemode_dis2 ; 1
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
92 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
93 retlw color_scheme_divemode_dis3 ; 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
94 retlw color_scheme_divemode_dis4 ; 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
95
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
96
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
97 global TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
98 TFT_standard_color:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
99 setf WREG ; Default white
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
100 btfsc divemode ; in Divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
101 rcall TFT_standard_color_dive
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
102 ;bra TFT_standard_color0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
103
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
104 TFT_standard_color0:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
105 goto TFT_set_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
106
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
107
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
108 TFT_standard_color_dive:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
109 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
110 incf WREG
0
heinrichsweikamp
parents:
diff changeset
111 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
112 retlw color_scheme_divemode_std1 ;0
0
heinrichsweikamp
parents:
diff changeset
113 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
114 retlw color_scheme_divemode_std2 ;1
0
heinrichsweikamp
parents:
diff changeset
115 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
116 retlw color_scheme_divemode_std3 ;2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
117 retlw color_scheme_divemode_std4 ;3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
118
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
119
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
120 global TFT_color_code_gaslist
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
121 TFT_color_code_gaslist: ; Color-code current row in Gaslist (%O2 in hi) according to current amb_pressure
0
heinrichsweikamp
parents:
diff changeset
122 ; Check very high ppO2 manually
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
123 SAFE_2BYTE_COPY amb_pressure,xA
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
124 movlw d'10'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
125 movwf xB+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
126 clrf xB+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
127 call div16x16 ; xC=p_amb/10
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
128 movff xC+0,xA+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
129 movff xC+1,xA+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
130 movff hi,xB+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
131 clrf xB+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
132 call mult16x16 ; hi * p_amb/10
0
heinrichsweikamp
parents:
diff changeset
133 ; Check if ppO2>6,55bar
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
134 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
135 bra TFT_warnings_color ; Yes, warn in warning color
0
heinrichsweikamp
parents:
diff changeset
136 ; Check if ppO2>3,30bar
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
137 btfsc xC+1,7
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
138 bra TFT_warnings_color ; Yes, warn in warning color
0
heinrichsweikamp
parents:
diff changeset
139 ; Check for low ppo2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
140 movff xC+0,sub_a+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
141 movff xC+1,sub_a+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
142 movff char_I_ppO2_min,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
143 mullw d'100' ; char_I_ppO2_min*100
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
144 movff PRODL,sub_b+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
145 movff PRODH,sub_b+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
146 call subU16
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
147 btfsc neg_flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
148 bra TFT_warnings_color ; too low -> Warning Color!
0
heinrichsweikamp
parents:
diff changeset
149 ; Check for high ppo2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
150 movff char_O_deco_warnings,WREG ; bank-safe copy of deco warnings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
151 btfsc WREG,deco_flag ; are we in deco?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
152 bra TFT_color_code_gaslist_deco ; YES - take deco max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
153 movff char_I_ppO2_max,WREG ; No - take travel/bottom max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
154 bra TFT_color_code_gaslist_com
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
155 TFT_color_code_gaslist_deco:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
156 movff char_I_ppO2_max_deco,WREG ; ppo2 max for deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
157 TFT_color_code_gaslist_com:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
158 mullw d'100' ; char_I_ppO2_max*100
526
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
159 movff PRODL,sub_b+0
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
160 movff PRODH,sub_b+1
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
161 infsnz sub_a+0,F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
162 incf sub_a+1,F ; add 1mbar to avoid warning on equal
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
163 call subU16 ; sub_c = sub_a - sub_b
526
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
164 btfss neg_flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
165 bra TFT_warnings_color ; too high -> Warning Color!
0
heinrichsweikamp
parents:
diff changeset
166 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
167
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
168
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
169 TFT_color_code_ceiling: ; color-code the ceiling depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
170 btfsc hi,char_invalid_flag ; is the invalid flag set? (bit 7 here)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
171 bra TFT_color_code_ceiling_1 ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
172 SAFE_2BYTE_COPY rel_pressure,sub_a ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
173 movff lo,sub_b+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
174 movff hi,sub_b+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
175 call subU16 ; sub_c = sub_a - sub_b : sub_c = rel_pressure [cm] - int_O_ceiling [mbar => cm]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
176 btfsc neg_flag ; is ceiling > current depth?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
177 bra TFT_warnings_color ; YES - set to warning color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
178 bra TFT_standard_color ; NO - set to standard color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
179 TFT_color_code_ceiling_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
180 bcf hi,char_invalid_flag ; clear the invalid flag (bit 7 here)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
181 bra TFT_disabled_color ; set to disabled color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
182
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
183
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
184 TFT_color_code_stop: ; color-code the stop depth
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
185 movff char_O_deco_gas+0,WREG ; get flag for invalid deco data
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
186 btfsc WREG,char_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
187 bra TFT_disabled_color ; set to disabled color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
188 SAFE_2BYTE_COPY rel_pressure,xA ; get current pressure in mbar = cm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
189 movlw LOW d'100'
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
190 movwf xB+0
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
191 clrf xB+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
192 call div16x16 ; xA/xB=xC with xA as remainder: Divide/100 => xC+0 = current depth in meters
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
193 movff char_O_first_deco_depth,WREG; get stop depth in m into WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
194 subwf xC+0,W ; compute current depth - stop depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
195 btfsc STATUS,C ; result negative?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
196 bra TFT_standard_color ; NO - set to standard color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
197 bra TFT_warnings_color ; YES - set to warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
198
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
199
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
200 TFT_color_code_depth: ; with actual depth as rel_pressure in [mbar] in hi:lo and threshold depth_warn_mbar [mbar], 16Bit
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
201 movff lo,sub_a+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
202 movff hi,sub_a+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
203 movlw LOW depth_warn_mbar
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
204 movwf sub_b+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
205 movlw HIGH depth_warn_mbar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
206 movwf sub_b+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
207 call subU16 ; sub_c = sub_a - sub_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
208 TSTOSS opt_modwarning ; 0=standard, 1=blink
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
209 bra TFT_color_code_depth_std
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
210 btfss neg_flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
211 bra TFT_color_code_depth_warn ; set to warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
212 bra TFT_color_code_depth_ppO2 ; check depth against MOD and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
213 TFT_color_code_depth_std:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
214 btfss neg_flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
215 bra TFT_warnings_color ; set to warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
216 bra TFT_standard_color ; set to standard color and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
217 TFT_color_code_depth_ppO2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
218 movff opt_dive_mode,WREG ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
219 decfsz WREG,F ; are we in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
220 bra TFT_color_code_depth_no_ccr ; NO - continue checking for ppO2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
221 btfsc is_bailout ; YES - check if in bailout
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
222 bra TFT_color_code_depth_no_ccr ; YES - continue checking for ppO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
223 bcf blinking_depth_warning ; reset warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
224 bra TFT_standard_color ; no color coding, return.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
225 TFT_color_code_depth_no_ccr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
226 movff int_O_breathed_ppO2+1,WREG ; get upper byte of currently breathed ppO2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
227 btfsc WREG,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
228 bra TFT_color_code_depth_warn ; YES - animate in warning design
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
229 bcf blinking_depth_warning ; NO - reset warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
230 bra TFT_standard_color ; set standard color and return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
231 TFT_color_code_depth_warn:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
232 bsf blinking_depth_warning ; set warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
233 bra TFT_warnings_color ; set to warning color and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
234
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
235
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
236 global TFT_color_code_cns
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
237 TFT_color_code_cns: ; color-code CNS values (CNS in hi:lo [%])
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
238 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
239 bra TFT_color_code_cns_1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
240 bcf hi,int_invalid_flag ; YES - clear invalid flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
241 bcf hi,int_warning_flag ; clear warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
242 bcf hi,int_attention_flag ; clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
243 bra TFT_disabled_color ; set to disabled color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
244 TFT_color_code_cns_1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
245 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
246 bra TFT_color_code_cns_2 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
247 bcf hi,int_warning_flag ; YES - clear warning flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
248 bcf hi,int_attention_flag ; clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
249 bra TFT_warnings_color ; set to warning color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
250 TFT_color_code_cns_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
251 btfss hi,int_attention_flag ; is the attention flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
252 bra TFT_standard_color ; NO - set to standard color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
253 bcf hi,int_attention_flag ; YES - clear attention flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
254 bra TFT_attention_color ; set to attention color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
255
0
heinrichsweikamp
parents:
diff changeset
256
heinrichsweikamp
parents:
diff changeset
257 TFT_color_code_gf:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
258 ; with int_O_gradient_factor, the upper byte is solely used for the flags
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
259 ; and not for the value, thus there is no need to clear the flags
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
260 btfsc hi,int_invalid_flag ; is the invalid flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
261 bra TFT_disabled_color ; YES - set to disabled color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
262 btfsc hi,int_warning_flag ; NO - is the warning flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
263 bra TFT_warnings_color ; YES - set to warning color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
264 btfsc hi,int_attention_flag ; NO - is the attention flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
265 bra TFT_attention_color ; YES - set to attention color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
266 bra TFT_standard_color ; NO - set to normal color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
267
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
268
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
269 TFT_color_code_ppo2: ; color-code ppO2 values (ppO2 in hi:lo [cbar]) by its warning flags
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
270 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
271 bra TFT_color_code_ppo2_1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
272 bcf hi,int_warning_flag ; YES - clear warning flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
273 bcf hi,int_attention_flag ; clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
274 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
275 bcf hi,int_low_flag ; clear low warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
276 bra TFT_warnings_color ; warn in warning color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
277 TFT_color_code_ppo2_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
278 btfss hi,int_attention_flag ; is the attention flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
279 bra TFT_color_code_ppo2_2 ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
280 bcf hi,int_attention_flag ; YES - clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
281 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
282 bcf hi,int_low_flag ; clear low warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
283 bra TFT_attention_color ; set to standard color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
284 TFT_color_code_ppo2_2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
285 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
286 bcf hi,int_low_flag ; clear low warning flag (it may be set)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
287 bra TFT_standard_color ; set to standard color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
288
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
289
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
290 TFT_color_code_ppo2_hud: ; color-code ppO2 values (ppO2 in --:lo [cbar]) by its value
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
291 movff char_O_deco_warnings,WREG ; get the deco warnings vector
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
292 btfss WREG,deco_flag ; are we in deco?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
293 bra TFT_color_code_ppo2_hud_a ; NO - load normal max value as threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
294 movff char_I_ppO2_max_deco,WREG ; YES - load deco value as threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
295 bra TFT_color_code_ppo2_hud_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
296 TFT_color_code_ppo2_hud_a:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
297 movff char_I_ppO2_max,WREG ; ppO2 max while not in deco
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
298 TFT_color_code_ppo2_hud_b:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
299 cpfsgt lo ; lo > threshold?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
300 bra TFT_color_code_ppo2_hud1 ; NO - continue with checking for ppO2 low
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
301 bra TFT_warnings_color ; YES - set warning color and return
0
heinrichsweikamp
parents:
diff changeset
302 TFT_color_code_ppo2_hud1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
303 movff opt_dive_mode,WREG ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
304 decfsz WREG,F ; now: 0=CC, 1=Gauge, 2=Apnea, 3=PSCR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
305 bra TFT_color_code_ppo2_hud_nocc; not CCR...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
306 btfsc is_bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
307 bra TFT_color_code_ppo2_hud_nocc; is bailout, hence not loop mode...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
308 movff char_I_ppO2_min_loop,WREG ; ppO2 min loop mode color coding
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
309 bra TFT_color_code_ppo2_hud_cont
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
310 TFT_color_code_ppo2_hud_nocc:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
311 movff char_I_ppO2_min,WREG ; PPO2 min for all other modes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
312 TFT_color_code_ppo2_hud_cont:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
313 cpfslt lo ; lo < char_I_ppO2_min?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
314 bra TFT_standard_color ; NO - set standard color and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
315 bra TFT_warnings_color ; Yes - set warning color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
316
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
317
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
318 TFT_color_code_battery: ; color-code the battery display, with battery percent in lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
319 movlw color_code_battery_low ; get warning threshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
320 cpfsgt lo ; is battery percent < threshold?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
321 bra TFT_warnings_color ; YES - set to warning color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
322 bra TFT_standard_color ; NO - set to standard color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
323
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
324
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
325 global TFT_color_code_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
326 TFT_color_code_gas: ; color-code the output according to gas number (1-6) in WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
327 movwf up ; copy gas number (1-6) to up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
328 movlw color_white ; Default color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
329 dcfsnz up,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
330 movlw color_white ; Color for Gas 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
331 dcfsnz up,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
332 movlw color_green ; Color for Gas 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
333 dcfsnz up,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
334 movlw color_red ; Color for Gas 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
335 dcfsnz up,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
336 movlw color_yellow ; Color for Gas 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
337 dcfsnz up,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
338 movlw color_cyan ; Color for Gas 5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
339 dcfsnz up,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
340 movlw color_pink ; Color for Gas 6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
341 goto TFT_set_color ; Set Color...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
342
0
heinrichsweikamp
parents:
diff changeset
343
heinrichsweikamp
parents:
diff changeset
344 ; ****************************************************************************
heinrichsweikamp
parents:
diff changeset
345
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
346 global TFT_show_OC_startgas_surface
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
347 TFT_show_OC_startgas_surface: ; Show first gas and "OSTC2-like" active gases
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
348 ; Show first gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
349 WIN_SMALL surf_decotype_column+.1,surf_decotype_row+.30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
350 extern get_first_gas_to_WREG,gaslist_strcat_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
351 call get_first_gas_to_WREG ; Gets first gas (1-5) into WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
352 decf WREG,W ; 1-5 -> 0-4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
353 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
354 call gaslist_strcat_gas ; Input: PRODL : gas number (0..4), Output: Text appended into buffer pointed by FSR2.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
355 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
356 ; Show boxes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
357 WIN_TOP surf_decotype_row+.30+.25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
358 WIN_LEFT surf_decotype_boxes_left1+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
359 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
360 movff opt_gas_type+0,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
361 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
362 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
363 STRCPY_PRINT "1"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
364 decfsz hi,F ; Type = 1 (First)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
365 bra DISP_active_gas_surfmode3 ; No, skip box
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
366 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left1, surf_decotype_boxes_left1+.8 ;top, bottom, left, right
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
367 DISP_active_gas_surfmode3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
368 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
369 movff opt_gas_type+1,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
370 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
371 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
372 WIN_LEFT surf_decotype_boxes_left2+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
373 STRCPY_PRINT "2"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
374 decfsz hi,F ; Type = 1 (First)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
375 bra DISP_active_gas_surfmode4 ; No, skip box
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
376 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left2, surf_decotype_boxes_left2+.8 ;top, bottom, left, right
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
377 DISP_active_gas_surfmode4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
378 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
379 movff opt_gas_type+2,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
380 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
381 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
382 WIN_LEFT surf_decotype_boxes_left3+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
383 STRCPY_PRINT "3"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
384 decfsz hi,F ; Type = 1 (First)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
385 bra DISP_active_gas_surfmode5 ; No, skip box
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
386 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left3, surf_decotype_boxes_left3+.8 ;top, bottom, left, right
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
387 DISP_active_gas_surfmode5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
388 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
389 movff opt_gas_type+3,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
390 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
391 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
392 WIN_LEFT surf_decotype_boxes_left4+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
393 STRCPY_PRINT "4"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
394 decfsz hi,F ; Type = 1 (First)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
395 bra DISP_active_gas_surfmode6 ; No, skip box
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
396 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left4, surf_decotype_boxes_left4+.8 ;top, bottom, left, right
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
397 DISP_active_gas_surfmode6:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
398 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
399 movff opt_gas_type+4,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
400 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
401 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
402 WIN_LEFT surf_decotype_boxes_left5+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
403 STRCPY_PRINT "5"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
404 rcall TFT_standard_color ; Reset color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
405 decfsz hi,F ; Type = 1 (First)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
406 return ; no, Done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
407 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left5, surf_decotype_boxes_left5+.8 ;top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
408 return ; Done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
409
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
410
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
411 global TFT_show_color_schemes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
412 TFT_show_color_schemes: ; update the color schemes
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
413 bsf divemode ; put in divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
414 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
415 WIN_TINY .12,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
416 STRCAT_TEXT_PRINT tDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
417 WIN_TINY .62,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
418 STRCAT_TEXT_PRINT tMaxDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
419 WIN_TINY .122,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
420 STRCAT_TEXT_PRINT tDivetime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
421
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
422 ; Show some demo screen
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
423
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
424 ; Depth demo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
425 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
426 WIN_MEDIUM .3,.54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
427 movlw LOW .5172
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
428 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
429 movlw HIGH .5172
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
430 movwf hi
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
431 bsf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
432 bsf ignore_digit4
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
433 output_16 ; Full meters in Big font
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
434 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
435 STRCAT_PRINT "" ; Display full meters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
436 WIN_SMALL .25,.66
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
437 movlw LOW .5172
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
438 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
439 movlw HIGH .5172
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
440 movwf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
441 PUTC "."
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
442 movlw d'4'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
443 movwf ignore_digits
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
444 bsf ignore_digit5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
445 output_16dp d'0' ; .1m in SMALL font
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
446 STRCAT_PRINT "" ; Display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
447 WIN_FONT FT_SMALL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
448
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
449 ; Max. Depth demo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
450 WIN_MEDIUM .64,.54
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
451 bsf ignore_digit4 ; no 0.1m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
452 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
453 movlw LOW .6349
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
454 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
455 movlw HIGH .6349
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
456 movwf hi
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
457 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
458 STRCAT_PRINT "" ; Display full meters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
459 bcf leftbind
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
460 ; .1m in SMALL font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
461 WIN_SMALL .87,.66
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
462 PUTC "."
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
463 movlw d'4'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
464 movwf ignore_digits
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
465 bsf ignore_digit5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
466 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
467 movlw LOW .6349
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
468 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
469 movlw HIGH .6349
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
470 movwf hi
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
471 output_16dp d'0'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
472 STRCAT_PRINT "" ; Display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
473 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
474
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
475 ; Divetime demo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
476 movff mins,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
477 clrf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
478 WIN_MEDIUM .103, .54
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
479 output_16_3 ; limit to 999 and display only (0-999)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
480 STRCAT_PRINT "" ; Show minutes in large font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
481 WIN_SMALL .139, .66 ; left position for two sec figures
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
482 PUTC ':'
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
483 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
484 movff secs,lo
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
485 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
486 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
487 STRCAT_PRINT "" ; Show seconds in small font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
488
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
489 bcf divemode ; don't stay in divemode
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
490 return
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
491
0
heinrichsweikamp
parents:
diff changeset
492 global TFT_divemode_mask
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
493 TFT_divemode_mask: ; Displays mask in divemode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
494 bcf FLAG_TFT_divemode_mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
495 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
496 WIN_TINY dm_mask_depth_column,dm_mask_depth_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
497 STRCAT_TEXT_PRINT tDepth
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
498 WIN_TINY dm_mask_maxdepth_column,dm_mask_maxdepth_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
499 TSTOSS opt_vsigraph ; 0=skip, 1=draw
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
500 WIN_TINY dm_mask_maxdepth_column_nvsi,dm_mask_maxdepth_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
501 STRCAT_TEXT_PRINT tMaxDepth
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
502 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
503 STRCAT_TEXT_PRINT tDivetime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
504 bra TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
505
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
506 global TFT_divemode_mask_alternative
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
507 TFT_divemode_mask_alternative: ; Alt. mask for divemode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
508 bcf FLAG_TFT_divemode_mask_alt
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
509 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
510 WIN_TINY dm_mask_depth_column,dm_mask_depth_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
511 STRCAT_TEXT_PRINT tDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
512 WIN_TINY dm_mask_divetime_column-.30,dm_mask_divetime_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
513 STRCAT_TEXT_PRINT tDivetime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
514 bra TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
515
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
516 global TFT_draw_gassep_line
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
517 TFT_draw_gassep_line:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
518 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
519 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
520 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
521 return ; Yes, return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
522 bra TFT_standard_color ; and return...
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
523
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
524 ;=========================================================================
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
525
0
heinrichsweikamp
parents:
diff changeset
526 global TFT_display_velocity
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
527 TFT_display_velocity: ; With divA+0 = m/min, neg_flag_velocity: ascend=1, descend=0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
528 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
529 movlw velocity_display_threshold_1; lowest threshold for display vertical velocity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
530 subwf divA+0,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
531 btfss STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
532 bra TFT_velocity_clear ; lower then threshold. Clear text and graph (If active)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
533
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
534 ; We have something to display
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
535 bsf display_velocity ; Set flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
536 ; check if descending: no warning color if descending
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
537 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
538 btfsc neg_flag_velocity ; Ignore for descent!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
539 rcall TFT_velocity_set_color ; Set color for text and set threshold for graph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
540
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
541 rcall TFT_velocity_disp ; Show the text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
542
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
543 TSTOSS opt_vsigraph ; =1: draw the graphical VSI bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
544 bra TFT_display_velocity_done ; No graph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
545
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
546 btfsc alternative_divelayout ; Alternative layout?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
547 bra TFT_display_velocity_done ; Yes, no graph! (no room when divetime minutes is three figures)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
548
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
549 btfsc neg_flag_velocity ; Ignore for descent!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
550 rcall TFT_velocity_graph ; Show the graph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
551 btfss neg_flag_velocity ; Ignore for descent!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
552 rcall TFT_velocity_clear_graph ; Clear the graph for descent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
553
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
554 TFT_display_velocity_done:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
555 bra TFT_standard_color ; and return!
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
556
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
557 TFT_speed_table:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
558 ; use a depth-dependent ascent rate warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
559 ; depth(ft): <20 >20 >40 >60 >75 >88 >101 >115 >128 >144 >164
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
560 ; speed(ft/min): 23 26 29 33 36 43 49 56 59 62 66
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
561 ; depth(m): <=6 >6 >12 >18 >23 >27 >31 >35 >39 >44 >50
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
562 ; speed(m/min): 7 8 9 10 11 13 15 17 18 19 20 (warning)
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
563 ; speed(m/min): 5 6 7 8 8 10 12 13 14 15 15 (attention)
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
564
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
565 ; <xx m, warning speed, attention speed, unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
566 DB .6,.7,.5,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
567 DB .12,.8,.6,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
568 DB .18,.9,.7,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
569 DB .23,.10,.8,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
570 DB .27,.11,.8,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
571 DB .31,.13,.10,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
572 DB .35,.15,.12,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
573 DB .39,.17,.13,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
574 DB .44,.18,.14,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
575 DB .50,.19,.15,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
576 DB .200,.20,.15,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
577
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
578 TFT_velocity_set_color: ; Set color based on speed table or use static thresholds, with divA+0 = m/min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
579 ; check if old/new ascend logic is used
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
580 TSTOSS opt_vsitextv2 ; 0=standard, 1=dynamic
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
581 bra TFT_velocity_set_color_static ; static ascend rate limit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
583 ; get the actual depth in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
584 SAFE_2BYTE_COPY rel_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
585 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
586 movff hi,xA+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
587 movff lo,xA+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
588 movlw LOW d'100'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
589 movwf xB+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
590 clrf xB+1 ; Devide/100 -> xC+0 = Depth in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
591 call div16x16 ; xA/xB=xC with xA as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
592 ;movf xC+0,W ; Depth in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
593
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
594 ; point to speed table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
595 movlw LOW (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
596 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
597 movlw HIGH (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
598 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
599 movlw UPPER (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
600 movwf TBLPTRU
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
601
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
602 TFT_velocity_set_color_skip:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
603 TBLRD*+ ; 3 dummy reads
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
604 TBLRD*+
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
605 TBLRD*+
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
606
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
607 TBLRD*+ ; Get speed threshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
608 movf xC+0,W ; Depth in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
609 cpfsgt TABLAT ; Threshold > current depth ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
610 bra TFT_velocity_set_color_skip ; No
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
611
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
612 TBLRD*+ ; Get warning speed threshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
613 movf TABLAT,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
614 movwf divA+1 ; Copy for graph routine
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
615 cpfslt divA+0 ; smaller then actual value (in m/min)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
616 bra TFT_warnings_color ; Set Warning color (And return)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
617 TBLRD*+ ; Get attention speed threshold
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
618 movf TABLAT,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
619 cpfslt divA+0 ; smaller then actual value (in m/min)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
620 bra TFT_attention_color ; set attention color (and return)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
621 bra TFT_standard_color ; ...and return
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
622
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
623 TFT_velocity_set_color_static:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
624 movlw color_code_velocity_warn_high ; in m/min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
625 movwf divA+1 ; Copy for graph routine
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
626 cpfslt divA+0 ; smaller then actual value (in m/min)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
627 bra TFT_warnings_color ; Set Warning color (And return)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
628 movlw color_code_velocity_attn_high ; in m/min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
629 cpfslt divA+0 ; smaller then actual value (in m/min)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
630 bra TFT_attention_color ; set attention color (and return)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
631 bra TFT_standard_color ; ...and return
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
632
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
633 TFT_velocity_disp:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
634 WIN_SMALL dm_velocity_text_column, dm_velocity_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
635 TSTOSS opt_units ; 0=Meters, 1=Feets
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
636 bra TFT_velocity_metric
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
637 ;TFT_velocity_imperial:
0
heinrichsweikamp
parents:
diff changeset
638 movff divA+0,WREG ; divA+0 = m/min
heinrichsweikamp
parents:
diff changeset
639 mullw .100 ; PRODL:PRODH = mbar/min
heinrichsweikamp
parents:
diff changeset
640 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
641 movff PRODH,hi
heinrichsweikamp
parents:
diff changeset
642 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
heinrichsweikamp
parents:
diff changeset
643 movlw '-'
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
644 btfsc neg_flag_velocity
0
heinrichsweikamp
parents:
diff changeset
645 movlw '+'
heinrichsweikamp
parents:
diff changeset
646 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
647 bsf leftbind
heinrichsweikamp
parents:
diff changeset
648 output_16
heinrichsweikamp
parents:
diff changeset
649 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
650 STRCAT_TEXT_PRINT tVelImperial ; Unit switch
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
651 return
0
heinrichsweikamp
parents:
diff changeset
652
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
653 TFT_velocity_metric:
0
heinrichsweikamp
parents:
diff changeset
654 movff divA+0,lo ; divA+0 = m/min
heinrichsweikamp
parents:
diff changeset
655 movlw '-'
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
656 btfsc neg_flag_velocity
0
heinrichsweikamp
parents:
diff changeset
657 movlw '+'
heinrichsweikamp
parents:
diff changeset
658 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
659 output_99
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
660 STRCAT_TEXT_PRINT tVelMetric ; Unit switch
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
661 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
662
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
663 TFT_velocity_graph: ; divA+0 = m/min
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
664 ; divA+0 holding the ascend speed in m/min
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
665 movff divA+0,hi ; Copy
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
666 WIN_BOX_BLACK dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right -> outer frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
667 rcall TFT_divemask_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
668 WIN_FRAME_COLOR dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;inner frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
669 rcall TFT_divemask_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
670 WIN_FRAME_COLOR dm_velobar_top+.10, dm_velobar_bot-.10, dm_velobar_lft, dm_velobar_rgt ;inner frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
671 rcall TFT_divemask_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
672 WIN_FRAME_COLOR dm_velobar_top+.20, dm_velobar_bot-.20, dm_velobar_lft, dm_velobar_rgt ;inner frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
673 rcall TFT_divemask_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
674 WIN_FRAME_COLOR dm_velobar_top+.30, dm_velobar_bot-.30, dm_velobar_lft, dm_velobar_rgt ;inner frame
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
675
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
676 movff divA+1,xA+0 ; m/min for warning level (upper two blocks)
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
677 clrf xA+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
678 movlw .5
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
679 movwf xB+0 ; Threshold for color warning (5 color normal + 2 color warning)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
680 clrf xB+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
681 call div16x16 ;xA/xB=xC with xA as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
682 ; xC+0 holds step size in m/min (e.g. =3 for 15m/min warning threshold)
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
683 movff hi,xA+0 ; Velocity in m/min
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
684 clrf xA+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
685 movff xC+0,xB+0 ; Step size
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
686 clrf xB+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
687 call div16x16 ;xA/xB=xC with xA as remainder
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
688 ; xC+0 now holds amount of segments to show
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
689
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
690 movff hi,divA+0 ; Copy back for numeric output
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
691 movlw d'7'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
692 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
693 bra DISP_graph_vel_7
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
694 movlw d'6'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
695 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
696 bra DISP_graph_vel_6
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
697 movlw d'5'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
698 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
699 bra DISP_graph_vel_5
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
700 movlw d'4'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
701 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
702 bra DISP_graph_vel_4
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
703 movlw d'3'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
704 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
705 bra DISP_graph_vel_3
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
706 movlw d'2'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
707 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
708 bra DISP_graph_vel_2
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
709 movlw d'1'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
710 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
711 bra DISP_graph_vel_1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
712 bra DISP_graph_vel_0 ; Should not happen...
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
713
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
714 DISP_graph_vel_7:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
715 rcall TFT_warnings_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
716 WIN_BOX_COLOR dm_velobar_top+.2, dm_velobar_top+.8, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
717 DISP_graph_vel_6:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
718 rcall TFT_warnings_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
719 WIN_BOX_COLOR dm_velobar_top+.12, dm_velobar_top+.18, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
720 DISP_graph_vel_5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
721 rcall TFT_attention_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
722 WIN_BOX_COLOR dm_velobar_top+.22, dm_velobar_top+.28, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
723 DISP_graph_vel_4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
724 rcall TFT_standard_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
725 WIN_BOX_COLOR dm_velobar_top+.32, dm_velobar_top+.38, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
726 DISP_graph_vel_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
727 rcall TFT_standard_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
728 WIN_BOX_COLOR dm_velobar_top+.42, dm_velobar_top+.48, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
729 DISP_graph_vel_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
730 rcall TFT_standard_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
731 WIN_BOX_COLOR dm_velobar_top+.52, dm_velobar_top+.58, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
732 DISP_graph_vel_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
733 rcall TFT_standard_color_dive ; Color -> WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
734 WIN_BOX_COLOR dm_velobar_top+.62, dm_velobar_top+.68, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
735 DISP_graph_vel_0:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
736 return ; Done.
326
d21b172d5a7a VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
Janos Kovacs <kovjanos@gmail.com>
parents: 321
diff changeset
737
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
738 global TFT_velocity_clear
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
739 TFT_velocity_clear:
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
740 btfss display_velocity ; Velocity was not displayed, do not delete
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
741 return
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
742 bcf display_velocity ; Velocity was displayed, delete velocity now
0
heinrichsweikamp
parents:
diff changeset
743 ; Clear Text
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
744 WIN_BOX_BLACK dm_velocity_text_row, dm_velocity_text_bot, dm_velocity_text_column, dm_velocity_text_rgt ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
745
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
746 TSTOSS opt_vsigraph ; =1: draw the graphical VSI bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
747 return ; No graph to clear
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
748 TFT_velocity_clear_graph:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
749 ; Clear Graph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
750 WIN_BOX_BLACK dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
751 return
heinrichsweikamp
parents:
diff changeset
752
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
753 ;=========================================================================
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
754
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
755 global TFT_clear_decoarea
0
heinrichsweikamp
parents:
diff changeset
756 TFT_clear_decoarea:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
757 WIN_BOX_BLACK dm_decostop_1st_stop_row, .239, dm_decostop_1st_stop_column, .159 ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
758 return
heinrichsweikamp
parents:
diff changeset
759
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
760
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
761 global TFT_clear_divemode_menu
0
heinrichsweikamp
parents:
diff changeset
762 TFT_clear_divemode_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
763 WIN_BOX_BLACK dm_menu_row, dm_menu_lower, dm_menu_left, dm_menu_right ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
764 return
heinrichsweikamp
parents:
diff changeset
765
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
766
0
heinrichsweikamp
parents:
diff changeset
767 global TFT_display_ndl_mask
heinrichsweikamp
parents:
diff changeset
768 TFT_display_ndl_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
769 bcf FLAG_TFT_display_ndl_mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
770 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
771 return ; Yes, return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
772 call TFT_clear_decoarea ; Clear Dekostop and Dekosum
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
773 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
774 WIN_STD dm_ndl_text_column, dm_ndl_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
775 STRCPY_TEXT_PRINT tNDL ; NDL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
776 bra TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
777
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
778
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
779 global TFT_display_tts
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
780 TFT_display_tts:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
781 bcf FLAG_TFT_display_tts
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
782 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
783 return ; Yes, return
0
heinrichsweikamp
parents:
diff changeset
784 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
785 movff int_O_ascenttime+0,lo ; TTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
786 movff int_O_ascenttime+1,hi ; on 16bits
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
787 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
788 bra TFT_display_tts_1 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
789 bcf hi,int_invalid_flag ; YES - clear flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
790 call TFT_disabled_color ; switch to disabled color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
791 TFT_display_tts_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
792 WIN_MEDIUM dm_tts_value_column, dm_tts_value_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
793 output_16_3 ; Displays only 0...999
0
heinrichsweikamp
parents:
diff changeset
794 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
795 return
heinrichsweikamp
parents:
diff changeset
796
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
797
0
heinrichsweikamp
parents:
diff changeset
798 global TFT_display_ndl
heinrichsweikamp
parents:
diff changeset
799 TFT_display_ndl:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
800 bcf FLAG_TFT_display_ndl
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
801 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
802 return ; Yes, return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
803 WIN_MEDIUM dm_ndl_value_column, dm_ndl_value_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
804 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
805 movff char_O_nullzeit,lo ; Get NDL from C-code
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
806 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
807 STRCAT_PRINT "'"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
808 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
809
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
810
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
811 global TFT_big_deco_alt ; The big deco
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
812 TFT_big_deco_alt:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
813 bcf FLAG_TFT_big_deco_alt
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
814
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
815 btfss decostop_active ; deco?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
816 bra TFT_big_deco_ndl_alt ; NDL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
817
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
818 ; Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
819 bcf FLAG_TFT_display_deko
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
820 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
821 WIN_STD .70,.165
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
822 STRCPY_TEXT_PRINT tTTS ; TTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
823 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
824
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
825 ; TTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
826 WIN_LARGE .97,.170
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
827 movff int_O_ascenttime+0,lo ; TTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
828 movff int_O_ascenttime+1,hi ; on 16bits
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
829 btfss hi,int_invalid_flag ; is the invalid flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
830 bra TFT_display_tts_alt_1 ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
831 bcf hi,int_invalid_flag ; YES - clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
832 call TFT_disabled_color ; switch to disabled color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
833 TFT_display_tts_alt_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
834 output_16_3 ; Displays only 0...999
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
835 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
836
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
837 ; 1st Stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
838 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
839 WIN_STD .25,dm_customview_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
840 STRCPY_TEXT_PRINT tDiveSafetyStop ; "Stop"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
841
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
842 WIN_LARGE .60,.95
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
843 call TFT_color_code_stop ; Color-code Output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
844 movff char_O_first_deco_depth,lo ; stop depth in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
845 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
846 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
847
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
848 ; m or ft after the stop depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
849 WIN_MEDIUM .100,.118
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
850 TSTOSS opt_units ; 0=m, 1=ft
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
851 bra TFT_display_tts_alt_1_metric
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
852 STRCAT_TEXT_PRINT tFeets1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
853 bra TFT_display_tts_alt_1_com
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
854 TFT_display_tts_alt_1_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
855 STRCAT_TEXT_PRINT tMeters
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
856 TFT_display_tts_alt_1_com:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
857 WIN_LARGE .117,.95
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
858 movff char_O_first_deco_time,lo ; length of first stop in min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
859 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
860 output_99
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
861 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
862 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
863
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
864 TFT_big_deco_ndl_alt:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
865 ; NDL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
866 bcf FLAG_TFT_display_ndl
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
867 bcf decostop_active ; clear flag (again)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
868 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
869 WIN_STD .70,.165
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
870 STRCPY_TEXT_PRINT tNDL ; NDL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
871 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
872 WIN_LARGE .97,.170
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
873 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
874 movff char_O_nullzeit,lo ; Get NDL from C-code
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
875 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
876 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
877
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
878 btfsc FLAG_TFT_show_safety_stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
879 bra TFT_show_safety_stop_alt ; Show safety stop (And return)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
880 ; Clear any safety stop or Decostop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
881 TFT_no_more_safety_stop_alt:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
882 WIN_BOX_BLACK dm_customview_row, .150, .0, .159 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
883 WIN_BOX_BLACK dm_customview_row, .164, .60, .159 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
884 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
885
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
886 TFT_show_safety_stop_alt:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
887 bcf FLAG_TFT_show_safety_stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
888 tstfsz safety_stop_countdown ; Countdown at zero?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
889 bra TFT_show_safety_stop_alt2 ; No, show stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
890 bcf show_safety_stop ; Clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
891 btfss safety_stop_active ; Displayed?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
892 return ; No
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
893 bcf safety_stop_active ; Clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
894 bra TFT_no_more_safety_stop_alt ; Yes, Clear stop ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
895
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
896 TFT_show_safety_stop_alt2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
897 bsf safety_stop_active ; Set flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
898 decf safety_stop_countdown,F ; Reduce countdown
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
899
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
900 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
901 WIN_STD .50,dm_customview_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
902 STRCPY_TEXT_PRINT tDiveSafetyStop
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
903 call TFT_attention_color ; show in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
904 WIN_LARGE .90,.95
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
905 movff safety_stop_countdown,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
906 clrf hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
907 call convert_time ; converts hi:lo in seconds to mins (hi) and seconds (lo)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
908 movf hi,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
909 movff lo,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
910 movwf lo ; exchange lo and hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
911 bsf leftbind
0
heinrichsweikamp
parents:
diff changeset
912 output_8
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
913 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
914 WIN_MEDIUM .112,.120
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
915 STRCAT_PRINT ":"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
916 WIN_LARGE .117,.95
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
917 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
918 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
919 output_99x
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
920 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
921 WIN_FONT FT_SMALL
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
922 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
923
0
heinrichsweikamp
parents:
diff changeset
924
heinrichsweikamp
parents:
diff changeset
925 global TFT_divemode_warning
heinrichsweikamp
parents:
diff changeset
926 TFT_divemode_warning:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
927 bcf FLAG_TFT_divemode_warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
928 bsf dive_warning_displayed ; =1: The warning sign is shown
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
929 WIN_TOP dm_warning_icon_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
930 WIN_LEFT dm_warning_icon_column
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
931 TFT_WRITE_PROM_IMAGE dive_warning2_block ; Show Warning icon
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
932 return
0
heinrichsweikamp
parents:
diff changeset
933
heinrichsweikamp
parents:
diff changeset
934 global TFT_divemode_warning_clear
heinrichsweikamp
parents:
diff changeset
935 TFT_divemode_warning_clear:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
936 bcf FLAG_TFT_divemode_warning_clear
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
937 btfss dive_warning_displayed ; =1: The warning sign is shown
0
heinrichsweikamp
parents:
diff changeset
938 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
939 bcf dive_warning_displayed ; clear only once
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
940 WIN_BOX_BLACK dm_warning_icon_row, dm_warning_icon_bot, dm_warning_icon_column, dm_warning_icon_rgt ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
941 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
942
0
heinrichsweikamp
parents:
diff changeset
943 global TFT_display_deko_mask
heinrichsweikamp
parents:
diff changeset
944 TFT_display_deko_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
945 bcf FLAG_TFT_display_deko_mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
946 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
947 return ; Yes, return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
948 rcall TFT_clear_decoarea ; Clear Dekostop and Dekosum (and NDL in this case)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
949 WIN_STD dm_tts_text_column, dm_tts_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
950 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
951 STRCPY_TEXT_PRINT tTTS ; TTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
952 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
953 bcf show_safety_stop ; Clear safety stop flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
954 return
0
heinrichsweikamp
parents:
diff changeset
955
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
956
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
957 TFT_display_deko_output_depth: ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (for ft)
0
heinrichsweikamp
parents:
diff changeset
958 TSTOSS opt_units ; 0=m, 1=ft
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
959 bra TFT_display_deko_output_metric
0
heinrichsweikamp
parents:
diff changeset
960 ;TFT_display_deko_output_imperial:
heinrichsweikamp
parents:
diff changeset
961 movf lo,W ; lo = m
heinrichsweikamp
parents:
diff changeset
962 mullw .100 ; PRODL:PRODH = mbar
heinrichsweikamp
parents:
diff changeset
963 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
964 movff PRODH,hi
heinrichsweikamp
parents:
diff changeset
965 ; Convert with 334feet/100m to have 10ft, 20ft, 30ft stops...
heinrichsweikamp
parents:
diff changeset
966 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
967 movff hi,xA+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
968 movlw LOW d'334' ; 334feet/100m
0
heinrichsweikamp
parents:
diff changeset
969 movwf xB+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
970 movlw HIGH d'334'
0
heinrichsweikamp
parents:
diff changeset
971 movwf xB+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
972 call mult16x16 ; xA*xB=xC (lo:hi * 328)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
973 movlw d'50' ; round up
0
heinrichsweikamp
parents:
diff changeset
974 addwf xC+0,F
heinrichsweikamp
parents:
diff changeset
975 movlw 0
heinrichsweikamp
parents:
diff changeset
976 addwfc xC+1,F
heinrichsweikamp
parents:
diff changeset
977 addwfc xC+2,F
heinrichsweikamp
parents:
diff changeset
978 addwfc xC+3,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
979 movlw d'100'
0
heinrichsweikamp
parents:
diff changeset
980 movwf xB+0
heinrichsweikamp
parents:
diff changeset
981 clrf xB+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
982 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
0
heinrichsweikamp
parents:
diff changeset
983 movff xC+0,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
984 movff xC+1,hi ; restore lo and hi with updated value
0
heinrichsweikamp
parents:
diff changeset
985 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
986 btfsc alternative_divelayout
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
987 bsf leftbind ; left for alternative layout mode
0
heinrichsweikamp
parents:
diff changeset
988 bsf ignore_digit4 ; Only full feet
heinrichsweikamp
parents:
diff changeset
989 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
990 btfsc alternative_divelayout
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
991 return ; Not for alternative layout mode
0
heinrichsweikamp
parents:
diff changeset
992 STRCAT_TEXT tFeets1
heinrichsweikamp
parents:
diff changeset
993 return
heinrichsweikamp
parents:
diff changeset
994
heinrichsweikamp
parents:
diff changeset
995 TFT_display_deko_output_metric:
heinrichsweikamp
parents:
diff changeset
996 output_99
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
997 btfsc alternative_divelayout
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
998 return ; Not for alternative layout mode
0
heinrichsweikamp
parents:
diff changeset
999 STRCAT_TEXT tMeters
heinrichsweikamp
parents:
diff changeset
1000 PUTC ' '
heinrichsweikamp
parents:
diff changeset
1001 return
heinrichsweikamp
parents:
diff changeset
1002
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1003
0
heinrichsweikamp
parents:
diff changeset
1004 global TFT_display_deko
heinrichsweikamp
parents:
diff changeset
1005 TFT_display_deko:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1006 bcf FLAG_TFT_display_deko
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1007 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1008 return ; Yes, return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1009 WIN_MEDIUM dm_decostop_1st_stop_column, dm_decostop_1st_stop_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1010 call TFT_color_code_stop ; Color-code Output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1011 movff char_O_first_deco_depth,lo ; stop depth in m
0
heinrichsweikamp
parents:
diff changeset
1012 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1013 movff char_O_first_deco_time,lo ; length of first stop in min
0
heinrichsweikamp
parents:
diff changeset
1014 output_99
heinrichsweikamp
parents:
diff changeset
1015 STRCAT_PRINT "'"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1016 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1017
0
heinrichsweikamp
parents:
diff changeset
1018
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1019 global TFT_decoplan
0
heinrichsweikamp
parents:
diff changeset
1020 TFT_decoplan:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1021 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1022 WIN_TINY dm_custom_decoplan_title_column, dm_custom_decoplan_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1023 STRCPY_TEXT_PRINT tDiveDecoplan
526
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
1024 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1025 movff char_O_deco_depth+1,lo
heinrichsweikamp
parents:
diff changeset
1026 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1027 bra TFT_display_deko2 ; Yes
heinrichsweikamp
parents:
diff changeset
1028 ; No, clear output and return
heinrichsweikamp
parents:
diff changeset
1029 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1030 WIN_SMALL dm_cust_dstop_4th_stop_column,dm_cust_dstop_4th_stop_row
97
53a99a2dc6a1 CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents: 96
diff changeset
1031 STRCPY_PRINT " --- "
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1032 WIN_BOX_BLACK dm_cust_dstop_2nd_stop_row, dm_customview_bot-.2, dm_cust_dstop_2nd_stop_column, dm_cust_dstop_4th_stop_column ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1033 WIN_BOX_BLACK dm_cust_dstop_5th_stop_row, dm_customview_bot, dm_cust_dstop_5th_stop_column, dm_cust_dstop_6th_stop_column ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1034 WIN_BOX_BLACK dm_cust_dstop_6th_stop_row, dm_customview_bot, dm_cust_dstop_6th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1035 goto TFT_standard_color ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1036
0
heinrichsweikamp
parents:
diff changeset
1037 TFT_display_deko2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1038 movff char_O_deco_gas+0,lo ; get flag for invalid deco data
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1039 btfsc lo,char_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1040 call TFT_disabled_color ; YES - set to disabled color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1041 WIN_SMALL dm_cust_dstop_2nd_stop_column, dm_cust_dstop_2nd_stop_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1042 movff char_O_deco_depth+1,lo ; stop in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1043 bcf lo,7 ; Clear GAS_SWITCH bit
0
heinrichsweikamp
parents:
diff changeset
1044 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1045 movff char_O_deco_time+1,lo ; length of stop in min
0
heinrichsweikamp
parents:
diff changeset
1046 output_99
heinrichsweikamp
parents:
diff changeset
1047 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1048 movff char_O_deco_depth+2,lo
heinrichsweikamp
parents:
diff changeset
1049 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1050 bra TFT_display_deko3 ; Yes
heinrichsweikamp
parents:
diff changeset
1051 ; No, clear output and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1052 WIN_BOX_BLACK dm_cust_dstop_3rd_stop_row, dm_customview_bot-.2, dm_cust_dstop_2nd_stop_column, dm_cust_dstop_4th_stop_column ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1053 WIN_BOX_BLACK dm_cust_dstop_4th_stop_row, dm_customview_bot, dm_cust_dstop_4th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1054 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
1055
heinrichsweikamp
parents:
diff changeset
1056 TFT_display_deko3:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1057 WIN_SMALL dm_cust_dstop_3rd_stop_column, dm_cust_dstop_3rd_stop_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1058 movff char_O_deco_depth+2,lo ; stop in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1059 bcf lo,7 ; Clear GAS_SWITCH bit
0
heinrichsweikamp
parents:
diff changeset
1060 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1061 movff char_O_deco_time+2,lo ; length of stop in min
0
heinrichsweikamp
parents:
diff changeset
1062 output_99
heinrichsweikamp
parents:
diff changeset
1063 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1064 movff char_O_deco_depth+3,lo
heinrichsweikamp
parents:
diff changeset
1065 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1066 bra TFT_display_deko4 ; Yes
heinrichsweikamp
parents:
diff changeset
1067 ; No, clear output and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1068 WIN_BOX_BLACK dm_cust_dstop_4th_stop_row, dm_customview_bot, dm_cust_dstop_4th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1069 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
1070
heinrichsweikamp
parents:
diff changeset
1071 TFT_display_deko4:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1072 WIN_SMALL dm_cust_dstop_4th_stop_column, dm_cust_dstop_4th_stop_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1073 movff char_O_deco_depth+3,lo ; stop in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1074 bcf lo,7 ; Clear GAS_SWITCH bit
0
heinrichsweikamp
parents:
diff changeset
1075 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1076 movff char_O_deco_time+3,lo ; length of stop in min
0
heinrichsweikamp
parents:
diff changeset
1077 output_99
heinrichsweikamp
parents:
diff changeset
1078 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1079
heinrichsweikamp
parents:
diff changeset
1080 movff char_O_deco_depth+4,lo
heinrichsweikamp
parents:
diff changeset
1081 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1082 bra TFT_display_deko5 ; Yes
heinrichsweikamp
parents:
diff changeset
1083 ; No, clear output and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1084 WIN_BOX_BLACK dm_cust_dstop_5th_stop_row, dm_customview_bot, dm_cust_dstop_5th_stop_column, dm_cust_dstop_6th_stop_column ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1085 WIN_BOX_BLACK dm_cust_dstop_6th_stop_row, dm_customview_bot, dm_cust_dstop_6th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1086 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
1087
heinrichsweikamp
parents:
diff changeset
1088 TFT_display_deko5:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1089 WIN_SMALL dm_cust_dstop_5th_stop_column, dm_cust_dstop_5th_stop_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1090 movff char_O_deco_depth+4,lo ; stop in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1091 bcf lo,7 ; Clear GAS_SWITCH bit
0
heinrichsweikamp
parents:
diff changeset
1092 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1093 movff char_O_deco_time+4,lo ; length of stop in min
0
heinrichsweikamp
parents:
diff changeset
1094 output_99
heinrichsweikamp
parents:
diff changeset
1095 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1096 movff char_O_deco_depth+5,lo
heinrichsweikamp
parents:
diff changeset
1097 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1098 bra TFT_display_deko6 ; Yes
heinrichsweikamp
parents:
diff changeset
1099 ; No, clear output and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1100 WIN_BOX_BLACK dm_cust_dstop_6th_stop_row, dm_customview_bot, dm_cust_dstop_6th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1101 goto TFT_standard_color ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1102
0
heinrichsweikamp
parents:
diff changeset
1103 TFT_display_deko6:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1104 WIN_SMALL dm_cust_dstop_6th_stop_column, dm_cust_dstop_6th_stop_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1105 movff char_O_deco_depth+5,lo ; stop in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1106 bcf lo,7 ; Clear GAS_SWITCH bit
0
heinrichsweikamp
parents:
diff changeset
1107 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1108 movff char_O_deco_time+5,lo ; length of stop in min
0
heinrichsweikamp
parents:
diff changeset
1109 output_99
heinrichsweikamp
parents:
diff changeset
1110 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1111 movff char_O_deco_depth+6,lo
heinrichsweikamp
parents:
diff changeset
1112 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1113 bra TFT_display_deko7 ; Yes
heinrichsweikamp
parents:
diff changeset
1114 ; No, clear output and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1115 WIN_BOX_BLACK dm_cust_dstop_7th_stop_row, dm_customview_bot, dm_cust_dstop_7th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1116 goto TFT_standard_color ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1117
0
heinrichsweikamp
parents:
diff changeset
1118 TFT_display_deko7:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1119 WIN_SMALL dm_cust_dstop_7th_stop_column, dm_cust_dstop_7th_stop_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1120 movff char_O_deco_depth+6,lo ; stop in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1121 bcf lo,7 ; Clear GAS_SWITCH bit
0
heinrichsweikamp
parents:
diff changeset
1122 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1123 movff char_O_deco_time+6,lo ; length of stop in min
0
heinrichsweikamp
parents:
diff changeset
1124 output_99
heinrichsweikamp
parents:
diff changeset
1125 STRCAT_PRINT "'"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1126 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1127
0
heinrichsweikamp
parents:
diff changeset
1128
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1129 global TFT_clear_safety_stop
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1130 TFT_clear_safety_stop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1131 bcf FLAG_TFT_clear_safety_stop ; clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1132 WIN_BOX_BLACK dm_safetystop_row, dm_safetystop_bot, dm_safetystop_text_column, .159 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1133 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1134
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1135 global TFT_show_safety_stop
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1136 TFT_show_safety_stop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1137 bcf FLAG_TFT_show_safety_stop
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1138 tstfsz safety_stop_countdown ; Countdown at zero?
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1139 bra TFT_show_safety_stop2 ; No, show stop
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1140 bcf show_safety_stop ; Clear flag
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1141 btfss safety_stop_active ; Displayed?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1142 return ; No
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1143 bcf safety_stop_active ; Clear flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1144 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1145 return ; Yes, return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1146 bra TFT_clear_safety_stop ; Yes, Clear stop ; and return...
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1147 TFT_show_safety_stop2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1148 bsf safety_stop_active ; Set flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1149 decf safety_stop_countdown,F ; Reduce countdown
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1150 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1151 return ; Yes, return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1152 ;btfsc menuview
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1153 ;bra TFT_show_safety_stop3 ; No room when menuview=1...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1154 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1155 WIN_STD dm_safetystop_text_column, dm_safetystop_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1156 STRCPY_TEXT_PRINT tDiveSafetyStop
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1157 TFT_show_safety_stop3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1158 call TFT_attention_color ; show in yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1159 WIN_MEDIUM dm_safetystop_column, dm_safetystop_row
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1160 movff safety_stop_countdown,lo
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1161 clrf hi
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1162 call convert_time ; converts hi:lo in seconds to mins (hi) and seconds (lo)
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1163 movf hi,W
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1164 movff lo,hi
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1165 movwf lo ; exchange lo and hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1166 bsf leftbind
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1167 output_8
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1168 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1169 PUTC ':'
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1170 movff hi,lo
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1171 output_99x
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1172 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1173 WIN_FONT FT_SMALL
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1174 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1175
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1176
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1177 global TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch
0
heinrichsweikamp
parents:
diff changeset
1178 TFT_mask_avr_stopwatch:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1179 ; The mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1180 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1181 WIN_TINY dm_custom_avr_stop_title_column1,dm_custom_avr_stop_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1182 STRCPY_TEXT_PRINT tDiveTotalAvg
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1183 WIN_TINY dm_custom_avr_stop_title_column2,dm_custom_avr_stop_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1184 STRCPY_TEXT_PRINT tDiveStopwatch
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1185 WIN_TINY dm_custom_avr_stop_title_column3,dm_custom_avr_stop_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1186 STRCPY_TEXT_PRINT tDiveStopAvg
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1187 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1188
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1189 global TFT_update_avr_stopwatch ; Update average depth and stopwatch
0
heinrichsweikamp
parents:
diff changeset
1190 TFT_update_avr_stopwatch:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1191 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1192 SAFE_2BYTE_COPY average_divesecs,lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1193 call convert_time ; lo=secs, hi=mins
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1194 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1195 bsf leftbind
0
heinrichsweikamp
parents:
diff changeset
1196 movf hi,W
heinrichsweikamp
parents:
diff changeset
1197 movff lo,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1198 movwf lo ; exchange lo and hi
0
heinrichsweikamp
parents:
diff changeset
1199 output_8
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1200 PUTC ':'
0
heinrichsweikamp
parents:
diff changeset
1201 movff hi,lo
heinrichsweikamp
parents:
diff changeset
1202 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1203 movlw .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1204 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1205 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1206 movff WREG,buffer+.5 ; limit to 5 chars
0
heinrichsweikamp
parents:
diff changeset
1207 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1208 TSTOSS opt_units ; 0=m, 1=ft
0
heinrichsweikamp
parents:
diff changeset
1209 bra TFT_update_avr_stopwatch_metric
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1210 ;TFT_update_avr_stopwatch_imperial
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1211 movff avg_rel_pressure_total+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1212 movff avg_rel_pressure_total+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1213 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1214 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1215 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1216 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1217 output_16 ; yxz
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1218 STRCAT_PRINT " "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1219 ; Stopped average depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1220 movff avg_rel_pressure+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1221 movff avg_rel_pressure+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1222 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1223 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1224 WIN_MEDIUM dm_custom_avr_stop_column3,dm_custom_avr_stop_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1225 output_16 ; yxz
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1226 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1227 PUTC " "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1228 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1229 movff WREG,buffer+.3 ; limit string length to 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1230 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1231 return
0
heinrichsweikamp
parents:
diff changeset
1232
heinrichsweikamp
parents:
diff changeset
1233 TFT_update_avr_stopwatch_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1234 ; Non-resettable average depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1235 movff avg_rel_pressure_total+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1236 movff avg_rel_pressure_total+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1237 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1238 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1239 bsf ignore_digit5 ; no cm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1240 output_16dp .3 ; yxz.a
589
8a7d2d8bcd33 limit string length to 4 digits/chars in average depth
heinrichsweikamp
parents: 587
diff changeset
1241 clrf WREG
8a7d2d8bcd33 limit string length to 4 digits/chars in average depth
heinrichsweikamp
parents: 587
diff changeset
1242 movff WREG,buffer+.4 ; limit string length to 4 digits/chars
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1243 STRCAT_PRINT " "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1244 ; Stopped average depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1245 movff avg_rel_pressure+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1246 movff avg_rel_pressure+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1247 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1248 WIN_MEDIUM dm_custom_avr_stop_column3,dm_custom_avr_stop_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1249 bsf ignore_digit5 ; no cm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1250 output_16dp .3 ; yxz.a
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1251 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1252 bcf ignore_digit5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1253 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1254 movff WREG,buffer+.4 ; limit string length to 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1255 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1256 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1257
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1258
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1259 global TFT_ceiling_mask ; The ceiling mask
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1260 TFT_ceiling_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1261 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1262 WIN_TINY dm_custom_ceiling_text_column,dm_custom_ceiling_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1263 STRCPY_TEXT_PRINT tCeiling
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1264 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1265
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1266 global TFT_ceiling ; Ceiling
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1267 TFT_ceiling:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1268 WIN_MEDIUM dm_custom_ceiling_value_column,dm_custom_ceiling_value_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1269 movff int_O_ceiling+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1270 movff int_O_ceiling+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1271 call TFT_color_code_ceiling ; color-code the output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1272 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1273 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1274 TSTOSS opt_units ; 0=m, 1=ft
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1275 bra TFT_ceiling_metric
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1276 ;TFT_ceiling_imperial
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1277 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1278 output_16 ; yxz
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1279 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1280 STRCAT_PRINT " "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1281 goto TFT_standard_color
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1282
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1283 TFT_ceiling_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1284 bsf ignore_digit5 ; no cm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1285 output_16dp .3 ; yxz.a
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1286 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1287 bcf ignore_digit5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1288 STRCAT_PRINT " "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1289 goto TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1290
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1291
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1292 global TFT_CNS_mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1293 TFT_CNS_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1294 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1295 WIN_TINY dm_custom_gf_title_col1, dm_custom_gf_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1296 STRCPY_TEXT_PRINT tCNSsurf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1297 WIN_TINY dm_custom_gf_title_col2, dm_custom_gf_title_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1298 btfsc FLAG_ccr_mode ; in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1299 bra TFT_CNS_mask_1 ; YES - proceed with checking for bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1300 btfsc FLAG_pscr_mode ; NO - in pSCR mode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1301 bra TFT_CNS_mask_1 ; YES - proceed with checking for bailout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1302 bra TFT_CNS_mask_2 ; NO - must be OC then
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1303 TFT_CNS_mask_1: ; in CCR or pSCR mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1304 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1305 bra TFT_CNS_mask_2 ; YES - print fTTS label (label will be printed, but a fTTS will actually not be calculated)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1306 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1307 bra TFT_CNS_mask_2 ; NO - print fTTS label
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1308 STRCPY_TEXT_PRINT tCNSBO ; YES - print bailout label
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1309 bra TFT_CNS_mask_3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1310 TFT_CNS_mask_2: ; OC or bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1311 STRCPY_TEXT_PRINT tCNSfTTS ; print fTTS label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1312 TFT_CNS_mask_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1313 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1314 STRCPY_TEXT_PRINT tCNSnow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1315 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1316
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1317 global TFT_CNS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1318 TFT_CNS:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1319 ; CNS at end of normal dive
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1320 WIN_STD dm_custom_hud_sensor1_column+.5,dm_custom_hud_data_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1321 movff int_O_normal_CNS_fraction+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1322 movff int_O_normal_CNS_fraction+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1323 call TFT_color_code_cns
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1324 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1325 output_16_3 ; output as xxx
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1326 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1327 STRCAT_PRINT "% "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1328 ; fTTS / Bailout CNS, if enabled
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1329 WIN_STD dm_custom_hud_sensor2_column+.2,dm_custom_hud_data_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1330 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1331 bra TFT_CNS_3 ; YES - show "---"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1332 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1333 bra TFT_CNS_1 ; NO - continue checking fTTS extra time
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1334 btfsc FLAG_ccr_mode ; YES - in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1335 bra TFT_CNS_2 ; YES - skip test for fTTS extra time and show CNS%
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1336 btfsc FLAG_pscr_mode ; in pSCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1337 bra TFT_CNS_2 ; YES - skip test for fTTS extra time and show CNS%
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1338 TFT_CNS_1: ; not in bailout, no volume calculation
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1339 TSTOSS char_I_extra_time ; fTTS extra time fTTS configured?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1340 bra TFT_CNS_3 ; NO - show "---"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1341 TFT_CNS_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1342 movff int_O_alternate_CNS_fraction+0,lo ; YES - show CNS%
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1343 movff int_O_alternate_CNS_fraction+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1344 call TFT_color_code_cns
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1345 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1346 output_16_3 ; output as xxx
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1347 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1348 STRCAT_PRINT "% "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1349 bra TFT_CNS_4
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1350 TFT_CNS_3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1351 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1352 STRCPY_PRINT "--- "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1353 TFT_CNS_4:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1354 ; current CNS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1355 WIN_STD dm_custom_hud_sensor3_column,dm_custom_hud_data_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1356 movff int_O_CNS_fraction+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1357 movff int_O_CNS_fraction+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1358 call TFT_color_code_cns
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1359 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1360 output_16_3 ; output as xxx
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1361 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1362 STRCAT_PRINT "%"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1363 goto TFT_standard_color ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1364
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1365
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1366 global TFT_hud_mask ; The HUD mask
0
heinrichsweikamp
parents:
diff changeset
1367 TFT_hud_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1368 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1369 WIN_TINY dm_custom_hud_column1,dm_custom_hud_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1370 STRCPY_TEXT_PRINT tDiveHudMask1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1371 WIN_TINY dm_custom_hud_column2,dm_custom_hud_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1372 STRCPY_TEXT_PRINT tDiveHudMask2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1373 WIN_TINY dm_custom_hud_column3,dm_custom_hud_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1374 STRCPY_TEXT_PRINT tDiveHudMask3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1375 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1376
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1377
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1378 global TFT_update_ppo2_sensors ; Update Sensor data
192
efe70488a04b voting logic for external monitoring
heinrichsweikamp
parents: 191
diff changeset
1379 TFT_update_ppo2_sensors:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1380 ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1381 ; Definition of the output:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1382 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1383 ; sensorX use voting o2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1384 ; _calibrated _O2 _logic _ppo2 Output Color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1385 ; _ok _sensorX _sensorX _sensorX
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1386 ;-----------------------------------------------------------------------------------------------
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1387 ; 0 -/- -/- -/- "----" TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1388 ; 1 0 -/- = 0 o2_ppo2_sensorX TFT_attention_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1389 ; 1 0 -/- > 0 o2_ppo2_sensorX TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1390 ; 1 1 0 -/- o2_ppo2_sensorX TFT_color_code_ppo2_hud + win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1391 ; 1 1 1 -/- o2_ppo2_sensorX TFT_color_code_ppo2_hud
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1392 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1393 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1394 ; sensor 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1395 btfsc sensor1_calibrated_ok ; valid calibration?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1396 bra TFT_update_hud1b ; yes
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1397 btfsc sensor1_active ; valid HUD data for this sensor
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1398 bra TFT_update_hud1b ; yes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1399 ; no valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1400 WIN_STD dm_custom_hud_sensor1_column+.7, dm_custom_hud_data_row+.5
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1401 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1402 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1403 bra TFT_update_hud2a ; continue with sensor 2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1404 TFT_update_hud1b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1405 ; sensor has a valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1406 WIN_MEDIUM dm_custom_hud_sensor1_column,dm_custom_hud_data_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1407 movff o2_ppo2_sensor1,lo ; load ppO2 value into transfer storage for output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1408 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1409 btfsc use_O2_sensor1 ; in use?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1410 bra TFT_update_hud1d ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1411 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1412 tstfsz o2_ppo2_sensor1 ; sensor value = 0?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1413 bra TFT_update_hud1c ; no
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1414 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1415 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1416 bra TFT_update_hud1e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1417 TFT_update_hud1c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1418 ; sensor has valid calibration, is not in use and has a value > 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1419 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1420 bra TFT_update_hud1e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1421 TFT_update_hud1d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1422 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1423 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1424 btfsc voting_logic_sensor1 ; sensor value agrees with other sensor's values?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1425 bra TFT_update_hud1e ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1426 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1427 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1428 TFT_update_hud1e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1429 ; all coloring is set up now, let's write the value to the display!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1430 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1431 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1432 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1433 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1434 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1435
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1436 TFT_update_hud2a: ; sensor 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1437 btfsc sensor2_calibrated_ok ; valid calibration?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1438 bra TFT_update_hud2b ; yes
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1439 btfsc sensor2_active ; valid HUD data for this sensor
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1440 bra TFT_update_hud2b ; yes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1441 ; no valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1442 WIN_STD dm_custom_hud_sensor2_column+.7, dm_custom_hud_data_row+.5
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1443 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1444 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1445 bra TFT_update_hud3a ; continue with sensor 3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1446 TFT_update_hud2b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1447 ; sensor has a valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1448 WIN_MEDIUM dm_custom_hud_sensor2_column,dm_custom_hud_data_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1449 movff o2_ppo2_sensor2,lo ; load ppO2 value into transfer storage for output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1450 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1451 btfsc use_O2_sensor2 ; in use?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1452 bra TFT_update_hud2d ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1453 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1454 tstfsz o2_ppo2_sensor2 ; sensor value = 0?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1455 bra TFT_update_hud2c ; no
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1456 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1457 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1458 bra TFT_update_hud2e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1459 TFT_update_hud2c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1460 ; sensor has valid calibration, is not in use and has a value > 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1461 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1462 bra TFT_update_hud2e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1463 TFT_update_hud2d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1464 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1465 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1466 btfsc voting_logic_sensor2 ; sensor value agrees with other sensor's vlaues?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1467 bra TFT_update_hud2e ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1468 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1469 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1470 TFT_update_hud2e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1471 ; all coloring is set up now, let's write the value to the display!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1472 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1473 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1474 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1475 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1476 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1477
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1478 TFT_update_hud3a: ; sensor 3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1479 btfsc sensor3_calibrated_ok ; valid calibration?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1480 bra TFT_update_hud3b ; yes
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1481 btfsc sensor3_active ; valid HUD data for this sensor
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1482 bra TFT_update_hud3b ; yes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1483 ; no valid calibration
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1484 WIN_STD dm_custom_hud_sensor3_column+.7, dm_custom_hud_data_row+.5
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1485 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1486 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1487 bra TFT_update_hud4 ; done
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1488 TFT_update_hud3b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1489 ; sensor has a valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1490 WIN_MEDIUM dm_custom_hud_sensor3_column,dm_custom_hud_data_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1491 movff o2_ppo2_sensor3,lo ; load ppO2 value into transfer storage for output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1492 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1493 btfsc use_O2_sensor3 ; in use?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1494 bra TFT_update_hud3d ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1495 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1496 tstfsz o2_ppo2_sensor3 ; sensor value = 0?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1497 bra TFT_update_hud3c ; no
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1498 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1499 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1500 bra TFT_update_hud3e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1501 TFT_update_hud3c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1502 ; sensor has valid calibration, is not in use and has a value > 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1503 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1504 bra TFT_update_hud3e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1505 TFT_update_hud3d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1506 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1507 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1508 btfsc voting_logic_sensor3 ; sensor value agrees with other sensor's vlaues?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1509 bra TFT_update_hud3e ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1510 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1511 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1512 TFT_update_hud3e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1513 ; all coloring is set up now, let's write the value to the display!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1514 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1515 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1516 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1517 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1518 bcf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1519
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1520 TFT_update_hud4: ; closure
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1521 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1522 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1523
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1524
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1525 global TFT_surface_sensor ; Update Sensor data in surface mode
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1526 TFT_surface_sensor:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1527 movf hardware_flag,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1528 sublw 0x11 ; 2 with BLE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1529 btfsc STATUS,Z
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1530 return ; Ignore for 0x11
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1531 ; show three sensors
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1532 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1533 WIN_SMALL surf_hud_sensor1_column,surf_hud_sensor1_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1534 btfsc sensor1_calibrated_ok
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1535 bra TFT_surface_sensor1 ; Yes
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1536 btfsc sensor1_active ; valid HUD data for this sensor
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1537 bra TFT_surface_sensor1 ; Yes
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1538 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1539 STRCPY_PRINT "--- "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1540 bra TFT_surface_sensor2 ; Skip Sensor 1
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1541 TFT_surface_sensor1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1542 movff o2_ppo2_sensor1,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1543 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1544 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1545 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1546 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1547 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1548 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1549 TFT_surface_sensor2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1550 WIN_SMALL surf_hud_sensor2_column,surf_hud_sensor2_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1551 btfsc sensor2_calibrated_ok
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1552 bra TFT_surface_sensor3 ; Yes
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1553 btfsc sensor2_active ; valid HUD data for this sensor
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1554 bra TFT_surface_sensor3 ; Yes
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1555 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1556 STRCPY_PRINT "--- "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1557 bra TFT_surface_sensor4 ; Skip Sensor 2
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1558 TFT_surface_sensor3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1559 movff o2_ppo2_sensor2,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1560 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1561 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1562 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1563 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1564 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1565 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1566 TFT_surface_sensor4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1567 WIN_SMALL surf_hud_sensor3_column,surf_hud_sensor3_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1568 btfsc sensor3_calibrated_ok
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1569 bra TFT_surface_sensor5 ; Yes
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1570 btfsc sensor3_active ; valid HUD data for this sensor
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1571 bra TFT_surface_sensor5 ; Yes
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
1572
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1573 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1574 STRCPY_PRINT "--- "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1575 bra TFT_surface_sensor6 ; Skip Sensor 3
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1576 TFT_surface_sensor5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1577 movff o2_ppo2_sensor3,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1578 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1579 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1580 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1581 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1582 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1583 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1584 TFT_surface_sensor6:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1585 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1586 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1587
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1588
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1589 global TFT_sensor_mV
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1590 TFT_sensor_mV:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1591 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1592 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1593 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1594 movff o2_mv_sensor1+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1595 movff o2_mv_sensor1+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1596 STRCAT "1: "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1597 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1598 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1599
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1600 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1601 movff o2_mv_sensor2+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1602 movff o2_mv_sensor2+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1603 STRCAT "2: "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1604 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1605 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1606
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1607 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1608 movff o2_mv_sensor3+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1609 movff o2_mv_sensor3+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1610 STRCAT "3: "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1611 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1612 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1613 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1614 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1615
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1616
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1617 global TFT_sensor_surface_warning
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1618 TFT_sensor_surface_warning:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1619 call TFT_warnings_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1620 btfss sensor1_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1621 bra TFT_sensor_mV2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1622 movff opt_x_s1+1,lo ; into bank1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1623 movf lo,W ; when opt_x_s1 > 255 the sensor will just give 8 mV at a ppO2 of 0,21 any more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1624 bz TFT_sensor_mV2 ; the sensor is not too bad yet for a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1625 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor1_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1626 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1627 TFT_sensor_mV2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1628 btfss sensor2_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1629 bra TFT_sensor_mV3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1630 movff opt_x_s2+1,lo ; into bank1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1631 movf lo,W ; when opt_x_s2 > 255 the sensor will just give 8 mV at a ppO2 of 0,21 any more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1632 bz TFT_sensor_mV3 ; the sensor is not too bad yet for a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1633 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor2_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1634 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1635 TFT_sensor_mV3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1636 btfss sensor3_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1637 bra TFT_sensor_mV4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1638 movff opt_x_s3+1,lo ; into bank1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1639 movf lo,W ; when opt_x_s3 > 255 the sensor will just give 8 mV at a ppO2 of 0,21 any more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1640 bz TFT_sensor_mV4 ; the sensor is not too bad yet for a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1641 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor3_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1642 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1643 TFT_sensor_mV4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1644 goto TFT_standard_color ; ...and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1645
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1646
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1647 global TFT_menu_calibrate
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1648 TFT_menu_calibrate: ; update mV data in calibration menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1649 btfss s8_digital ; =1: Digital I/O
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1650 bra TFT_menu_calibrate_analog ; use analog
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1651 btfss new_s8_data_available ; new data frame received?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1652 bra TFT_menu_calibrate_common ; NO - use old values...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1653 ; YES - update the values
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1654 call compute_mvolts_for_all_sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1655 bra TFT_menu_calibrate_common
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1656 TFT_menu_calibrate_analog:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1657 call get_analog_inputs
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1658 TFT_menu_calibrate_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1659 call TFT_attention_color ; show in yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1660 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1661 WIN_SMALL surf_menu_sensor1_column,surf_menu2_sensor1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1662 movff o2_mv_sensor1+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1663 movff o2_mv_sensor1+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1664 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1665 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1666 WIN_SMALL surf_menu_sensor2_column,surf_menu2_sensor2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1667 movff o2_mv_sensor2+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1668 movff o2_mv_sensor2+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1669 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1670 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1671 WIN_SMALL surf_menu_sensor3_column,surf_menu2_sensor3_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1672 movff o2_mv_sensor3+0,lo ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1673 movff o2_mv_sensor3+1,hi ; in 0.1mV steps
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1674 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1675 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1676 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1677 goto TFT_standard_color ; ...and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1678
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1679
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1680 global TFT_clock
0
heinrichsweikamp
parents:
diff changeset
1681 TFT_clock:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1682 WIN_SMALL surf_clock_column,surf_clock_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1683 TFT_clock2: ; called from divemode clock
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1684 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1685 movff hours,lo
heinrichsweikamp
parents:
diff changeset
1686 output_99
heinrichsweikamp
parents:
diff changeset
1687 movlw ':'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1688 btfss secs,0 ; blinking every second
0
heinrichsweikamp
parents:
diff changeset
1689 movlw ' '
heinrichsweikamp
parents:
diff changeset
1690 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
1691 movff mins,lo
heinrichsweikamp
parents:
diff changeset
1692 output_99x
heinrichsweikamp
parents:
diff changeset
1693 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
1694 return
heinrichsweikamp
parents:
diff changeset
1695
heinrichsweikamp
parents:
diff changeset
1696 global TFT_show_time_date_menu
heinrichsweikamp
parents:
diff changeset
1697 TFT_show_time_date_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1698 call speed_fastest
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1699 WIN_SMALL .15,.30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1700 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1701 movff hours,lo
heinrichsweikamp
parents:
diff changeset
1702 output_99
heinrichsweikamp
parents:
diff changeset
1703 PUTC ':'
heinrichsweikamp
parents:
diff changeset
1704 movff mins,lo
heinrichsweikamp
parents:
diff changeset
1705 output_99x
heinrichsweikamp
parents:
diff changeset
1706 PUTC ':'
heinrichsweikamp
parents:
diff changeset
1707 movff secs,lo
heinrichsweikamp
parents:
diff changeset
1708 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1709 STRCAT " - "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1710 movff day,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1711 movff month,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1712 movff year,up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1713 call TFT_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
0
heinrichsweikamp
parents:
diff changeset
1714 STRCAT_PRINT " "
heinrichsweikamp
parents:
diff changeset
1715 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1716
0
heinrichsweikamp
parents:
diff changeset
1717 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
1718
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1719 global TFT_surface_decosettings ; Show all deco settings
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1720 TFT_surface_decosettings:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1721 ; Deco Mode
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1722 call TFT_standard_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1723 WIN_SMALL surf_gaslist_column,surf_gaslist_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1724 STRCAT_PRINT "ZH-L16"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1725 movff char_I_deco_model,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1726 iorwf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1727 bnz TFT_surface_decosettings1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1728 ; Display ZH-L16 sat/desat model
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1729 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1730 lfsr FSR2,buffer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1731 movff char_I_desaturation_multiplier,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1732 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1733 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1734 STRCAT "%/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1735 movff char_I_saturation_multiplier,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1736 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1737 STRCAT_PRINT "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1738 bra TFT_surface_decosettings2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1739 ; Display ZH-L16-GF low/high model
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1740 TFT_surface_decosettings1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1741 TEXT_SMALL surf_gaslist_column+.43,surf_gaslist_row,tZHL16GF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1742 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1743 STRCPY_TEXT tGF ; GF:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1744 movff opt_GF_low,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1745 output_99x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1746 STRCAT "/"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1747 movff opt_GF_high,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1748 output_99x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1749 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1750 TFT_surface_decosettings2: ; fTTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1751 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1752 STRCPY_TEXT tFTTSMenu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1753 movff char_I_extra_time,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1754 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1755 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1756 STRCAT_TEXT_PRINT tMinutes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1757 ; Last Stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1758 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1759 STRCPY_TEXT tLastDecostop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1760 movff opt_last_stop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1761 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1762 STRCAT_TEXT_PRINT tMeters
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1763 ; Salinity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1764 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1765 STRCPY_TEXT tDvSalinity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1766 movff opt_salinity,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1767 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1768 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1769 STRCAT_TEXT_PRINT tPercent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1770 return
0
heinrichsweikamp
parents:
diff changeset
1771
heinrichsweikamp
parents:
diff changeset
1772 global TFT_debug_output
heinrichsweikamp
parents:
diff changeset
1773 TFT_debug_output:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1774 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1775 WIN_TINY .80,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1776 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1777 lfsr FSR2,buffer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1778 movff analog_sw1,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1779 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1780 PUTC ","
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1781 movff analog_sw2,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1782 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1783 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1784 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1785
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1786 global TFT_divetimeout ; Show timeout counter
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1787 TFT_divetimeout:
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1788 call TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1789 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1790 return ; No
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1791 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1792 STRCPY 0x94 ; "End of dive" icon
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1793 movff opt_diveTimeout,WREG ; in [min]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1794 mullw .60
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1795 movff PRODL,sub_a+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1796 movff PRODH,sub_a+1 ; in [s]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1797 movff timeout_counter1+0,sub_b+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1798 movff timeout_counter1+1,sub_b+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1799 call subU16 ; sub_c = sub_a - sub_b (with UNSIGNED values)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1800 movff sub_c+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1801 movff sub_c+1,hi
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1802 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo)
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1803 movf hi,W
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1804 movff lo,hi
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1805 movwf lo ; exchange lo and hi
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1806 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1807 PUTC ':'
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1808 movff hi,lo
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1809 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1810 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1811 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1812 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1813 bcf win_invert
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1814 return
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1815
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1816 global TFT_display_ftts
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1817 TFT_display_ftts:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1818 movff char_I_extra_time,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1819 tstfsz lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1820 bra TFT_display_ftts_a
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1821 return ; char_I_extra_time=0, return.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1822 TFT_display_ftts_a:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1823 movff int_O_alternate_ascenttime+0,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1824 movff int_O_alternate_ascenttime+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1825 iorwf hi,W ; int_O_alternate_ascenttime:2 == 0 ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1826 bnz TFT_display_ftts_b
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1827 return ; No deco, do nothing
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1828 TFT_display_ftts_b:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1829 btfsc is_bailout ; check if we are in bailout mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1830 return ; YES - in bailout no fTTS will be computed, so nothing to display
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1831 incf warning_counter,F ; increase counter
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1832 call TFT_warning_set_window ; sets the row and column for the current warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1833 tstfsz WREG ; is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1834 return ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1835 btfsc FLAG_ccr_mode ; in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1836 bra TFT_display_ftts_1 ; YES - print fTTS label
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1837 btfsc FLAG_pscr_mode ; NO - in pSCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1838 bra TFT_display_ftts_1 ; YES - print fTTS label
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1839 bra TFT_display_ftts_2 ; NO - must be OC then
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1840 TFT_display_ftts_1: ; in CCR or pSCR mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1841 btfsc is_bailout ; in bailout?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1842 bra TFT_display_ftts_2 ; YES - print fTTS label
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1843 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1844 bra TFT_display_ftts_2 ; NO - print fTTS label
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1845 STRCPY "B/O" ; YES - print bailout label
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1846 bra TFT_display_ftts_3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1847 TFT_display_ftts_2: ; OC or bailout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1848 STRCPY "@+" ; print fTTS label
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1849 TFT_display_ftts_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1850 movff char_I_extra_time,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1851 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1852 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1853 PUTC ":"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1854 movff int_O_alternate_ascenttime+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1855 movff int_O_alternate_ascenttime+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1856 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1857 bra TFT_display_ftts1 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1858 bcf hi,int_invalid_flag ; YES - clear flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1859 call TFT_disabled_color ; switch to disabled color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1860 TFT_display_ftts1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1861 movf lo,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1862 iorwf hi,W ; extra_ascenttime == 0 ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1863 bz TFT_display_ftts2 ; YES - show dashes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1864 btfsc hi,int_not_yet_computed ; is the not-computed-yet flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1865 bra TFT_display_ftts2 ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1866 output_16 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1867 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1868 PUTC "'"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1869 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1870 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
0
heinrichsweikamp
parents:
diff changeset
1871 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1872 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1873 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1874 TFT_display_ftts2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1875 STRCAT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1876 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1877 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1878 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1879 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1880 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1881 goto TFT_standard_color ; ...and return
0
heinrichsweikamp
parents:
diff changeset
1882
heinrichsweikamp
parents:
diff changeset
1883
heinrichsweikamp
parents:
diff changeset
1884 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1885
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1886 global TFT_temp_surfmode
0
heinrichsweikamp
parents:
diff changeset
1887 TFT_temp_surfmode:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1888 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1889 WIN_SMALL surf_temp_column+3*8,surf_temp_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1890 TSTOSS opt_units ; 0=°C, 1=°F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1891 bra TFT_temp_surfmode_metric
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1892 STRCAT_TEXT tLogTunitF ; °F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1893 bra TFT_temp_surfmode_common
0
heinrichsweikamp
parents:
diff changeset
1894 TFT_temp_surfmode_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1895 STRCAT_TEXT tLogTunitC ; °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1896 TFT_temp_surfmode_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1897 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1898 WIN_SMALL surf_temp_column,surf_temp_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1899 bra TFT_temp_common
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1900
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1901
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1902 global TFT_temp_divemode
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1903 TFT_temp_divemode:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1904 bcf FLAG_TFT_temp_divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1905 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1906 return ; Yes, no update of temperature now
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1907 btfsc blinking_better_gas ; blinking better Gas?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1908 return ; Yes, no update of temperature now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1909 WIN_SMALL dm_temp_column,dm_temp_row
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1910 TFT_temp_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1911 call TFT_standard_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1912 SAFE_2BYTE_COPY temperature,lo ; get current temperature
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1913 TSTOSS opt_units ; 0=°C, 1=°F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1914 bra TFT_temp_common_1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1915 call convert_celsius_to_fahrenheit ; convert value in lo:hi from celsius to fahrenheit
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1916 TFT_temp_common_1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1917 rcall TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1918 btfsc neg_flag ; is the temperature negative?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1919 bra TFT_temp_common_2 ; YES - the minus sign has already been written
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1920 ; temp is positive, is it less then 10°C?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1921 tstfsz hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1922 bra TFT_temp_common_1a ; >25.5°C, skip here
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1923 movlw .100
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1924 cpfslt lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1925 bra TFT_temp_common_1a ; >10.0°C, skip here
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1926 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1927 output_16dp d'4' ; x.y°C
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1928 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1929 bra TFT_temp_common_3 ; Done.
553
2e70700774b9 Display dezimal for temperatures between 10 and 0?C
heinrichsweikamp
parents: 552
diff changeset
1930 TFT_temp_common_1a:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1931 PUTC " " ; NO - write a space instead of the minus sign
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1932 TFT_temp_common_2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1933 bsf ignore_digit5 ; ignore decimal
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1934 output_16_3 ; output 0-999 without decimal -> writes ' ' - 99
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1935 bcf ignore_digit5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1936 movff buffer+2,lo ; get output from unit position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1937 movlw " " ; load code of the space character
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1938 cpfseq lo ; is there a space sign on the unit position? (happens between +1 and -1)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1939 bra TFT_temp_common_3 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1940 movff WREG,buffer+0 ; YES - replace potential minus sign with a space (temps from -0.9° to -0.1° else would appear as '- 0')
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1941 movlw "0" ; load code of the zero character
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1942 movff WREG,buffer+2 ; replace space with a zero
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1943 TFT_temp_common_3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1944 btfss divemode ; are we in dive mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1945 bra TFT_temp_common_5 ; NO - no unit to append
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1946 TSTOSS opt_units ; YES - check unit type: 0=°C, 1=°F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1947 bra TFT_temp_common_4 ; go metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1948 STRCAT_TEXT tLogTunitF ; append °F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1949 bra TFT_temp_common_5
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1950 TFT_temp_common_4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1951 STRCAT_TEXT tLogTunitC ; append °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1952 TFT_temp_common_5:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1953 STRCAT_PRINT "" ; output to screen
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1954 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1955
0
heinrichsweikamp
parents:
diff changeset
1956 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1957
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1958 global TFT_divemode_menu_cursor
0
heinrichsweikamp
parents:
diff changeset
1959 TFT_divemode_menu_cursor:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1960 WIN_BOX_BLACK dm_menu_row+.1, dm_menu_lower-.1, dm_menu_item1_column-.8, dm_menu_item1_column-.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1961 WIN_BOX_BLACK dm_menu_row+.1, dm_menu_lower-.1, dm_menu_item4_column-.8, dm_menu_item4_column-.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1962 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1963
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1964 movlw dm_menu_item1_column-.8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1965 btfsc menupos1,2 ; >3?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1966 movlw dm_menu_item4_column-.8 ; Yes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1967 movff WREG,win_leftx2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1968
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1969 movff menupos1,lo ; Copy menu position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1970 movlw dm_menu_item6_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1971 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1972 movlw dm_menu_item1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1973 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1974 movlw dm_menu_item2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1975 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1976 movlw dm_menu_item3_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1977 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1978 movlw dm_menu_item4_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1979 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1980 movlw dm_menu_item5_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1981 movff WREG,win_top
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1982 movlw FT_SMALL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1983 movff WREG,win_font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1984 STRCPY_PRINT "\xb7" ; print cursor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1985 return
145
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
1986
0
heinrichsweikamp
parents:
diff changeset
1987 global TFT_active_gas_divemode
heinrichsweikamp
parents:
diff changeset
1988 TFT_active_gas_divemode: ; Display gas/Setpoint
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1989 bcf FLAG_TFT_active_gas_divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1990 btfsc divemode_menu ; Is the dive mode menu shown?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1991 return ; Yes, return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1992 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1993 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1994 btfsc FLAG_ccr_mode ; in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1995 bra TFT_active_setpoint ; Yes, show setpoint and gas mix
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1996 btfsc FLAG_pscr_mode ; in PSCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1997 bra TFT_active_setpoint ; Yes, show setpoint and gas mix
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1998 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1999 btfss better_gas_available ; check if a better gas is available and a gas change is advised in divemode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2000 bra TFT_active_gas_divemode2 ; NO - print in normal rendering
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2001 btg blinking_better_gas ; YES - toggle blink bit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2002 btfss blinking_better_gas ; blink now?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2003 bra TFT_active_gas_divemode2 ; NO - print in normal rendering
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2004 call TFT_attention_color ; YES - blink in yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2005 bsf win_invert ; set invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2006 TFT_active_gas_divemode2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2007 WIN_STD dm_active_gas_column, dm_active_gas_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2008 movff char_I_O2_ratio,lo ; lo now stores O2 in %
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2009 movff char_I_He_ratio,hi ; hi now stores He in %
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2010 call customview_show_mix ; put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2011 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2012 bcf win_invert ; reset invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2013 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2014
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2015 TFT_active_setpoint: ; Show setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2016 btfsc is_bailout ; are we in bailout?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2017 bra TFT_active_setpoint_bail ; YES - show "Bailout" instead of setpoint
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2018 movff int_O_breathed_ppO2+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2019 movff int_O_breathed_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2020 call TFT_color_code_ppo2 ; with ppO2 [cbar] in hi:lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2021 btg blinking_setpoint ; toggle blink bit...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2022 btfss blinking_setpoint ; blink now?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2023 bra TFT_active_setpoint_print ; NO - print ppO2 with normal rendering
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2024 btfsc setpoint_fallback ; YES - check if we are in fallback condition
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2025 bra TFT_active_setpoint_fallb ; YES - process fallback case
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2026 movff int_O_breathed_ppO2+1,WREG ; NO - get flags again (have been cleared in hi:lo by TFT_color_code_ppo2 meanwhile)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2027 btfss WREG,int_warning_flag ; warning flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2028 bra TFT_active_setpoint_print ; NO - ppO2 is ok, print ppO2 with normal rendering
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2029 bra TFT_active_setpoint_com ; YES - continue with blinking common part
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2030 TFT_active_setpoint_fallb: ; set up fallback case
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2031 movlw color_yellow ; text in yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2032 call TFT_set_color ; overwrite setting done by TFT_color_code_ppo2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2033 TFT_active_setpoint_com: ; blinking common part
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2034 bsf win_invert ; set invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2035 TFT_active_setpoint_print:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2036 WIN_STD dm_active_gas_column, dm_active_gas_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2037 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2038 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2039 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2040 STRCAT_TEXT tbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2041 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2042 sublw .1 ; opt_ccr_mode = 1 (Sensor)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2043 bnz TFT_active_setpoint2_a ; NO - skip
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2044 PUTC "*" ; YES - add an astrix
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2045 TFT_active_setpoint2_a:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2046 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2047 bcf win_invert ; reset invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2048 call TFT_standard_color ; revert to standard color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2049 bra TFT_active_setpoint_diluent ; continue with showing diluent
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2050 TFT_active_setpoint_bail:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2051 WIN_SMALL dm_active_gas_column, dm_active_gas_row+.3 ; collides with diluent in FT_MEDIUM
0
heinrichsweikamp
parents:
diff changeset
2052 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2053 STRCPY_TEXT_PRINT tDiveBailout ; Bailout
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2054 TFT_active_setpoint_diluent:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2055 btfss better_gas_available ; check if a better gas is available and a gas change is advised in divemode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2056 bra TFT_active_setpoint_diluent_show ; NO - print in normal rendering
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2057 btg blinking_better_gas ; YES - toggle blink bit...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2058 btfss blinking_better_gas ; blink now?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2059 bra TFT_active_setpoint_diluent_show ; NO - print in normal rendering
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2060 movlw color_yellow ; YES - blink in yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2061 call TFT_set_color ; set text color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2062 bsf win_invert ; set invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2063 TFT_active_setpoint_diluent_show:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2064 WIN_SMALL dm_active_dil_column, dm_active_dil_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2065 movff char_I_O2_ratio,lo ; lo now stores O2 in %
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2066 movff char_I_He_ratio,hi ; hi now stores He in %
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2067 call customview_show_mix ; put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2
0
heinrichsweikamp
parents:
diff changeset
2068 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2069 bcf win_invert ; reset invert flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2070 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2071
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2072
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2073 global TFT_show_mode_divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2074 TFT_show_mode_divemode:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2075 WIN_TINY dm_active_dil_column+.45, dm_active_dil_row+.3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2076 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2077 return ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2078 btfsc FLAG_ccr_mode ; NO - in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2079 bra TFT_show_mode_divemode_ccr ; YES - write CCR label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2080 btfsc FLAG_pscr_mode ; NO - in pSCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2081 bra TFT_show_mode_divemode_pscr ; YES - write pSCR label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2082 return ; NO - done
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2083 TFT_show_mode_divemode_ccr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2084 call TFT_standard_color ; set standard color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2085 STRCPY_TEXT_PRINT tDvCCR ; print "CCR"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2086 return ; done
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2087 TFT_show_mode_divemode_pscr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2088 call TFT_standard_color ; set standard color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2089 STRCPY_TEXT_PRINT tDvPSCR ; print "PSCR"
0
heinrichsweikamp
parents:
diff changeset
2090 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2091
0
heinrichsweikamp
parents:
diff changeset
2092
heinrichsweikamp
parents:
diff changeset
2093 global TFT_display_decotype_surface
heinrichsweikamp
parents:
diff changeset
2094 TFT_display_decotype_surface:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2095 WIN_STD surf_decotype_column,surf_decotype_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2096 WIN_COLOR color_lightblue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2097 movff opt_dive_mode,lo ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2098 tstfsz lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2099 bra TFT_display_decotype_surface2
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2100 TFT_display_decotype_surface0:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2101 STRCAT_TEXT_PRINT tDvOC ; OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2102 bra TFT_display_decotype_exit
0
heinrichsweikamp
parents:
diff changeset
2103 TFT_display_decotype_surface2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2104 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2105 bra TFT_display_decotype_surface3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2106 STRCAT_TEXT_PRINT tDvCC ; CC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2107 call TFT_standard_color
113
heinrichsweikamp
parents: 106
diff changeset
2108 WIN_TINY surf_decotype_column+.18,surf_decotype_row+.12
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2109 TSTOSS opt_ccr_mode ; =0: Fixed SP, =1: Sensor, =2: Auto SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2110 bra TFT_display_decotype_cc_fixed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2111 ; Sensor mode or Auto
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2112 movff opt_ccr_mode,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2113 sublw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2114 bz TFT_display_decotype_cc_auto
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2115 STRCPY_TEXT tCCRModeSensor ; Sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2116 bra TFT_display_decotype_cc_common
337
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2117 TFT_display_decotype_cc_auto:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2118 STRCPY_TEXT tCCRModeAutoSP ; Auto SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2119 bra TFT_display_decotype_cc_common
113
heinrichsweikamp
parents: 106
diff changeset
2120 TFT_display_decotype_cc_fixed:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2121 STRCPY_TEXT tCCRModeFixedSP ; Fixed SP
113
heinrichsweikamp
parents: 106
diff changeset
2122 TFT_display_decotype_cc_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2123 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2124 movff WREG,buffer+.8 ; limit string length to 8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2125 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2126 bra TFT_display_decotype_exit
0
heinrichsweikamp
parents:
diff changeset
2127 TFT_display_decotype_surface3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2128 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2129 bra TFT_display_decotype_surface4
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2130 TFT_display_decotype_surface3_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2131 STRCAT_TEXT_PRINT tDvGauge ; Gauge
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2132 bra TFT_display_decotype_exit
0
heinrichsweikamp
parents:
diff changeset
2133 TFT_display_decotype_surface4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2134 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2135 bra TFT_display_decotype_surface5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2136 TFT_display_decotype_surface4_1:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2137 STRCAT_TEXT_PRINT tDvApnea ; Apnea
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2138 bra TFT_display_decotype_exit
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2139 TFT_display_decotype_surface5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2140 STRCAT_TEXT_PRINT tDvPSCR ; PSCR
0
heinrichsweikamp
parents:
diff changeset
2141 TFT_display_decotype_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2142 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2143
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2144
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2145 global TFT_display_decotype_surface1 ; Used from logbook!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2146 TFT_display_decotype_surface1: ; Used from logbook!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2147 tstfsz lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2148 bra TFT_display_decotype_surface1_2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2149 bra TFT_display_decotype_surface0 ;OC
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2150 TFT_display_decotype_surface1_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2151 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2152 bra TFT_display_decotype_surface1_3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2153 STRCAT_TEXT_PRINT tDvCC ; CC (w/o Sensor/Fixed Display)
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2154 TFT_display_decotype_surface1_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2155 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2156 bra TFT_display_decotype_surface1_4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2157 bra TFT_display_decotype_surface3_1 ; Gauge
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2158 TFT_display_decotype_surface1_4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2159 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2160 bra TFT_display_decotype_surface4_1 ; Apnea
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2161 bra TFT_display_decotype_surface5 ; PSCR
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2162
0
heinrichsweikamp
parents:
diff changeset
2163 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2164
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2165 global TFT_splist_surfmode ; Show Setpoint list
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2166 extern gaslist_strcat_setpoint
0
heinrichsweikamp
parents:
diff changeset
2167 TFT_splist_surfmode:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2168 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2169 ;SP 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2170 WIN_SMALL surf_gaslist_column,surf_gaslist_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2171 clrf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2172 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2173 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2174 ;SP 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2175 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2176 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2177 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2178 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2179 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2180 ;SP 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2181 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2182 movlw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2183 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2184 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2185 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2186 ;SP 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2187 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2188 movlw .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2189 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2190 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2191 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2192 ;SP 5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2193 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2194 movlw .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2195 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2196 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2197 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2198 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2199 return
0
heinrichsweikamp
parents:
diff changeset
2200
heinrichsweikamp
parents:
diff changeset
2201 global TFT_gaslist_surfmode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2202 TFT_gaslist_surfmode: ; Displays Gas List
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2203 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2204 extern gaslist_strcat_gas_mod
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2205 ;Gas 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2206 WIN_SMALL surf_gaslist_column,surf_gaslist_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2207 clrf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2208 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2209 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2210 ;Gas 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2211 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2212 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2213 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2214 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2215 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2216 ;Gas 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2217 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2218 movlw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2219 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2220 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2221 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2222 ;Gas 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2223 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2224 movlw .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2225 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2226 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2227 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2228 ;Gas 5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2229 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2230 movlw .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2231 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2232 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2233 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2234 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2235 return
0
heinrichsweikamp
parents:
diff changeset
2236
heinrichsweikamp
parents:
diff changeset
2237 global TFT_dillist_surfmode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2238 TFT_dillist_surfmode: ; Displays Diluent List
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2239 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2240 bsf ccr_diluent_setup ; Use CCR Diluents...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2241 rcall TFT_gaslist_surfmode ; Use OC/BAIL routine
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2242 bcf ccr_diluent_setup ; Clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2243 return
0
heinrichsweikamp
parents:
diff changeset
2244
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2245 ;==================================================================
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2246
0
heinrichsweikamp
parents:
diff changeset
2247 global TFT_depth
heinrichsweikamp
parents:
diff changeset
2248 TFT_depth:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2249 bcf FLAG_TFT_depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2250 SAFE_2BYTE_COPY rel_pressure, lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2251 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2252 call TFT_color_code_depth ; Color-code the output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2253 rcall TFT_depth_blink
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2254 WIN_LARGE dm_depth_column, dm_depth_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2255
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2256 TSTOSS opt_units ; 0=m, 1=ft
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2257 bra TFT_depth_metric
0
heinrichsweikamp
parents:
diff changeset
2258 ;TFT_depth_imperial
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2259 clrf sub_a+1 ; Display 0ft if lower then 30cm
0
heinrichsweikamp
parents:
diff changeset
2260 movlw d'30'
heinrichsweikamp
parents:
diff changeset
2261 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2262 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2263 movff lo,sub_b+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2264 call subU16 ; sub_c = sub_a - sub_b
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2265 btfss neg_flag ; Depth lower then 0.4m?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2266 bra depth_less_0.3mtr_feet ; Yes, Show 0ft manually
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2267
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2268 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
0
heinrichsweikamp
parents:
diff changeset
2269 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2270 output_16 ; feet in Big font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2271 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2272 movlw .3 ; limit to three chars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2273 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2274 STRCAT_PRINT "" ; Display feet
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2275 bcf win_invert ; Reset invert flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2276 return
126
9e856337b225 fix depth<0m display, ceiling
heinrichsweikamp
parents: 124
diff changeset
2277
0
heinrichsweikamp
parents:
diff changeset
2278 depth_less_0.3mtr_feet:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2279 STRCAT_PRINT "0 " ; manual zero
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2280 bcf win_invert ; Reset invert flag
0
heinrichsweikamp
parents:
diff changeset
2281 return
heinrichsweikamp
parents:
diff changeset
2282
heinrichsweikamp
parents:
diff changeset
2283 TFT_depth_metric:
heinrichsweikamp
parents:
diff changeset
2284 movlw .039
heinrichsweikamp
parents:
diff changeset
2285 cpfslt hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2286 bra depth_greater_99_84mtr
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2287
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2288 btfsc depth_greater_100m ; Was depth>100m during last call
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2289 rcall TFT_clear_depth ; Yes, clear depth area
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2290 bcf depth_greater_100m ; Do this once only...
0
heinrichsweikamp
parents:
diff changeset
2291
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2292 movlw .039
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2293 cpfslt hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2294 bra depth_greater_99_84mtr
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2295
0
heinrichsweikamp
parents:
diff changeset
2296 movlw HIGH d'1000'
heinrichsweikamp
parents:
diff changeset
2297 movwf sub_a+1
heinrichsweikamp
parents:
diff changeset
2298 movlw LOW d'1000'
heinrichsweikamp
parents:
diff changeset
2299 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2300 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2301 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2302 incf sub_b+0,F
heinrichsweikamp
parents:
diff changeset
2303 movlw d'0'
heinrichsweikamp
parents:
diff changeset
2304 addwfc sub_b+1,F ; Add 1mbar offset
heinrichsweikamp
parents:
diff changeset
2305 call sub16 ; sub_c = sub_a - sub_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2306 movlw ' '
0
heinrichsweikamp
parents:
diff changeset
2307 btfss neg_flag ; Depth lower then 10m?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2308 movwf POSTINC2 ; Yes, add extra space
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2309
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2310 clrf sub_a+1
0
heinrichsweikamp
parents:
diff changeset
2311 movlw d'99'
heinrichsweikamp
parents:
diff changeset
2312 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2313 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2314 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2315 call subU16 ; sub_c = sub_a - sub_b
heinrichsweikamp
parents:
diff changeset
2316 btfss neg_flag ; Depth lower then 1m?
heinrichsweikamp
parents:
diff changeset
2317 bra tft_depth2 ; Yes, display manual Zero
heinrichsweikamp
parents:
diff changeset
2318
heinrichsweikamp
parents:
diff changeset
2319 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2320 bsf ignore_digit4
heinrichsweikamp
parents:
diff changeset
2321 output_16 ; Full meters in Big font
heinrichsweikamp
parents:
diff changeset
2322 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2323 bra tft_depth3
heinrichsweikamp
parents:
diff changeset
2324
heinrichsweikamp
parents:
diff changeset
2325 tft_depth2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2326 STRCAT "0" ; manual zero
0
heinrichsweikamp
parents:
diff changeset
2327
heinrichsweikamp
parents:
diff changeset
2328 tft_depth3:
heinrichsweikamp
parents:
diff changeset
2329 STRCAT_PRINT "" ; Display full meters
heinrichsweikamp
parents:
diff changeset
2330
heinrichsweikamp
parents:
diff changeset
2331 ; .1m in MEDIUM font
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2332 WIN_MEDIUM dm_depth_dm_column, dm_depth_dm_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2333
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2334 ; TODO - check if needed, depth should still be in hi:lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2335 SAFE_2BYTE_COPY rel_pressure, lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2336 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2337 call TFT_color_code_depth ; Color-code the output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2338
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2339 PUTC "."
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2340 movlw HIGH d'30' ; Display 0.0m if lower then 30cm
0
heinrichsweikamp
parents:
diff changeset
2341 movwf sub_a+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2342 movlw LOW d'30'
0
heinrichsweikamp
parents:
diff changeset
2343 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2344 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2345 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2346 call subU16 ; sub_c = sub_a - sub_b
heinrichsweikamp
parents:
diff changeset
2347 btfss neg_flag ; Depth lower then 0.3m?
heinrichsweikamp
parents:
diff changeset
2348 bra depth_less_0.3mtr ; Yes, Show ".0" manually
heinrichsweikamp
parents:
diff changeset
2349
heinrichsweikamp
parents:
diff changeset
2350 movlw d'4'
heinrichsweikamp
parents:
diff changeset
2351 movwf ignore_digits
heinrichsweikamp
parents:
diff changeset
2352 bsf ignore_digit5
heinrichsweikamp
parents:
diff changeset
2353 output_16dp d'0'
heinrichsweikamp
parents:
diff changeset
2354 STRCAT_PRINT "" ; Display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2355 bcf win_invert ; Reset invert flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2356 WIN_FONT FT_SMALL
0
heinrichsweikamp
parents:
diff changeset
2357 return
heinrichsweikamp
parents:
diff changeset
2358
heinrichsweikamp
parents:
diff changeset
2359 depth_less_0.3mtr:
heinrichsweikamp
parents:
diff changeset
2360 STRCAT_PRINT "0" ; Display 0.0m manually
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2361 bcf win_invert ; Reset invert flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2362 WIN_FONT FT_SMALL
0
heinrichsweikamp
parents:
diff changeset
2363 return
heinrichsweikamp
parents:
diff changeset
2364
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2365 depth_greater_99_84mtr: ; Display only in full meters
0
heinrichsweikamp
parents:
diff changeset
2366 btfss depth_greater_100m ; Is depth>100m already?
heinrichsweikamp
parents:
diff changeset
2367 rcall TFT_clear_depth ; No, clear depth area and set flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2368 call TFT_color_code_depth
0
heinrichsweikamp
parents:
diff changeset
2369 ; Depth is already in hi:lo
heinrichsweikamp
parents:
diff changeset
2370 ; Show depth in Full meters
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2371 ; That means ignore digit 4 and 5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2372 lfsr FSR2,buffer
0
heinrichsweikamp
parents:
diff changeset
2373 bsf ignore_digit4
heinrichsweikamp
parents:
diff changeset
2374 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2375 output_16
heinrichsweikamp
parents:
diff changeset
2376 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2377 STRCAT_PRINT "" ; Display full meters only
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2378 bcf win_invert ; Reset invert flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2379 WIN_FONT FT_SMALL
0
heinrichsweikamp
parents:
diff changeset
2380 return
heinrichsweikamp
parents:
diff changeset
2381
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2382 TFT_clear_depth: ; No, clear depth area and set flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2383 WIN_BOX_BLACK dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2384 bsf depth_greater_100m ; Set Flag
0
heinrichsweikamp
parents:
diff changeset
2385 return
heinrichsweikamp
parents:
diff changeset
2386
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2387 TFT_depth_blink:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2388 TSTOSS opt_modwarning ; 0=standard, 1=blink
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2389 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2390
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2391 ; check if previous cycle had the blinking warning or not
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2392 btfsc blinking_depth_prev ; did we have warning prev?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2393 bra TFT_depth_blink_prevwarn; Yes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2394
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2395 ; No; check if it's set now
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2396 btfsc blinking_depth_warning ; do we have warning set now?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2397 bra TFT_depth_blink_warn ; Yes - so we have warning now but not prev
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2398
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2399 ; no warning in previous cycle, no warning now, reset all flags
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2400 bcf blinking_depth_prev ; reset prev flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2401 bcf blinking_depth_toggle ; reset toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2402 bcf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2403 ; all done
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2404 return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2405
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2406 TFT_depth_blink_prevwarn:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2407 ; ...we had warning in previous cycle, check if we still have the warning set
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2408 btfss blinking_depth_warning ; do we still have the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2409 bra TFT_depth_blink_prevwarn_nowarn ; No, clear the depth area
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2410
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2411 ; we still have the warning, set previous flag for next cycle...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2412 bsf blinking_depth_prev ; set prev flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2413 ; and set toggle and invert if required
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2414 btfss blinking_depth_toggle ; do we have the toggle set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2415 bra TFT_depth_blink_set ; No: set inverse, do color_box, set flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2416 bra TFT_depth_blink_reset ; Yes: clear inverse, do black box, reset flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2417
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2418 TFT_depth_blink_prevwarn_nowarn:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2419 ; we had warning, but not now... (e.g. ascended or switched to better gas)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2420 ; reset the previous cycle flag for the next cycle...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2421 bcf blinking_depth_prev ; reset prev flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2422 ; clear it - just in case if we had a blinked before
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2423 bra TFT_depth_blink_reset ; Yes: clear inverse, do black box, reset flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2424
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2425 TFT_depth_blink_warn:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2426 ; new blinking warning activated (had no warning in previous cycle)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2427 bsf blinking_depth_prev ; set prev flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2428 ; set toggle and invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2429 bra TFT_depth_blink_set
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2430
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2431 TFT_depth_blink_set:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2432 ; clear the area with color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2433 movlw color_red ; that should not be hardcoded...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2434 WIN_BOX_COLOR dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2435 ;set the invert color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2436 bsf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2437 ; set the toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2438 bsf blinking_depth_toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2439 ; all done
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2440 return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2441
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2442 TFT_depth_blink_reset:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2443 ; clear the area with black
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2444 WIN_BOX_BLACK dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2445 ;reset the invert color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2446 bcf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2447 ; reset the toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2448 bcf blinking_depth_toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2449 ; if it's still warning...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2450 btfsc blinking_depth_warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2451 call TFT_warnings_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2452 ; all done
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2453 return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2454
0
heinrichsweikamp
parents:
diff changeset
2455 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2456
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2457 global TFT_custom_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2458 TFT_custom_text: ; Show the custom text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2459 lfsr FSR0, opt_name ; Source
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2460 WIN_SMALL surf_customtext_column,surf_customtext_row1 ; First row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2461 rcall TFT_custom_text_2 ; Show up to 12 chars and print
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2462 incfsz lo,F ; Was lo=255?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2463 return ; No, all done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2464 lfsr FSR0, opt_name+.12 ; Source
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2465 WIN_SMALL surf_customtext_column,surf_customtext_row2 ; Second row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2466 rcall TFT_custom_text_2 ; Show up to 12 chars and print
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2467 incfsz lo,F ; Was lo=255?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2468 return ; No, all done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2469 lfsr FSR0, opt_name+.24 ; Source
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2470 WIN_SMALL surf_customtext_column,surf_customtext_row3 ; Third row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2471 rcall TFT_custom_text_2 ; Show up to 12 chars and print
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2472 incfsz lo,F ; Was lo=255?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2473 return ; No, all done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2474 lfsr FSR0, opt_name+.36 ; Source
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2475 WIN_SMALL surf_customtext_column,surf_customtext_row4 ; Forth row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2476 rcall TFT_custom_text_2 ; Show up to 12 chars and print
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2477 incfsz lo,F ; Was lo=255?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2478 return ; No, all done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2479 lfsr FSR0, opt_name+.48 ; Source
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2480 WIN_SMALL surf_customtext_column,surf_customtext_row5 ; Fifth row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2481 bra TFT_custom_text_2 ; Show up to 12 chars and print ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2482
0
heinrichsweikamp
parents:
diff changeset
2483
heinrichsweikamp
parents:
diff changeset
2484 TFT_custom_text_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2485 lfsr FSR2, buffer ; destination
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2486 movlw .12
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2487 movwf lo ; length/line
0
heinrichsweikamp
parents:
diff changeset
2488 TFT_custom_text_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2489 movf POSTINC0,W ; Get byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2490 bz TFT_custom_text_4 ; End if NULL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2491 movwf POSTINC2 ; NO: copy
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2492 decfsz lo,F ; Max length reached ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2493 bra TFT_custom_text_3 ; NO: loop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2494 setf lo ; lo=255 -> more to come
0
heinrichsweikamp
parents:
diff changeset
2495 TFT_custom_text_4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2496 clrf POSTINC2 ; Mark end of string
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2497 goto aa_wordprocessor ; print and return
0
heinrichsweikamp
parents:
diff changeset
2498
heinrichsweikamp
parents:
diff changeset
2499
heinrichsweikamp
parents:
diff changeset
2500 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2501
0
heinrichsweikamp
parents:
diff changeset
2502 global TFT_update_surf_press
heinrichsweikamp
parents:
diff changeset
2503 TFT_update_surf_press:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2504 WIN_SMALL surf_press_column,surf_press_row
0
heinrichsweikamp
parents:
diff changeset
2505 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2506 SAFE_2BYTE_COPY amb_pressure, lo
0
heinrichsweikamp
parents:
diff changeset
2507 movff lo,sub_a+0
heinrichsweikamp
parents:
diff changeset
2508 movff hi,sub_a+1
heinrichsweikamp
parents:
diff changeset
2509 movff last_surfpressure_30min+0,sub_b+0
heinrichsweikamp
parents:
diff changeset
2510 movff last_surfpressure_30min+1,sub_b+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2511 call subU16 ; sub_c = sub_a - sub_b
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2512 btfsc neg_flag ; Pressure lower?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2513 rcall update_surf_press2 ; Yes, test threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2514 tstfsz sub_c+1 ; >255mbar difference?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2515 bra update_surf_press_common ; Yes, display!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2516 movlw d'11' ; 10mbar noise suppression
0
heinrichsweikamp
parents:
diff changeset
2517 subwf sub_c+0,W
heinrichsweikamp
parents:
diff changeset
2518 btfsc STATUS,C
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2519 bra update_surf_press_common ; Yes, display!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2520 SAFE_2BYTE_COPY last_surfpressure_30min, lo ; Overwrite with stable value...
0
heinrichsweikamp
parents:
diff changeset
2521 update_surf_press_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2522 movff lo,int_I_pres_surface+0 ; copy displayed value to C code to have pressure displayed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2523 movff hi,int_I_pres_surface+1 ; and pressure used for desaturation & no-fly time in sync
0
heinrichsweikamp
parents:
diff changeset
2524 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2525 ; Show only 4 digits
0
heinrichsweikamp
parents:
diff changeset
2526 movff buffer+1,buffer+0
heinrichsweikamp
parents:
diff changeset
2527 movff buffer+2,buffer+1
heinrichsweikamp
parents:
diff changeset
2528 movff buffer+3,buffer+2
heinrichsweikamp
parents:
diff changeset
2529 movff buffer+4,buffer+3
heinrichsweikamp
parents:
diff changeset
2530 movlw 0x00
heinrichsweikamp
parents:
diff changeset
2531 movff WREG,buffer+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2532 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2533 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2534 WIN_SMALL surf_press_column+4*8,surf_press_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2535 STRCPY_TEXT_PRINT tMBAR ; mbar
0
heinrichsweikamp
parents:
diff changeset
2536 return
heinrichsweikamp
parents:
diff changeset
2537
heinrichsweikamp
parents:
diff changeset
2538 update_surf_press2:
heinrichsweikamp
parents:
diff changeset
2539 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2540 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2541 movff last_surfpressure_30min+0,sub_a+0
heinrichsweikamp
parents:
diff changeset
2542 movff last_surfpressure_30min+1,sub_a+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2543 goto subU16 ; sub_c = sub_a - sub_b ; and return...
0
heinrichsweikamp
parents:
diff changeset
2544
heinrichsweikamp
parents:
diff changeset
2545 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2546
heinrichsweikamp
parents:
diff changeset
2547 global TFT_update_batt_voltage
heinrichsweikamp
parents:
diff changeset
2548 TFT_update_batt_voltage:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2549 movff batt_percent,lo ; Get battery percent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2550 call TFT_color_code_battery ; Color-code battery percent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2551 ; Setup charge indicator
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2552 btfsc cc_active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2553 bsf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2554 btfsc cc_active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2555 movlw color_yellow
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2556 btfsc cv_active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2557 movlw color_green
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2558 btfsc cc_active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2559 call TFT_set_color
0
heinrichsweikamp
parents:
diff changeset
2560 WIN_TINY batt_percent_column,batt_percent_row
heinrichsweikamp
parents:
diff changeset
2561 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2562 output_8
heinrichsweikamp
parents:
diff changeset
2563 bcf leftbind
88
2a992aba61ef fix minor display bug (battery percent)
heinrichsweikamp
parents: 87
diff changeset
2564 STRCAT "% "
2a992aba61ef fix minor display bug (battery percent)
heinrichsweikamp
parents: 87
diff changeset
2565 movlw 0x00
2a992aba61ef fix minor display bug (battery percent)
heinrichsweikamp
parents: 87
diff changeset
2566 movff WREG,buffer+4 ; Only "xxx%"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2567 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2568 bcf win_invert
0
heinrichsweikamp
parents:
diff changeset
2569 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2570 WIN_TINY batt_voltage_column,batt_voltage_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2571 movff battery_type,lo ; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2572 PUTC "T"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2573 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2574 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2575 PUTC ":"
0
heinrichsweikamp
parents:
diff changeset
2576 movff batt_voltage+0,lo
heinrichsweikamp
parents:
diff changeset
2577 movff batt_voltage+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2578 output_16dp .2
0
heinrichsweikamp
parents:
diff changeset
2579 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2580 PUTC 'V'
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2581 movff buffer+8,buffer+6
0
heinrichsweikamp
parents:
diff changeset
2582 movlw 0x00
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2583 movff WREG,buffer+7 ; Only "x.yV"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2584 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
2585 return
heinrichsweikamp
parents:
diff changeset
2586
heinrichsweikamp
parents:
diff changeset
2587 ;update_battery_debug:
heinrichsweikamp
parents:
diff changeset
2588 ; call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2589 ; WIN_TINY .70,.0
heinrichsweikamp
parents:
diff changeset
2590 ; movff battery_gauge+5,xC+3
heinrichsweikamp
parents:
diff changeset
2591 ; movff battery_gauge+4,xC+2
heinrichsweikamp
parents:
diff changeset
2592 ; movff battery_gauge+3,xC+1
heinrichsweikamp
parents:
diff changeset
2593 ; movff battery_gauge+2,xC+0
heinrichsweikamp
parents:
diff changeset
2594 ; ; battery_gauge:6 is nAs
heinrichsweikamp
parents:
diff changeset
2595 ; ; devide through 65536
heinrichsweikamp
parents:
diff changeset
2596 ; ; devide through 152
heinrichsweikamp
parents:
diff changeset
2597 ; ; Result is 0.01Ah in xC+1:xC+0
heinrichsweikamp
parents:
diff changeset
2598 ; movlw LOW .152
heinrichsweikamp
parents:
diff changeset
2599 ; movwf xB+0
heinrichsweikamp
parents:
diff changeset
2600 ; movlw HIGH .152
heinrichsweikamp
parents:
diff changeset
2601 ; movwf xB+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2602 ; call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
0
heinrichsweikamp
parents:
diff changeset
2603 ; bsf leftbind
heinrichsweikamp
parents:
diff changeset
2604 ; movff xC+0,lo
heinrichsweikamp
parents:
diff changeset
2605 ; movff xC+1,hi
heinrichsweikamp
parents:
diff changeset
2606 ; output_16
heinrichsweikamp
parents:
diff changeset
2607 ; STRCAT_PRINT "x.01Ah"
heinrichsweikamp
parents:
diff changeset
2608 ; WIN_FONT FT_SMALL
heinrichsweikamp
parents:
diff changeset
2609 ; bcf leftbind
heinrichsweikamp
parents:
diff changeset
2610 ; return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2611
0
heinrichsweikamp
parents:
diff changeset
2612 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2613
heinrichsweikamp
parents:
diff changeset
2614 global TFT_convert_signed_16bit
heinrichsweikamp
parents:
diff changeset
2615 TFT_convert_signed_16bit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2616 bcf neg_flag ; Positive temperature
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2617 btfss hi,7 ; Negative temperature ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2618 return ; No, return
0
heinrichsweikamp
parents:
diff changeset
2619 ; Yes, negative temperature!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2620 bsf neg_flag ; Negative temperature
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2621 PUTC '-' ; Display "-"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2622 comf hi ; Then, 16bit sign changes.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2623 negf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2624 btfsc STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2625 incf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2626 return ; and return
0
heinrichsweikamp
parents:
diff changeset
2627
heinrichsweikamp
parents:
diff changeset
2628 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2629
heinrichsweikamp
parents:
diff changeset
2630 global TFT_convert_date
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2631 TFT_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2632 movff opt_dateformat,WREG ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2633 movwf EEDATA ; used as temp here
0
heinrichsweikamp
parents:
diff changeset
2634 tstfsz EEDATA
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2635 bra TFT_convert_date_1 ; opt_dateformat is 1 or 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2636 ; opt_dateformat is 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2637 ; use MMDDYY
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2638 movff lo,lo_temp ; incoming: lo = day, hi = month
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2639 movff hi,lo ; swap
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2640 movff lo_temp,hi ; now: lo = month, hi = day
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2641 bra TFT_convert_date_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2642
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2643 TFT_convert_date_1:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2644 decfsz EEDATA,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2645 bra TFT_convert_date_2 ; opt_dateformat is 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2646 ; opt_dateformat is 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2647 ; use DDMMYY
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2648 TFT_convert_date_common:
0
heinrichsweikamp
parents:
diff changeset
2649 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2650 output_99x ; with lo = month or day or year
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2651 PUTC '.'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2652 movff hi,lo ; now lo = day or month or month
0
heinrichsweikamp
parents:
diff changeset
2653 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2654 PUTC '.'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2655 movff up,lo ; now lo = year or year or day
0
heinrichsweikamp
parents:
diff changeset
2656 output_99x
heinrichsweikamp
parents:
diff changeset
2657 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2658 return
heinrichsweikamp
parents:
diff changeset
2659
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2660 TFT_convert_date_2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2661 ; opt_dateformat is 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2662 ; use YYMMDD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2663 movff lo,lo_temp ; incoming: lo = day, up = year
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2664 movff up,lo ; swap
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2665 movff lo_temp,up ; now : lo = year, up = day
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2666 bra TFT_convert_date_common
0
heinrichsweikamp
parents:
diff changeset
2667
heinrichsweikamp
parents:
diff changeset
2668 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2669
heinrichsweikamp
parents:
diff changeset
2670 global TFT_convert_date_short
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2671 TFT_convert_date_short: ; converts into "DD/MM" or "MM/DD" or "MM/DD" in postinc2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2672 movff opt_dateformat,WREG ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2673 movwf EEDATA ; used as temp here
0
heinrichsweikamp
parents:
diff changeset
2674 tstfsz EEDATA
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2675 bra TFT_convert_date_short_1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2676 ; opt_dateformat is 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2677 ; Use MMDD(YY)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2678 TFT_convert_date_short_0:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2679 movff lo,lo_temp ; incoming: lo = day, hi = month
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2680 movff hi,lo ; swap
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2681 movff lo_temp,hi ; now: lo = month, hi = day
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2682 bra TFT_convert_date_short_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2683
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2684 TFT_convert_date_short_1:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2685 decfsz EEDATA,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2686 bra TFT_convert_date_short_0 ; opt_dateformat is 2 -> use (YY)MMDD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2687 ; opt_dateformat is 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2688 ; use DDMM(YY)
0
heinrichsweikamp
parents:
diff changeset
2689 TFT_convert_date_short_common:
heinrichsweikamp
parents:
diff changeset
2690 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2691 output_99x ; with lo = month or day
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2692 PUTC '.'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2693 movff hi,lo ; now lo = day or month
0
heinrichsweikamp
parents:
diff changeset
2694 output_99x
heinrichsweikamp
parents:
diff changeset
2695 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2696 return
heinrichsweikamp
parents:
diff changeset
2697
heinrichsweikamp
parents:
diff changeset
2698 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2699
heinrichsweikamp
parents:
diff changeset
2700 global TFT_date
heinrichsweikamp
parents:
diff changeset
2701 TFT_date:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2702 WIN_SMALL surf_date_column,surf_date_row ; Init new Wordprocessor
0
heinrichsweikamp
parents:
diff changeset
2703 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2704 movff day,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2705 movff month,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2706 movff year,up
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2707 call TFT_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
0
heinrichsweikamp
parents:
diff changeset
2708 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2709 return
heinrichsweikamp
parents:
diff changeset
2710
heinrichsweikamp
parents:
diff changeset
2711 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2712
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2713 global TFT_max_depth_alternative
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2714 TFT_max_depth_alternative:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2715 bcf FLAG_TFT_max_depth_alt
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2716 ; The "mask"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2717 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2718 WIN_TINY dm_mask_depth_column, dm_max_alt_row-.14
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2719 STRCPY_TEXT_PRINT tMaxDepth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2720
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2721 ; The max. depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2722 SAFE_2BYTE_COPY max_pressure, lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2723 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2724 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2725 TSTOSS opt_units ; 0=m, 1=ft
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2726 bra TFT_max_depth_alt_metric
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2727 ;TFT_max_depth_alt_imperial:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2728 TFT_max_depth_alt_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2729 WIN_LARGE dm_max_alt_column,dm_max_alt_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2730 bsf ignore_digit4 ; no 0.1m
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2731 output_16
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2732 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2733
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2734 WIN_MEDIUM dm_max_dm_alt_column,dm_max_alt_row+.25
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2735 SAFE_2BYTE_COPY max_pressure, lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2736 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2737 PUTC "."
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2738 movlw d'4'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2739 movwf ignore_digits
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2740 bsf ignore_digit5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2741 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2742 output_16dp d'0'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2743 STRCAT_PRINT "" ; Display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2744 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2745 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2746
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2747
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2748 global TFT_max_depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2749 TFT_max_depth:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2750 bcf FLAG_TFT_max_depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2751 btfsc FLAG_apnoe_mode ; different display in apnoe mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2752 bra TFT_max_depth_apnoe
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2753 TFT_max_depth2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2754 SAFE_2BYTE_COPY max_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2755 TFT_max_depth3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2756 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2757 TSTOSS opt_units ; 0=m, 1=ft
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2758 bra TFT_max_depth2_metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2759 ;TFT_max_depth2_imperial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2760 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2761 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2762 TSTOSS opt_vsigraph ; 0=skip, 1=draw
332
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2763 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
0
heinrichsweikamp
parents:
diff changeset
2764 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2765 output_16_3
heinrichsweikamp
parents:
diff changeset
2766 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2767 return
heinrichsweikamp
parents:
diff changeset
2768
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2769 TFT_max_depth2_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2770 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2771 TSTOSS opt_vsigraph ; 0=skip, 1=draw
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2772 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2773 call TFT_standard_color
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2774
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2775 movlw .039
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2776 cpfslt hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2777 bra max_depth_greater_99_84mtr
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2778
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2779 btfsc max_depth_greater_100m ; Was depth>100m during last call
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2780 rcall TFT_clear_max_depth ; Yes, clear depth area
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2781 bcf max_depth_greater_100m ; Do this once only...
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2782
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2783 movlw .039
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2784 cpfslt hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2785 bra max_depth_greater_99_84mtr
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2786
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2787 movlw HIGH d'1000'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2788 movwf sub_a+1
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2789 movlw LOW d'1000'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2790 movwf sub_a+0
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2791 movff hi,sub_b+1
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2792 movff lo,sub_b+0
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2793 incf sub_b+0,F
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2794 movlw d'0'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2795 addwfc sub_b+1,F ; Add 1mbar offset
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2796 call sub16 ; sub_c = sub_a - sub_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2797 movlw ' '
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2798 btfss neg_flag ; Depth lower then 10m?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2799 movwf POSTINC2 ; Yes, add extra space
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2800
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2801 clrf sub_a+1
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2802 movlw d'99'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2803 movwf sub_a+0
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2804 movff hi,sub_b+1
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2805 movff lo,sub_b+0
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2806 call subU16 ; sub_c = sub_a - sub_b
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2807 btfss neg_flag ; Depth lower then 1m?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2808 bra tft_max_depth2 ; Yes, display manual Zero
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2809
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2810 bsf ignore_digit4 ; no 0.1m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2811 bsf leftbind
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2812 output_16
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2813 bra tft_max_depth3
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2814
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2815 tft_max_depth2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2816 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2817 TSTOSS opt_vsigraph ; 0=skip, 1=draw
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2818 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2819 STRCAT "0"
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2820
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2821 tft_max_depth3:
0
heinrichsweikamp
parents:
diff changeset
2822 call TFT_standard_color
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2823 STRCAT_PRINT "" ; Display full meters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2824 bcf leftbind
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2825
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2826 ; .1m in SMALL font
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2827 WIN_SMALL dm_max_depth_dm_column, dm_max_depth_dm_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2828 TSTOSS opt_vsigraph ; 0=skip, 1=draw
332
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2829 WIN_SMALL dm_max_depth_dm_column_nvsi, dm_max_depth_dm_row
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2830
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2831 SAFE_2BYTE_COPY max_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2832 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2833
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2834 PUTC "."
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2835
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2836 movlw d'4'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2837 movwf ignore_digits
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2838 bsf ignore_digit5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2839 bsf leftbind
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2840 output_16dp d'0'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2841 STRCAT_PRINT "" ; Display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2842 bcf leftbind
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2843 return
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2844
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2845 max_depth_greater_99_84mtr: ; Display only in full meters
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2846 btfss max_depth_greater_100m ; Is max depth>100m already?
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2847 rcall TFT_clear_max_depth ; No, clear max depth area and set flag
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2848 ; Max. Depth is already in hi:lo
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2849 ; Show max. depth in Full meters
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2850 ; That means ignore figure 4 and 5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2851 lfsr FSR2,buffer
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2852 bsf ignore_digit4
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2853 bsf leftbind
0
heinrichsweikamp
parents:
diff changeset
2854 output_16
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2855 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2856 STRCAT_PRINT "" ; Display full meters only
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2857 WIN_FONT FT_SMALL
0
heinrichsweikamp
parents:
diff changeset
2858 return
heinrichsweikamp
parents:
diff changeset
2859
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2860 TFT_clear_max_depth: ; No, clear max. depth area and set flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2861 WIN_BOX_BLACK dm_max_depth_row, dm_max_depth_bot, dm_max_depth_column, dm_max_depth_rgt ;top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2862 bsf max_depth_greater_100m ; Set Flag
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2863 return
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2864
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2865
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2866 TFT_max_depth_apnoe:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2867 btfss FLAG_active_descent ; Are we descending?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2868 bra TFT_max_depth2 ; Yes, show normal max.
0
heinrichsweikamp
parents:
diff changeset
2869 SAFE_2BYTE_COPY apnoe_max_pressure, lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2870 bra TFT_max_depth3 ; Show apnoe_max_pressure as max. depth
0
heinrichsweikamp
parents:
diff changeset
2871
heinrichsweikamp
parents:
diff changeset
2872 global TFT_display_apnoe_last_max
heinrichsweikamp
parents:
diff changeset
2873 TFT_display_apnoe_last_max:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2874 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2875 WIN_TINY dm_apnoe_last_max_depth_text_col, dm_apnoe_last_max_depth_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2876 STRCPY_TEXT_PRINT tApnoeMax
0
heinrichsweikamp
parents:
diff changeset
2877
heinrichsweikamp
parents:
diff changeset
2878 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2879 SAFE_2BYTE_COPY max_pressure, lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2880 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2881 TSTOSS opt_units ; 0=m, 1=ft
0
heinrichsweikamp
parents:
diff changeset
2882 bra TFT_display_apnoe_last_m_metric
heinrichsweikamp
parents:
diff changeset
2883 ;TFT_display_apnoe_last_max_imperial
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2884 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2885 WIN_MEDIUM dm_apnoe_last_max_depth_column, dm_apnoe_last_max_depth_row
0
heinrichsweikamp
parents:
diff changeset
2886 output_16
heinrichsweikamp
parents:
diff changeset
2887 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2888 return
heinrichsweikamp
parents:
diff changeset
2889
heinrichsweikamp
parents:
diff changeset
2890 TFT_display_apnoe_last_m_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2891 WIN_MEDIUM dm_apnoe_last_max_depth_column, dm_apnoe_last_max_depth_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2892 bsf ignore_digit5 ; do not display 1cm depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2893 output_16dp d'3'
0
heinrichsweikamp
parents:
diff changeset
2894 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2895 return
heinrichsweikamp
parents:
diff changeset
2896
heinrichsweikamp
parents:
diff changeset
2897 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2898
0
heinrichsweikamp
parents:
diff changeset
2899 global TFT_divemins
heinrichsweikamp
parents:
diff changeset
2900 TFT_divemins:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2901 bcf FLAG_TFT_divemins ; Clear flag
0
heinrichsweikamp
parents:
diff changeset
2902 movff divemins+0,lo
heinrichsweikamp
parents:
diff changeset
2903 movff divemins+1,hi
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2904
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2905 ; Already showing divemins > 99min
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2906 btfsc no_more_divesecs ; Ignore seconds?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2907 bra TFT_divemins2 ; Show minutes only
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2908
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2909 tstfsz hi ; hi = 0?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2910 bra TFT_divemins_clr ; No, show mins only
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2911
0
heinrichsweikamp
parents:
diff changeset
2912 movlw .99
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2913 cpfsgt lo ; bigger than 99?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2914 bra TFT_divemins1 ; No show mins:secs
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2915
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2916 TFT_divemins_clr:
0
heinrichsweikamp
parents:
diff changeset
2917 ; Yes, remove second display for the rest of the dive and clear seconds
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2918 bsf no_more_divesecs ; Set flag
0
heinrichsweikamp
parents:
diff changeset
2919 ; Clear rest of seconds
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2920 WIN_BOX_BLACK dm_divetime_row, dm_divetime_bot, dm_divetime_column, dm_divetime_rgt ;top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2921 bra TFT_divemins2 ; Show minutes only
0
heinrichsweikamp
parents:
diff changeset
2922
heinrichsweikamp
parents:
diff changeset
2923 TFT_divemins1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2924 ; Print out the minutes, up to 99min, only 2chars !
0
heinrichsweikamp
parents:
diff changeset
2925 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2926 WIN_MEDIUM dm_divetime_column, dm_divetime_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2927 output_99 ; displays only last two figures from a 8Bit value (0-99)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2928 STRCAT_PRINT "" ; Show minutes in large font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2929
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2930 ; Print out the seconds
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2931 WIN_SMALL dm_divetime_secs_column, dm_divetime_secs_row ; left position for two sec figures
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2932 PUTC ':'
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2933 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2934 movff divesecs,lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2935 output_99x ; displays only last two figures from a 8Bit value with leading zero (00-99)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2936 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2937 STRCAT_PRINT "" ; Show seconds in small font
0
heinrichsweikamp
parents:
diff changeset
2938 return
heinrichsweikamp
parents:
diff changeset
2939
heinrichsweikamp
parents:
diff changeset
2940 TFT_divemins2:
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2941 ; Full minutes only
0
heinrichsweikamp
parents:
diff changeset
2942 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2943 WIN_MEDIUM dm_divetime_minsonly_column, dm_divetime_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2944 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2945 output_16_4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2946 STRCAT_PRINT "" ; Show minutes in large font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2947 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2948
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2949 global TFT_divemins_alternative
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2950 TFT_divemins_alternative:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2951 bcf FLAG_TFT_divemins ; Clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2952 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2953 ; Print out the minutes (0-999) in large
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2954 WIN_LARGE dm_divetime_alt_column, dm_divetime_alt_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2955 movff divemins+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2956 movff divemins+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2957 output_16_3 ; limit to 999 and display only (0-999)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2958 STRCAT_PRINT "" ; Show minutes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2959 ; Print out the seconds in medium
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2960 WIN_MEDIUM dm_divetime_alt_column+.60, dm_divetime_alt_row+.25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2961 PUTC ":"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2962 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2963 movff divesecs,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2964 output_99x ; displays only last two figures from a 8Bit value with leading zero (00-99)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2965 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2966 STRCAT_PRINT "" ; Show seconds in small font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2967 return
0
heinrichsweikamp
parents:
diff changeset
2968
heinrichsweikamp
parents:
diff changeset
2969 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2970
0
heinrichsweikamp
parents:
diff changeset
2971 global TFT_display_apnoe_surface
heinrichsweikamp
parents:
diff changeset
2972 TFT_display_apnoe_surface:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2973 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2974 WIN_TINY dm_apnoe_surface_time_text_col, dm_apnoe_surface_time_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2975 STRCPY_TEXT_PRINT tApnoeSurface
0
heinrichsweikamp
parents:
diff changeset
2976
heinrichsweikamp
parents:
diff changeset
2977 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2978 WIN_MEDIUM dm_apnoe_surface_time_column, dm_apnoe_surface_time_row
0
heinrichsweikamp
parents:
diff changeset
2979 movff apnoe_surface_mins,lo
heinrichsweikamp
parents:
diff changeset
2980 output_8
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2981 PUTC ':'
0
heinrichsweikamp
parents:
diff changeset
2982 movff apnoe_surface_secs,lo
heinrichsweikamp
parents:
diff changeset
2983 output_99x
heinrichsweikamp
parents:
diff changeset
2984 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2985 return
heinrichsweikamp
parents:
diff changeset
2986
heinrichsweikamp
parents:
diff changeset
2987 global TFT_apnoe_clear_surface
heinrichsweikamp
parents:
diff changeset
2988 TFT_apnoe_clear_surface:
heinrichsweikamp
parents:
diff changeset
2989 ; Clear Surface timer....
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2990 WIN_BOX_BLACK dm_apnoe_surface_time_text_row, .239, dm_apnoe_surface_time_text_col, .159 ;top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
2991 return
heinrichsweikamp
parents:
diff changeset
2992
heinrichsweikamp
parents:
diff changeset
2993 global TFT_display_apnoe_descent
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2994 TFT_display_apnoe_descent: ; Descent divetime
0
heinrichsweikamp
parents:
diff changeset
2995 movff apnoe_mins,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2996 clrf hi
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2997 WIN_MEDIUM dm_divetime_apnoe_column, dm_divetime_apnoe_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2998 output_16_3 ; displays only last three figures from a 16Bit value (0-999)
0
heinrichsweikamp
parents:
diff changeset
2999 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3000 STRCAT_PRINT "" ; Show minutes in large font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3001 WIN_SMALL dm_divetime_apnoe_secs_column, dm_divetime_apnoe_secs_row ; left position for two sec figures
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3002 PUTC ':'
0
heinrichsweikamp
parents:
diff changeset
3003 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3004 movff apnoe_secs,lo
heinrichsweikamp
parents:
diff changeset
3005 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3006 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3007 STRCAT_PRINT "" ; Show seconds in small font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3008
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3009 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3010 WIN_TINY dm_total_apnoe_text_column,dm_total_apnoe_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3011 STRCPY_TEXT_PRINT tApnoeTotal
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3012 call TFT_standard_color
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3013 movff divemins,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3014 clrf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3015 WIN_MEDIUM dm_apnoe_total_divetime_column, dm_apnoe_total_divetime_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3016 output_16_3 ; displays only last three figures from a 16Bit value (0-999)
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3017 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3018 STRCAT_PRINT "" ; Show minutes in large font
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3019 WIN_SMALL dm_apnoe_total_divetime_secs_col, dm_apnoe_total_divetime_secs_row ; left position for two sec figures
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3020 PUTC ':'
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3021 bsf leftbind
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3022 movff divesecs,lo
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3023 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3024 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3025 STRCAT_PRINT "" ; Show seconds in small font
0
heinrichsweikamp
parents:
diff changeset
3026 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3027
0
heinrichsweikamp
parents:
diff changeset
3028 ;=============================================================================
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 262
diff changeset
3029 ; Writes ostc #Serial and Firmware version in splash screen
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3030
0
heinrichsweikamp
parents:
diff changeset
3031 global TFT_serial
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3032 TFT_serial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3033 WIN_TINY .5,.225
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3034 STRCPY "OSTC" ; Won't translate that...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3035
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3036 movlw 0x0A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3037 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3038 bra TFT_serial2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3039 STRCAT "3 #"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3040 bra TFT_serial_common
260
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3041 TFT_serial2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3042 movlw 0x05
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3043 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3044 bra TFT_serial3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3045 STRCAT " cR #"
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3046 bra TFT_serial_common
200
dcd513840c6c cleanup
heinrichsweikamp
parents: 192
diff changeset
3047 TFT_serial3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3048 movlw 0x11
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3049 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3050 bra TFT_serial4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3051 STRCAT "2 #"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3052 bra TFT_serial_common
260
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3053 TFT_serial4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3054 movlw 0x1A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3055 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3056 bra TFT_serial5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3057 STRCAT "3 #"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3058 ; bra TFT_serial_common
260
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3059 TFT_serial5:
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3060 TFT_serial_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3061 rcall TFT_cat_serial
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3062 STRCAT " v"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3063 WIN_COLOR color_greenish
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3064 rcall TFT_cat_firmware
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3065
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3066 ifdef __DEBUG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3067 movlw color_grey ; Write header in blue when
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3068 call TFT_set_color ; compiled in DEBUG mode...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3069 STRCAT_PRINT "DEBUG"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3070 call TFT_standard_color
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3071 bcf win_invert
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3072 return
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3073 else
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3074 movlw softwareversion_beta ; =1: Beta, =0: Release, >= 2: Service Pack
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3075 tstfsz WREG ; release?
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3076 bra TFT_serial_6 ; NO
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3077 bra TFT_serial_8 ; YES
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3078 TFT_serial_6:
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3079 decfsz WREG,F ; Beta?
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3080 bra TFT_serial_7 ; NO
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3081 STRCAT_PRINT "" ; YES
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3082 call TFT_warnings_color ;
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3083 WIN_LEFT .160-4*9/2 ; Right pad
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3084 STRCPY_TEXT tBeta
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3085 bra TFT_serial_8
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3086 TFT_serial_7:
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3087 STRCAT " SP"
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3088 movlw softwareversion_beta ; STRCAT destroyed WREG
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3089 decf WREG,W
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3090 movwf lo
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3091 bsf leftbind
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3092 output_8
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3093 bcf leftbind
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3094 TFT_serial_8:
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3095 STRCAT_PRINT ""
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3096 call TFT_standard_color
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3097 bcf win_invert
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3098 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3099 endif
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3100
0
heinrichsweikamp
parents:
diff changeset
3101
heinrichsweikamp
parents:
diff changeset
3102 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
3103 ; For the Information menu: append firmware x.yy version.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3104
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3105 global info_menu_firmware
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3106 extern tFirmware
0
heinrichsweikamp
parents:
diff changeset
3107 info_menu_firmware:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3108 lfsr FSR1,tFirmware
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3109 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3110 rcall TFT_cat_firmware
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3111 ; Show language version
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3112 IFNDEF french_italian
458
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3113 STRCAT "_en+de"
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3114 ELSE
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3115 STRCAT "_fr+it"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3116 ENDIF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3117 bcf win_invert ; Reset invert flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3118 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3119
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3120 global TFT_cat_firmware
0
heinrichsweikamp
parents:
diff changeset
3121 TFT_cat_firmware:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3122 movlw softwareversion_x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3123 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3124 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3125 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3126 PUTC '.'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3127 movlw softwareversion_y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3128 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3129 output_99x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3130 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3131 ; Check firmware date
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3132 movlw firmware_expire_year-.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3133 cpfsgt year ; > threshold?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3134 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3135 movlw firmware_expire_month-.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3136 cpfsgt month ; > threshold?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3137 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3138 movlw firmware_expire_day-.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3139 cpfsgt day ; > threshold?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3140 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3141
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3142 ; Show in "change firmware" style
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3143 movlw color_yellow
587
e81cf407261a V2.97 SP1
heinrichsweikamp
parents: 583
diff changeset
3144 bcf win_invert
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3145 goto TFT_set_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
3146
heinrichsweikamp
parents:
diff changeset
3147 ;-----------------------------------------------------------------------------
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 262
diff changeset
3148 ; For the Information menu: append serial number
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3149
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3150 global info_menu_serial
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3151 extern tSerial
0
heinrichsweikamp
parents:
diff changeset
3152 info_menu_serial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3153 lfsr FSR1,tSerial
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3154 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3155 global TFT_cat_serial
0
heinrichsweikamp
parents:
diff changeset
3156 TFT_cat_serial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3157 clrf EEADRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3158 clrf EEADR ; Get Serial number LOW
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3159 call read_eeprom ; read byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3160 movff EEDATA,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3161 incf EEADR,F ; Get Serial number HIGH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3162 call read_eeprom ; read byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3163 movff EEDATA,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3164
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3165 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3166 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3167 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3168 return
0
heinrichsweikamp
parents:
diff changeset
3169
heinrichsweikamp
parents:
diff changeset
3170 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
3171 ; For the Information menu: Append total dives
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3172
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3173 global info_menu_total_dives
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3174 extern tTotalDives
0
heinrichsweikamp
parents:
diff changeset
3175 info_menu_total_dives:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3176 lfsr FSR1,tTotalDives
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3177 call strcat_text
0
heinrichsweikamp
parents:
diff changeset
3178 TFT_cat_total_dives:
heinrichsweikamp
parents:
diff changeset
3179 read_int_eeprom .2
heinrichsweikamp
parents:
diff changeset
3180 movff EEDATA,lo
heinrichsweikamp
parents:
diff changeset
3181 read_int_eeprom .3
heinrichsweikamp
parents:
diff changeset
3182 movff EEDATA,hi
heinrichsweikamp
parents:
diff changeset
3183 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3184 output_16
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3185 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3186 return
0
heinrichsweikamp
parents:
diff changeset
3187
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3188 ; For the Information menu: Append battery voltage
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3189 global info_menu_battery_volts
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3190 extern tBatteryV
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3191 info_menu_battery_volts:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3192 lfsr FSR1,tBatteryV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3193 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3194 movff batt_voltage+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3195 movff batt_voltage+0,lo
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3196 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3197 output_16dp .2 ; x.xxx
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3198 STRCAT "V(T"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3199 movff battery_type,lo ; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3200 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3201 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3202 PUTC ")"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3203 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3204
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3205 ; For the Information menu: Append Uptime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3206 global info_menu_uptime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3207 extern tUptime
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3208 info_menu_uptime:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3209 lfsr FSR1,tUptime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3210 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3211 movff uptime+0,xC+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3212 movff uptime+1,xC+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3213 movff uptime+2,xC+2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3214 movff uptime+3,xC+3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3215 movlw LOW .3600
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3216 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3217 movlw HIGH .3600
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3218 movwf xB+1 ; One day = 3600s
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3219 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3220 ;xC+0:xC+1 -> Full hours
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3221 movff xC+1,xA+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3222 movff xC+0,xA+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3223 clrf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3224 movlw .24
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3225 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3226 call div16x16 ; xA/xB=xC with xA+0 as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3227 movff xC+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3228 movff xC+1,hi ; Full days
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3229 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3230 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3231 PUTC "d"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3232 movff xA+0,lo ; Full hours
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3233 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3234 PUTC "h"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3235 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3236 return ; Done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3237
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3238 extern tCalX,tCalY,tCalZ
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3239 global menu_cal_x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3240 menu_cal_x:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3241 lfsr FSR1,tCalX
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3242 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3243 movff compass_CX_f+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3244 movff compass_CX_f+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3245 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3246 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3247 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3248 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3249 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3250
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3251 global menu_cal_y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3252 menu_cal_y:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3253 lfsr FSR1,tCalY
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3254 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3255 movff compass_CY_f+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3256 movff compass_CY_f+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3257 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3258 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3259 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3260 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3261 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3262
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3263 global menu_cal_z
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3264 menu_cal_z:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3265 lfsr FSR1,tCalZ
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3266 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3267 movff compass_CZ_f+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3268 movff compass_CZ_f+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3269 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3270 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3271 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3272 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3273 return
544
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3274
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3275
0
heinrichsweikamp
parents:
diff changeset
3276 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
3277 ; ppO2 menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3278
0
heinrichsweikamp
parents:
diff changeset
3279 global divesets_ppo2_min
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3280 extern tPPO2MIN
0
heinrichsweikamp
parents:
diff changeset
3281 divesets_ppo2_min:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3282 lfsr FSR1,tPPO2MIN
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3283 call strcat_text
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3284 movff char_I_ppO2_min,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3285 movlw ppo2_warning_low_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3286 bra divesets_ppo2_common
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3287
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3288 global divesets_ppo2_min_cc
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3289 extern tPPO2MINCC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3290 divesets_ppo2_min_cc:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3291 lfsr FSR1,tPPO2MINCC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3292 call strcat_text
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3293 movff char_I_ppO2_min_loop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3294 movlw ppo2_warning_loop_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3295 bra divesets_ppo2_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3296
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3297 global divesets_ppo2_max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3298 extern tPPO2Max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3299 extern tbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3300 divesets_ppo2_max:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3301 lfsr FSR1,tPPO2Max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3302 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3303 movff char_I_ppO2_max,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3304 movlw ppo2_warning_high_default
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3305 bra divesets_ppo2_common
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3306
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3307 global divesets_ppo2_max_deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3308 extern tPPO2DECO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3309 divesets_ppo2_max_deco:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3310 lfsr FSR1,tPPO2DECO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3311 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3312 movff char_I_ppO2_max_deco,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3313 movlw ppo2_warning_deco_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3314 ;bra divesets_ppo2_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3315
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3316 divesets_ppo2_common:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3317 movwf up ; Save default value
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3318 clrf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3319 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3320 output_16dp d'3'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3321 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3322 lfsr FSR1,tbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3323 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3324 movf up,W ; Default value
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3325 cpfseq lo ; Current value
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3326 bra divesets_ppo2_common2 ; Not default, add *
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3327 return ; Default, Done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3328 divesets_ppo2_common2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3329 PUTC "*"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3330 return ; Done.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3331
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3332 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3333
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3334 global TFT_clear_warning_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3335 TFT_clear_warning_text:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3336 btfss divemode ; in divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3337 bra TFT_clear_warning_text2 ; No, setup for surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3338 bcf FLAG_TFT_dive_warning_text_clear ; Clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3339 btfsc alternative_divelayout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3340 bra TFT_clear_warning_text_2nd_row ; In Alt mode, clear only row 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3341 WIN_BOX_BLACK dm_warning_row, dm_warning_bot, dm_warning_column, dm_warning_rgt ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3342 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3343 TFT_clear_warning_text2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3344 WIN_BOX_BLACK surf_warning1_row, surf_warning2_row+.24, surf_warning1_column, surf_warning1_column+.76 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3345 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3346
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3347 global TFT_clear_warning_text_2nd_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3348 TFT_clear_warning_text_2nd_row:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3349 btfss divemode ; in divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3350 bra TFT_clear_warning_text_2nd_2 ; No, setup for surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3351 bcf FLAG_TFT_dive_warning_text_clr2 ; Clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3352 WIN_BOX_BLACK dm_warning2_row, dm_warning2_bot, dm_warning2_column, dm_warning2_rgt ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3353 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3354 TFT_clear_warning_text_2nd_2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3355 WIN_BOX_BLACK surf_warning2_row, surf_warning2_row+.24, surf_warning2_column, surf_warning2_column+.76 ; top, bottom, left, right
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3356 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3357
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3358 global TFT_fillup_with_spaces
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3359 TFT_fillup_with_spaces: ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3360 movwf lo ; save max. string length into lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3361 movf FSR2L,W ; Get current string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3362 subwf lo,F ; lo-WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3363 btfsc STATUS,N ; longer then #lo already?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3364 return ; Yes, done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3365 tstfsz lo ; Zero?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3366 bra TFT_fillup_with_spaces2 ; No.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3367 return ; Yes, done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3368 TFT_fillup_with_spaces2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3369 PUTC " " ; Add one space
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3370 decfsz lo,F ; All done?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3371 bra TFT_fillup_with_spaces2 ; No, loop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3372 return ; Done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3373
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3374 ;=============================================================================
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3375
0
heinrichsweikamp
parents:
diff changeset
3376 global TFT_desaturation_time
heinrichsweikamp
parents:
diff changeset
3377 TFT_desaturation_time:
heinrichsweikamp
parents:
diff changeset
3378 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3379 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3380 return ; No
0
heinrichsweikamp
parents:
diff changeset
3381 STRCPY "Desat:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3382 movff int_O_desaturation_time+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3383 movff int_O_desaturation_time+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3384 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3385 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3386 movf lo,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3387 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3388 movwf hi ; exchange lo and hi...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3389 output_8 ; Hours
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3390 PUTC ':'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3391 movff hi,lo ; Minutes
0
heinrichsweikamp
parents:
diff changeset
3392 output_99x
heinrichsweikamp
parents:
diff changeset
3393 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3394 movlw surf_warning_length ; Only use surface string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3395 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3396 movlw .0 ; TODO - needed?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3397 movff WREG,buffer+11 ; TODO - needed?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3398 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3399 bcf win_invert
0
heinrichsweikamp
parents:
diff changeset
3400 return
heinrichsweikamp
parents:
diff changeset
3401
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3402
0
heinrichsweikamp
parents:
diff changeset
3403 global TFT_nofly_time
heinrichsweikamp
parents:
diff changeset
3404 TFT_nofly_time:
heinrichsweikamp
parents:
diff changeset
3405 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3406 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3407 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3408 movff char_I_altitude_wait,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3409 tstfsz WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3410 bra TFT_nofly_time_1
0
heinrichsweikamp
parents:
diff changeset
3411 STRCPY "NoFly:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3412 bra TFT_nofly_time_2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3413 TFT_nofly_time_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3414 STRCPY "NoAlt:"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3415 TFT_nofly_time_2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3416 movff int_O_nofly_time+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3417 movff int_O_nofly_time+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3418 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3419 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3420 movf lo,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3421 movff hi,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3422 movwf hi ; exchange lo and hi...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3423 output_8 ; Hours
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3424 PUTC ':'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3425 movff hi,lo ; Minutes
0
heinrichsweikamp
parents:
diff changeset
3426 output_99x
heinrichsweikamp
parents:
diff changeset
3427 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3428 movlw surf_warning_length ; Only use surface string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3429 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3430 movlw .0 ; TODO - needed?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3431 movff WREG,buffer+11 ; TODO - needed?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3432 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3433 bcf win_invert
0
heinrichsweikamp
parents:
diff changeset
3434 return
heinrichsweikamp
parents:
diff changeset
3435
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3436 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3437
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3438 global TFT_warning_agf
0
heinrichsweikamp
parents:
diff changeset
3439 TFT_warning_agf:
heinrichsweikamp
parents:
diff changeset
3440 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3441 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3442 return ; No
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3443 call TFT_attention_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3444 STRCPY_TEXT tDiveaGF_active ; "aGF!"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3445 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3446 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3447 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3448 ;bcf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3449 ;return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3450 goto TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
3451
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3452 global TFT_warning_fallback
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3453 TFT_warning_fallback: ; Show fallback warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3454 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3455 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3456 return ; No
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3457 call TFT_warnings_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3458 STRCPY_TEXT tDiveFallback ; "Fallback!"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3459 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3460 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3461 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3462 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3463
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3464
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3465 global TFT_info_deco
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3466 TFT_info_deco: ; show info when in decompression
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3467 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3468 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3469 return ; NO - return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3470 movlw color_green ; YES - select green text color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3471 call TFT_set_color ; set color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3472 STRCPY_TEXT tDecoInfo ; write "Deco Zone"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3473 movlw dm_warning_length ; select Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3474 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3475 STRCAT_PRINT "" ; print buffer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3476 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3477
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3478
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3479 global TFT_warning_gf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3480 TFT_warning_gf: ; GF
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3481 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3482 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3483 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3484 movff int_O_gradient_factor+0,lo ; bank-safe copy gradient factor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3485 movff int_O_gradient_factor+1,hi ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3486 call TFT_color_code_gf ; Color-code Output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3487 STRCPY "GF: " ; the two spaces are on purpose to align the output with other warnings' outputs
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3488 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3489 output_8 ; print value of lo only, int_O_gradient_factor is limited to 255
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3490 PUTC "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3491 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3492 btfss divemode ; In Divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3493 movlw surf_warning_length ; No, use surface string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3494 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3495 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3496 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3497 bcf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3498 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3499
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3500
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3501 global TFT_warning_mbubbles
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3502 TFT_warning_mbubbles:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3503 rcall TFT_warning_set_window ; sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3504 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3505 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3506 call TFT_attention_color ; set attention color as default
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3507 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3508 btfsc WREG,mbubble_warning ; are we in the microbubbles zone right now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3509 call TFT_warnings_color ; YES - reconfigure to warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3510 STRCPY_TEXT tMicroBubbles
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3511 movlw dm_warning_length ; divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3512 btfss divemode ; in Divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3513 movlw surf_warning_length ; NO - use surface string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3514 rcall TFT_fillup_with_spaces ; fillup FSR2 with spaces (total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3515 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3516 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3517
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3518
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3519 global TFT_warning_outside
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3520 TFT_warning_outside:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3521 rcall TFT_warning_set_window ; sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3522 tstfsz WREG ; is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3523 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3524 call TFT_attention_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3525 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3526 btfsc WREG,outside_warning ; are we outside the ZH-L16 model right now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3527 call TFT_warnings_color ; YES - reconfigure to warning color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3528 STRCPY "X-ZHL16-X"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3529 movlw dm_warning_length ; divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3530 btfss divemode ; in Divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3531 movlw surf_warning_length ; NO - use surface string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3532 rcall TFT_fillup_with_spaces ; fillup FSR2 with spaces (total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3533 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3534 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3535
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3536
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3537 global TFT_warning_gas_needs_warn
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3538 global TFT_warning_gas_needs_att
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3539 TFT_warning_gas_needs_warn:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3540 rcall TFT_warning_gas_needs_war_helper
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3541 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3542 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3543 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3544 call TFT_warnings_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3545 bra TFT_warning_gas_needs_com
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3546 TFT_warning_gas_needs_att:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3547 rcall TFT_warning_gas_needs_att_helper
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3548 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3549 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3550 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3551 call TFT_attention_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3552 TFT_warning_gas_needs_com:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3553 STRCPY_TEXT tGasNeedsWarn ; "Gas Needs"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3554 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3555 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3556 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3557 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3558
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3559 TFT_warning_gas_needs_war_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3560 incf warning_counter,F ; increase counter
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3561 btfsc gas_needs_warning ; is it a new warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3562 return ; NO - do not show the gas needs custom view again
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3563 bsf gas_needs_warning ; YES - memorise it's an old now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3564 bra TFT_warning_gas_needs_helper_com
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3565 TFT_warning_gas_needs_att_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3566 incf warning_counter,F ; increase counter
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3567 btfsc gas_needs_attention ; is it a new attention?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3568 return ; NO - do not show the gas needs custom view again
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3569 bsf gas_needs_attention ; YES - memorise it's an old now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3570 TFT_warning_gas_needs_helper_com:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3571 movlw .12 ; customview number one below gas needs view
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3572 movwf menupos3 ; set fake current view number
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3573 bsf toggle_customview ; initiate toggle of customview -> gas needs view will be shown
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3574 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3575
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3576
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3577 global TFT_warning_IBCD
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3578 TFT_warning_IBCD:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3579 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3580 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3581 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3582 call TFT_attention_color ; select attention color as default
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3583 STRCPY_TEXT tIBCD ; "IBCD N2He"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3584 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3585 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3586 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3587 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3588
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3589
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3590 global TFT_warning_sensor_disagree
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3591 TFT_warning_sensor_disagree: ; Show sensor disagree warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3592 rcall TFT_warning_sensor_dis_helper
145
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
3593 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3594 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3595 return ; No
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3596 call TFT_warnings_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3597 STRCPY_TEXT tSensorDisagree ; "Sensors<>"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3598 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3599 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3600 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3601 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3602
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3603 TFT_warning_sensor_dis_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3604 btfsc sensor_warning ; is it a new warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3605 return ; NO - do not show the gas needs custom view again
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3606 bsf sensor_warning ; YES - memories it's an old warning now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3607 clrf menupos3 ; set fake current view number
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3608 bsf toggle_customview ; initiate toggle of customview -> sensor view will be shown
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3609 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3610
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3611 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3612
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3613 TFT_warning_set_window: ; Sets the row and column for the current warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3614 ; ignore warning (now)?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3615 decf warning_counter,W ; -1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3616 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3617 btfss alternative_divelayout ; In alt mode, do not divide...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3618 rrcf WREG,W ; (warning_counter-1)/2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3619 cpfseq warning_page
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3620 retlw .255 ; WREG <> 0 -> Warning window not defined
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3621 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3622 btfss divemode ; in divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3623 bra TFT_warning_set_window3 ; No, setup for surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3624 btfss alternative_divelayout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3625 bra TFT_warning_set_window3a ; standard layout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3626 bra TFT_warning_set_window2a ; alternative layout (Only lower row used)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3627 TFT_warning_set_window3a:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3628 btfss warning_counter,0 ; Toggle with each warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3629 bra TFT_warning_set_window2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3630 WIN_SMALL dm_warning1_column, dm_warning1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3631 bcf second_row_warning ; =1: The second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3632 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3633 TFT_warning_set_window2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3634 bsf second_row_warning ; =1: The second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3635 TFT_warning_set_window2a:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3636 WIN_SMALL dm_warning2_column, dm_warning2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3637 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3638 TFT_warning_set_window3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3639 btfss warning_counter,0 ; Toggle with each warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3640 bra TFT_warning_set_window4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3641 WIN_SMALL surf_warning1_column,surf_warning1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3642 bcf second_row_warning ; =1: The second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3643 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3644 TFT_warning_set_window4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3645 WIN_SMALL surf_warning2_column,surf_warning2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3646 bsf second_row_warning ; =1: The second row contains a warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3647 retlw .0 ; WREG=0 -> Warning window defined
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3648
309
efb53af0d62a VSIbar #1: layout position changes
janos_kovacs <kovjanos@gmail.com>
parents: 307
diff changeset
3649
0
heinrichsweikamp
parents:
diff changeset
3650 global TFT_update_batt_percent_divemode
heinrichsweikamp
parents:
diff changeset
3651 TFT_update_batt_percent_divemode:
heinrichsweikamp
parents:
diff changeset
3652 rcall TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3653 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3654 return ; No
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3655 movff batt_percent,lo ; Get battery percent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3656 call TFT_color_code_battery ; Color-code battery percent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3657 STRCPY "Batt:"
0
heinrichsweikamp
parents:
diff changeset
3658 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3659 output_8
heinrichsweikamp
parents:
diff changeset
3660 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3661 PUTC "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3662 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3663 btfss divemode ; In Divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3664 movlw surf_warning_length ; No, use surface string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3665 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3666 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3667 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3668 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3669
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3670
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3671 global TFT_gf_mask ; Setup Mask
0
heinrichsweikamp
parents:
diff changeset
3672 TFT_gf_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3673 ; The mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3674 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3675 WIN_TINY dm_custom_gf_title_col1, dm_custom_gf_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3676 STRCPY_TEXT_PRINT tGFactors
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3677 WIN_TINY dm_custom_gf_title_col2, dm_custom_gf_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3678 STRCPY_TEXT_PRINT taGFactors
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3679 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3680 STRCPY_TEXT_PRINT tGFInfo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3681 ; Show GF (Static)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3682 call TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3683 btfss use_agf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3684 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3685 WIN_STD dm_custom_gf_column, dm_custom_gf_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3686 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3687 movff opt_GF_low,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3688 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3689 PUTC "/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3690 movff opt_GF_high,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3691 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3692 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3693 ; Show aGF (Static)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3694 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3695 TSTOSS opt_enable_aGF ; =1: aGF can be selected underwater
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3696 bra TFT_gf_mask2 ; Show "---" instead
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3697 btfss use_agf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3698 call TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3699 WIN_STD dm_custom_agf_column, dm_custom_agf_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3700 movff opt_aGF_low,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3701 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3702 PUTC "/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3703 movff opt_aGF_high,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3704 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3705 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3706 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3707 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
3708
heinrichsweikamp
parents:
diff changeset
3709 TFT_gf_mask2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3710 WIN_STD dm_custom_agf_column+.10, dm_custom_agf_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3711 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3712 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3713 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3714
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3715
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3716 global TFT_gf_mask_cGF ; Setup Mask
333
14b466f66a7f Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents: 332
diff changeset
3717 TFT_gf_mask_cGF:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3718 ; The mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3719 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3720 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3721 STRCPY_TEXT_PRINT tGFInfo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3722 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3723
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3724 global TFT_gf_info ; Show GF informations
0
heinrichsweikamp
parents:
diff changeset
3725 TFT_gf_info:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3726 WIN_STD dm_custom_currentgf_column, dm_custom_currentgf_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3727 movff int_O_gradient_factor+0,lo ; gradient factor absolute (Non-GF model)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3728 movff int_O_gradient_factor+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3729 call TFT_color_code_gf ; Color-code Output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3730 output_8 ; print lo only, int_O_gradient_factor is limited to 255
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3731 STRCAT_PRINT "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3732 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3733
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3734
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3735 global TFT_battinfo_tissues_clock_mask ; Setup Mask
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3736 TFT_battinfo_tissues_clock_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3737 ; The mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3738 ; Put three columns at HUD positions
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3739 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3740 btfsc FLAG_apnoe_mode ; In Apnoe mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3741 bra TFT_battinfo_tissues_clock_mask2 ; Yes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3742 btfsc FLAG_gauge_mode ; In Gauge mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3743 bra TFT_battinfo_tissues_clock_mask2 ; Yes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3744 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3745 STRCPY_TEXT_PRINT tDiveTissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3746 TFT_battinfo_tissues_clock_mask2: ; Show only clock
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3747 WIN_TINY dm_custom_ead_column, dm_custom_eadend_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3748 STRCPY_TEXT_PRINT tBatteryV ; "Battery: "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3749 WIN_TINY dm_custom_clock_column, dm_custom_clock_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3750 STRCPY_TEXT_PRINT tDiveClock
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3751 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3752
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3753 global TFT_battinfo_tissues_clock ; Show EAD/END, Tissues and clock
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3754 TFT_battinfo_tissues_clock:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3755 ; Update clock and date
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3756 WIN_SMALL dm_custom_clock_column, dm_custom_clock_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3757 call TFT_clock2 ; print clock
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3758
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3759 ; Show Battery info
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3760 WIN_SMALL dm_custom_ead_column, dm_custom_ead_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3761 movff batt_percent,lo ; Get battery percent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3762 call TFT_color_code_battery ; Color-code battery percent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3763 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3764 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3765 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3766 STRCAT "% "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3767 movlw 0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3768 movff WREG,buffer+4 ; Only "xxx%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3769 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3770 bcf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3771 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3772 WIN_SMALL dm_custom_end_column, dm_custom_end_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3773 movff batt_voltage+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3774 movff batt_voltage+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3775 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3776 output_16dp .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3777 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3778 PUTC 'V'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3779 movff buffer+5,buffer+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3780 movlw 0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3781 movff WREG,buffer+5 ; Only "x.yzV"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3782 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3783
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3784 btfsc FLAG_apnoe_mode ; In Apnoe mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3785 return ; Yes, done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3786 btfsc FLAG_gauge_mode ; In Gauge mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3787 return ; Yes, done.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3788
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3789 ; Show tissue diagram
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3790 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3791 WIN_TINY dm_custom_tissue_N2_column, dm_custom_tissue_N2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3792 STRCPY_TEXT_PRINT tN2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3793 WIN_TINY dm_custom_tissue_He_column, dm_custom_tissue_He_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3794 STRCPY_TEXT_PRINT tHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3795 bra DISP_tissue_saturation_graph ; Show char_O_tissue_N2_saturation and char_O_tissue_He_saturation and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3796
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3797
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3798 global TFT_pscr_info_mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3799 TFT_pscr_info_mask: ; Show pSCR-ppO2, drop and lung ratio mask
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3800 rcall TFT_mask_ppo2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3801 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3802 WIN_TINY dm_custom_pscr_text_drop_column, dm_custom_pscr_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3803 STRCPY_TEXT_PRINT tPSCR_O2_drop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3804 WIN_TINY dm_custom_pscr_text_ratio_column, dm_custom_pscr_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3805 STRCPY_TEXT_PRINT tPSCR_lungratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3806 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3807
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3808 global TFT_pscr_info ; Show pSCR-ppO2, drop and lung ratio
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3809 TFT_pscr_info:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3810 ;show ppO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3811 WIN_MEDIUM dm_custom_ceiling_ppo2_val_col, dm_custom_ceiling_value_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3812 movff int_O_pSCR_ppO2+0,lo ; copy pSCR ppO2 to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3813 movff int_O_pSCR_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3814 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3815 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3816 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3817 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3818 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3819 ; Show Drop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3820 WIN_STD dm_custom_pscr_drop_column,dm_custom_pscr_drop_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3821 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3822 movff char_I_PSCR_drop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3823 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3824 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3825 STRCAT_PRINT "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3826 ; Show lung ratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3827 WIN_STD dm_custom_pscr_ratio_column,dm_custom_pscr_ratio_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3828 movff char_I_PSCR_lungratio,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3829 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3830 STRCPY "1/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3831 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3832 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3833 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3834 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3835
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3836
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3837 global TFT_gas_needs_mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3838 TFT_gas_needs_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3839 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3840 WIN_TINY dm_custom_dyn_gas_mask_column-.10,dm_custom_dyn_gas_mask_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3841 STRCPY_TEXT_PRINT tGasNeedsBar ; "Gas Needs (bar)"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3842 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3843
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3844 global TFT_gas_needs
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3845 TFT_gas_needs: ; LIMITATION: there is only space for 4 gases on the screen - if 5 gases
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3846 bsf leftbind ; have a pres_need > 0, then only the first 4 will be shown!
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3847 clrf up
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3848 WIN_SMALL dm_custom_dyn_gas_column1+.5,dm_custom_dyn_gas_row1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3849 call TFT_gas_needs_helper
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3850 WIN_SMALL dm_custom_dyn_gas_column1+.5,dm_custom_dyn_gas_row2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3851 call TFT_gas_needs_helper
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3852 WIN_SMALL dm_custom_dyn_gas_column2+.5,dm_custom_dyn_gas_row1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3853 call TFT_gas_needs_helper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3854 WIN_SMALL dm_custom_dyn_gas_column2+.5,dm_custom_dyn_gas_row2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3855 call TFT_gas_needs_helper
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3856 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3857 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3858
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3859 TFT_gas_needs_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3860 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3861 movlw .5 ; number of gases
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3862 cpfslt up ; check if all gases have been processed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3863 bra TFT_gas_needs_helper_1 ; yes -> clear display area
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3864 movf up,W ; no -> get gas number and check if need of that gas is > 0
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3865 rlncf WREG,W ; multipy by 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3866 lfsr FSR1,int_O_tank_pres_need+1 ; read HIGH(int_O_tank_pres_need[up])
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3867 movff PLUSW1,hi ; copy to temp storage hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3868 btfss hi,int_is_zero ; check flag for pres_need == 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3869 bra TFT_gas_needs_helper_2 ; no -> print gas type and pressure needed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3870 incf up,F ; yes -> increment to next gas...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3871 bra TFT_gas_needs_helper ; ...and try the next gas
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3872 TFT_gas_needs_helper_1: ; no gases to show anymore, clear display area from potential remains of last invocation
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3873 STRCAT_PRINT " ---- " ; overwrite outdated stuff if screen position is not needed
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3874 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3875 TFT_gas_needs_helper_2: ; output gas type and pressure needed
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3876 movf up,W ; get gas number (0-4) to WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3877 lfsr FSR1,opt_gas_O2_ratio ; read opt_gas_O2_ratio[WREG]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3878 movff PLUSW1,lo ; copy result to lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3879 movf up,W ; get gas number (0-4) to WREG ; SHOULD NOT BE NEEDED AS movff SHOULD NOT ALTER wreg
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3880 lfsr FSR1,opt_gas_He_ratio ; read opt_gas_He_ratio[WREG]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3881 movff PLUSW1,hi ; copy result to hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3882 call customview_show_mix ; print "Air", "O2", "21/35", etc.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3883 STRCAT ":"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3884 movf up,W ; get gas number (0-4) to WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3885 rlncf WREG,W ; multipy by 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3886 lfsr FSR1,int_O_tank_pres_need+0 ; read lower part of integer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3887 movff PLUSW1,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3888 movf up,W ; get gas number (0-4) to WREG ; SHOULD NOT BE NEEDED AS movff SHOULD NOT ALTER wreg
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3889 rlncf WREG,W ; multipy by 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3890 lfsr FSR1,int_O_tank_pres_need+1 ; read upper part of integer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3891 movff PLUSW1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3892 btfsc hi,int_attention_flag ; check if attention flag is set (pres_need > pres_fill * threshold)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3893 call TFT_attention_color ; yes, print gas need in yellow
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3894 btfsc hi,int_warning_flag ; check if warning flag is set (pres_need > pres_fill)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3895 call TFT_warnings_color ; yes, print gas need in red
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3896 movff int_O_tank_pres_need+1,WREG ; get HIGH(int_O_tank_pres_need[0]) which hold flag for invalid data
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3897 btfsc WREG,int_invalid_flag ; check if invalid data flag is set
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3898 call TFT_disabled_color ; yes, print gas need in disabled color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3899 bcf hi,int_attention_flag ; clear attention flag for attention color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3900 bcf hi,int_warning_flag ; clear warning flag for warning color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3901 bcf hi,int_invalid_flag ; clear flag for invalid data (will actually only be set with 1st gas)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3902 output_16_3 ; limit to 999 and display only (0-999)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3903 STRCAT_PRINT " " ; adds a space to overwrite any potential remains of earlier outputs
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3904 incf up,F ; increment to next gas
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3905 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3906
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3907
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3908 global TFT_mask_ppo2 ; helper function for several custom views
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3909 TFT_mask_ppo2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3910 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3911 btfss FLAG_ccr_mode ; in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3912 bra TFT_mask_ppo2a ; NO - continue checking for pSCR and OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3913 btfsc is_bailout ; in bailout?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3914 bra TFT_mask_ppo2b ; YES
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3915 WIN_TINY dm_custom_ceiling_ppo2_col_dil,dm_custom_ceiling_text_row ; tuned position for longer text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3916 STRCPY_TEXT_PRINT tppO2Dil ; print "ppO2(Dil)"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3917 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3918 TFT_mask_ppo2a:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3919 btfss FLAG_pscr_mode ; in pSCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3920 bra TFT_mask_ppo2b ; NO - continue with OC mode (or bailout)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3921 btfsc is_bailout ; in bailout?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3922 bra TFT_mask_ppo2b ; YES
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3923 WIN_TINY dm_custom_ceiling_ppo2_col_dil,dm_custom_ceiling_text_row ; tuned position for longer text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3924 STRCPY_TEXT_PRINT tppO2Mix ; print "ppO2(Mix)"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3925 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3926 TFT_mask_ppo2b: ; OC mode or bailout
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3927 WIN_TINY dm_custom_ceiling_ppo2_column, dm_custom_ceiling_text_row ; normal position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3928 STRCPY_TEXT_PRINT tppO2 ; in all other modes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3929 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3930
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3931
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3932 global TFT_display_pure_ppo2 ; show ppO2 of the pure gas - helper function for several custom views
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3933 TFT_display_pure_ppo2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3934 WIN_MEDIUM dm_custom_ceiling_ppo2_val_col, dm_custom_ceiling_value_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3935 movff int_O_pure_ppO2+0,lo ; copy ppO2 of the pure gas to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3936 movff int_O_pure_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3937 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3938 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3939 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3940 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3941 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3942 goto TFT_standard_color ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3943
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3944
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3945 global TFT_ppo2_ead_end_cns_mask ; Show ppO2, END/EAD and CNS mask
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3946 TFT_ppo2_ead_end_cns_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3947 rcall TFT_mask_ppo2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3948 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3949 WIN_TINY dm_custom_ead_column, dm_custom_eadend_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3950 STRCPY_TEXT_PRINT tDiveEAD_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3951 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3952 STRCPY_TEXT_PRINT tCNS2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3953 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3954
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3955
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3956 global TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3957 TFT_ppo2_ead_end_cns:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3958 ;show ppO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3959 rcall TFT_display_pure_ppo2 ; show ppO2 of the pure gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3960 ; Show END/EAD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3961 WIN_SMALL dm_custom_ead_column, dm_custom_ead_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3962 STRCPY_TEXT tEAD ; EAD:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3963 movff char_O_EAD,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3964 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3965 WIN_SMALL dm_custom_end_column, dm_custom_end_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3966 STRCPY_TEXT tEND ; END:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3967 movff char_O_END,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3968 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3969 ; Show CNS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3970 WIN_STD dm_custom_currentgf_column, dm_custom_currentgf_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3971 movff int_O_CNS_fraction+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3972 movff int_O_CNS_fraction+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3973 call TFT_color_code_cns ; Color-code CNS output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3974 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3975 output_16_3 ; Displays only 0...999
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3976 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3977 STRCAT_PRINT "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3978 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3979
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3980 TFT_end_ead_common: ; print "lo m" (or ft) and limit to 8 chars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3981 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3982 TSTOSS opt_units ; 0=Meters, 1=Feets
0
heinrichsweikamp
parents:
diff changeset
3983 bra TFT_end_ead_common_metric
heinrichsweikamp
parents:
diff changeset
3984 ;TFT_end_ead_common_imperial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3985 movf lo,W ; With lo in m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3986 mullw .100 ; PRODL:PRODH = mbar/min
0
heinrichsweikamp
parents:
diff changeset
3987 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
3988 movff PRODH,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3989 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3990 output_16_3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3991 STRCAT_TEXT tFeets
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3992 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3993 movff WREG,buffer+.8 ; limit string length to 8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3994 bra TFT_end_ead_common_exit
0
heinrichsweikamp
parents:
diff changeset
3995 TFT_end_ead_common_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3996 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3997 STRCAT_TEXT tMeters
0
heinrichsweikamp
parents:
diff changeset
3998 TFT_end_ead_common_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3999 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4000 movlw .8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4001 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4002 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4003 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4004
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4005
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4006 global TFT_sensor_check_mask ; show ppO2 of O2 and Diluent mask
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4007 TFT_sensor_check_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4008 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4009 WIN_TINY dm_custom_s_check_text_column, dm_custom_s_check_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4010 STRCPY_TEXT_PRINT tSensorCheck
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4011 WIN_TINY dm_custom_ppO2_text_column, dm_custom_s_check_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4012 STRCPY_TEXT_PRINT tppO2O2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4013 WIN_TINY dm_custom_ppDil_text_column, dm_custom_s_check_text_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4014 STRCPY_TEXT_PRINT tppO2Dil
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4015 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4016
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4017 global TFT_sensor_check ; show ppO2 of O2 and Diluent
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4018 TFT_sensor_check:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4019 ; Show ppO2 of O2 in this depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4020 WIN_MEDIUM dm_custom_s_check_ppo2_o2_column, dm_custom_s_check_value_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4021 movff int_O_O2_ppO2+0,lo ; copy ppO2 of pure O2 to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4022 movff int_O_O2_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4023 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4024 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4025 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4026 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4027 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4028 ; Show ppO2 of the diluent in this depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4029 WIN_MEDIUM dm_custom_s_check_ppo2_dil_col, dm_custom_s_check_value_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4030 movff int_O_pure_ppO2+0,lo ; copy ppO2 of pure gas to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4031 movff int_O_pure_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4032 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4033 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4034 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4035 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4036 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4037 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4038
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4039 ;=============================================================================
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4040
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4041 global TFT_surface_lastdive
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4042 TFT_surface_lastdive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4043 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4044 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4045 STRCAT_TEXT_PRINT tLastDive ; Last Dive:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4046 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4047 STRCAT_TEXT_PRINT tDivetime ; Divetime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4048 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4049 STRCAT_TEXT_PRINT tMaxDepth ; Max. Depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4050 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4051 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4052
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4053 movff int_O_desaturation_time+0,lo ; bank-safe copies
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4054 movff int_O_desaturation_time+1,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4055 iorwf lo,W ; check if desaturation time is zero
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4056 bz TFT_surface_lastdive_1 ; YES - show last dive time
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4057 movff surface_interval+0,lo ; NO - show dive interval
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4058 movff surface_interval+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4059 call convert_time ; lo=mins, hi=hours
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4060 movf hi,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4061 movff lo,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4062 movwf lo ; exchange lo and hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4063 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4064 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4065 PUTC 'h'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4066 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4067 output_99x
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4068 STRCAT_PRINT "m "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4069 bra TFT_surface_lastdive_2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4070 TFT_surface_lastdive_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4071 movff lastdive_time+0,xC+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4072 movff lastdive_time+1,xC+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4073 movff lastdive_time+2,xC+2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4074 movff lastdive_time+3,xC+3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4075 movlw LOW .3600
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4076 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4077 movlw HIGH .3600
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4078 movwf xB+1 ; One day = 3600s
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4079 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4080 ;xC+0:xC+1 -> Full hours
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4081 movff xC+1,xA+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4082 movff xC+0,xA+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4083 clrf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4084 movlw .24
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4085 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4086 call div16x16 ;xA/xB=xC with xA+0 as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4087 movff xC+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4088 movff xC+1,hi ; Full days
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4089 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4090 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4091 PUTC "d"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4092 movff xA+0,lo ; Full hours
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4093 output_8
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4094 STRCAT_PRINT "h "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4095 TFT_surface_lastdive_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4096 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4097 movff lastdive_duration+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4098 movff lastdive_duration+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4099 output_16 ; divetime minutes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4100 PUTC ":"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4101 movff lastdive_duration+2,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4102 output_99x ; divetime seconds
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4103 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4104 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4105 movff lastdive_maxdepth+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4106 movff lastdive_maxdepth+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4107 TSTOSS opt_units ; 0=Meters, 1=Feets
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4108 bra TFT_surface_lastdive_metric
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4109 ;imperial
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4110 rcall convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4111 output_16_3 ; limit to 999 and display only (0-999)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4112 STRCAT_TEXT tFeets1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4113 bra TFT_surface_lastdive2
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4114
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4115 TFT_surface_lastdive_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4116 bsf ignore_digit5 ; no cm...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4117 movlw d'1' ; +1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4118 movff WREG,ignore_digits ; no 1000m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4119 output_16dp .3 ; xxx.y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4120 STRCAT_TEXT tMeters
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4121 TFT_surface_lastdive2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4122 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4123 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4124 return ; Done.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4125
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4126 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4127
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4128 global TFT_surface_tissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4129 TFT_surface_tissues: ; Show Tissue diagram in surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4130 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4131 STRCPY_TEXT_PRINT tN2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4132 WIN_SMALL surf_tissue_He_column,surf_tissue_He_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4133 STRCPY_TEXT_PRINT tHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4134
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4135 movlw color_deepblue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4136 call TFT_set_color ; Make this configurable?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4137 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.29,.29
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4138 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.37,.37
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4139 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.45,.45
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4140 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.53,.53
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4141 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.61,.61
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4142 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.69,.69
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4143 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.77,.77
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4144 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.85,.85
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4145 WIN_FRAME_STD surf_tissue_diagram_top, surf_tissue_diagram_bottom, surf_tissue_diagram_left, surf_tissue_diagram_right ; outer frame
0
heinrichsweikamp
parents:
diff changeset
4146
heinrichsweikamp
parents:
diff changeset
4147 movlw .1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4148 movff WREG,win_height ; row bottom (0-239)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4149
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4150 ;---- Draw N2 Tissues ----------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4151
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4152 movlw surf_tissue_diagram_left+.4 ; start position for N2 bars
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4153 movff WREG,win_leftx2 ; column left (0-159)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4154 movlw surf_tissue_diagram_right - surf_tissue_diagram_left - .4 ; max width for N2 bars
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4155 movff WREG,win_width
0
heinrichsweikamp
parents:
diff changeset
4156
heinrichsweikamp
parents:
diff changeset
4157 lfsr FSR2, char_O_tissue_N2_saturation
heinrichsweikamp
parents:
diff changeset
4158 movlw d'16'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4159 movwf lo ; 16 tissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4160 clrf hi ; row offset
0
heinrichsweikamp
parents:
diff changeset
4161 surf_tissue_saturation_graph_N2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4162 movlw surf_tissue_diagram_top+.23 ; surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4163 addwf hi,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4164 movff WREG,win_top ; row top (0-239)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4165 rcall surf_tissue_saturation_loop ; show one tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4166 decfsz lo,F
0
heinrichsweikamp
parents:
diff changeset
4167 bra surf_tissue_saturation_graph_N2
heinrichsweikamp
parents:
diff changeset
4168
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4169 ;---- Draw He Tissues ----------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4170
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4171 movlw surf_tissue_diagram_left + .24 ; start position for He bars (.15 without x2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4172 movff WREG,win_leftx2 ; column left (0-159)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4173 movlw surf_tissue_diagram_right - surf_tissue_diagram_left - .24 ; max width for He bars
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4174 movff WREG,win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4175
0
heinrichsweikamp
parents:
diff changeset
4176 lfsr FSR2, char_O_tissue_He_saturation
heinrichsweikamp
parents:
diff changeset
4177 movlw d'16'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4178 movwf lo ; 16 tissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4179 clrf hi ; row offset
0
heinrichsweikamp
parents:
diff changeset
4180 surf_tissue_saturation_graph_He:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4181 movlw surf_tissue_diagram_top+.23+.57 ; surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4182 addwf hi,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4183 movff WREG,win_top ; row top (0-239)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4184 rcall surf_tissue_saturation_loop ; show one tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4185 decfsz lo,F
0
heinrichsweikamp
parents:
diff changeset
4186 bra surf_tissue_saturation_graph_He
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4187
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4188 WIN_SMALL surf_tissue_He_column+.22,surf_tissue_He_row ; position in-between tissue bars
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4189 movff int_O_CNS_fraction+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4190 movff int_O_CNS_fraction+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4191 call TFT_color_code_cns
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4192 STRCPY_TEXT tCNS2 ; CNS:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4193 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4194 output_16_3 ; Displays only 0...999
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4195 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4196 STRCAT_PRINT "%"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4197 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
4198
heinrichsweikamp
parents:
diff changeset
4199 surf_tissue_saturation_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4200 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4201 movlw .2 ; row spacing
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4202 addwf hi,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4203 movf POSTINC2,W ; get tissue load
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4204 bcf WREG,7 ; clear flag bit for sat/desat info (not used in surface mode)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4205 rlncf WREG,W ; multiply with 2 (previously cleared bit 7 will be rotated to bit 0)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4206 incf WREG,W ; add 1 for a minimum visible bar (He-bars could be invisible else-wise)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4207 movwf up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4208 movff win_width+0,WREG ; get max window width (win_width)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4209 cpfslt up ; skip if WREG < win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4210 movwf up ; crop length to win_width
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4211 ; no need to be able to draw longer bars –
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4212 ; we are at the surface and if bars would
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4213 ; even touch the max length possible here,
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4214 ; the diver would be in severe decompression
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4215 ; issues if not dead already...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4216 movff up,win_bargraph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4217 clrf win_width+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4218 goto TFT_box ; and return...
0
heinrichsweikamp
parents:
diff changeset
4219
heinrichsweikamp
parents:
diff changeset
4220 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4221 ; Draw saturation graph in dive mode.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4222
0
heinrichsweikamp
parents:
diff changeset
4223 DISP_tissue_saturation_graph:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4224 ;---- Draw Frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4225 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4226 WIN_FRAME_COLOR16 dm_custom_tissue_diagram_top, dm_custom_tissue_diagram_bottom, dm_custom_tissue_diagram_left, .159 ; outer frame
0
heinrichsweikamp
parents:
diff changeset
4227
heinrichsweikamp
parents:
diff changeset
4228 movlw .1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4229 movff WREG,win_height ; row bottom (0-239)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4230
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4231 ;---- Draw N2 Tissues ----------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4232
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4233 movlw dm_custom_tissue_diagram_left+.3 ; divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4234 movff WREG,win_leftx2 ; column left (0-159)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4235 movlw .159-dm_custom_tissue_diagram_left-.4 ; width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4236 movff WREG,win_width
0
heinrichsweikamp
parents:
diff changeset
4237
heinrichsweikamp
parents:
diff changeset
4238 lfsr FSR2, char_O_tissue_N2_saturation
heinrichsweikamp
parents:
diff changeset
4239 movlw d'16'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4240 movwf lo ; 16 tissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4241 clrf hi ; row offset
0
heinrichsweikamp
parents:
diff changeset
4242 tissue_saturation_graph_N2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4243 movlw dm_custom_tissue_diagram_top+.3 ; divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4244 rcall tissue_saturation_graph_loop ; show one tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4245 decfsz lo,F
0
heinrichsweikamp
parents:
diff changeset
4246 bra tissue_saturation_graph_N2
heinrichsweikamp
parents:
diff changeset
4247
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4248 ;---- Draw He Tissues ----------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4249
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4250 movlw dm_custom_tissue_diagram_left + .8 ; divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4251 movff WREG,win_leftx2 ; column left (0-159)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4252 movlw .159 - dm_custom_tissue_diagram_left - .14 ; width
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4253 movff WREG,win_width
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4254
0
heinrichsweikamp
parents:
diff changeset
4255 lfsr FSR2, char_O_tissue_He_saturation
heinrichsweikamp
parents:
diff changeset
4256 movlw d'16'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4257 movwf lo ; 16 tissues
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4258 clrf hi ; row offset
0
heinrichsweikamp
parents:
diff changeset
4259 tissue_saturation_graph_He:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4260 movlw dm_custom_tissue_diagram_top+.3+.22 ; divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4261 rcall tissue_saturation_graph_loop ; show one tissue
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4262 decfsz lo,F
0
heinrichsweikamp
parents:
diff changeset
4263 bra tissue_saturation_graph_He
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4264 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
4265
heinrichsweikamp
parents:
diff changeset
4266 tissue_saturation_graph_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4267 addwf hi,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4268 movff WREG,win_top ; row top (0-239)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4269 movlw color_cyan ; preset color for tissues with decreasing pressure
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4270 call TFT_set_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4271 incf hi,F
0
heinrichsweikamp
parents:
diff changeset
4272 movf POSTINC2,W
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4273 btfss WREG,7 ; check fs flag for increasing tissue pressure set
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4274 bra tissue_saturation_graph_loop_1 ; NO - keep color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4275 movwf up ; YES - buffer WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4276 movlw color_orange ; select color for tissues with increasing pressure
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4277 call TFT_set_color ; change color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4278 movf up,W ; restore WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4279 tissue_saturation_graph_loop_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4280 bcf WREG,7 ; clear flag bit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4281 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4282 rrcf WREG ; divide by 2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4283 incf WREG,W ; add a bit for a minimum visible bar
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4284 movwf up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4285 movf win_width,W ; get max window width (win_width)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4286 cpfslt up ; skip if WREG < win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4287 movwf up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4288 movff up,win_bargraph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4289 clrf win_width+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4290 goto TFT_box ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4291
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4292 ;=============================================================================
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
4293
0
heinrichsweikamp
parents:
diff changeset
4294 global TFT_display_cns
heinrichsweikamp
parents:
diff changeset
4295 TFT_display_cns:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4296 call TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4297 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4298 return ; No
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4299 STRCPY_TEXT tCNS ; CNS:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4300 movff int_O_CNS_fraction+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4301 movff int_O_CNS_fraction+1,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4302 call TFT_color_code_cns ; Color-code CNS output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4303 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4304 output_16_3 ; Displays only 0...999
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4305 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4306 PUTC "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4307 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4308 btfss divemode ; In Divemode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4309 movlw surf_warning_length ; No, use surface string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4310 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4311 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4312 bcf win_invert
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4313 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4314
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4315
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4316 global TFT_display_eod_cns
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4317 TFT_display_eod_cns:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4318 call TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4319 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4320 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4321 call TFT_warnings_color ; switch to warnings (red) text color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4322 STRCPY_TEXT tCNSeod ; end-of-dive CNS warning text
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4323 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4324 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
0
heinrichsweikamp
parents:
diff changeset
4325 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4326 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4327
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4328
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4329 global TFT_display_ppo2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4330 TFT_display_ppo2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4331 call TFT_warning_set_window ; Sets the row and column for the current warning
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4332 tstfsz WREG ; Is there room for the warning?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4333 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4334 movff int_O_pure_ppO2+0,lo ; copy ppO2 of the pure gas (OC: = breathed gas, loop: = diluent/premix) to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4335 movff int_O_pure_ppO2+1,hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4336 call TFT_color_code_ppo2 ; Color-code output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4337 btfss FLAG_ccr_mode ; in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4338 bra TFT_display_diluent_1 ; NO - continue with pSCR or OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4339 btfsc is_bailout ; YES - in bailout?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4340 bra TFT_display_diluent_2 ; YES - continue with OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4341 STRCPY_TEXT tdil ; NO - print "Dil:"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4342 bra TFT_display_diluent_3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4343 TFT_display_diluent_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4344 btfss FLAG_pscr_mode ; in pSCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4345 bra TFT_display_diluent_2 ; NO - continue with pSCR or OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4346 btfsc is_bailout ; YES - in bailout?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4347 bra TFT_display_diluent_2 ; YES - continue with OC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4348 STRCPY_TEXT tmix ; NO - print "Mix:"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4349 bra TFT_display_diluent_3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4350 TFT_display_diluent_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4351 STRCPY_TEXT tppO2 ; OC mode or bailout, print "ppO2:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4352 TFT_display_diluent_3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4353 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4354 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4355 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4356 movlw dm_warning_length ; Divemode string length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4357 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4358 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4359 goto TFT_standard_color ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4360
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4361 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4362
0
heinrichsweikamp
parents:
diff changeset
4363 global TFT_LogOffset_Logtitle
heinrichsweikamp
parents:
diff changeset
4364 TFT_LogOffset_Logtitle:
heinrichsweikamp
parents:
diff changeset
4365 STRCPY_TEXT tLogOffset
heinrichsweikamp
parents:
diff changeset
4366 PUTC ":"
heinrichsweikamp
parents:
diff changeset
4367 call do_logoffset_common_read ; Offset into lo:hi
heinrichsweikamp
parents:
diff changeset
4368 bsf leftbind
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
4369 output_16_4
0
heinrichsweikamp
parents:
diff changeset
4370 bcf leftbind
heinrichsweikamp
parents:
diff changeset
4371 PUTC " "
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4372 return ; No "_PRINT" here...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4373
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4374 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4375
0
heinrichsweikamp
parents:
diff changeset
4376 global adjust_depth_with_salinity
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4377 global adjust_depth_with_salinity_log
0
heinrichsweikamp
parents:
diff changeset
4378 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mbar]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4379 btfsc simulatormode_active ; Do not apply salinity in simulator mode
0
heinrichsweikamp
parents:
diff changeset
4380 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4381 movff opt_salinity,WREG ; 0-5%
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4382 adjust_depth_with_salinity_log: ; computes salinity setting (FROM WREG!) into lo:hi [mbar]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4383 addlw d'100' ; 1.00kg/l
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4384 movwf up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4385
0
heinrichsweikamp
parents:
diff changeset
4386 movlw d'105' ; 105% ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4387 cpfslt up ; Salinity higher limit
0
heinrichsweikamp
parents:
diff changeset
4388 return ; Out of limit, do not adjust lo:hi
heinrichsweikamp
parents:
diff changeset
4389 movlw d'99' ; 99% ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4390 cpfsgt up ; Salinity lower limit
0
heinrichsweikamp
parents:
diff changeset
4391 return ; Out of limit, do not adjust lo:hi
heinrichsweikamp
parents:
diff changeset
4392
heinrichsweikamp
parents:
diff changeset
4393 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
4394 movff hi,xA+1
heinrichsweikamp
parents:
diff changeset
4395
heinrichsweikamp
parents:
diff changeset
4396 movlw d'102' ; 0,98bar/10m
heinrichsweikamp
parents:
diff changeset
4397 movwf xB+0
heinrichsweikamp
parents:
diff changeset
4398 clrf xB+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4399 call mult16x16 ; xA*xB=xC (lo:hi * 100)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4400 movff up,xB+0 ; Salinity
0
heinrichsweikamp
parents:
diff changeset
4401 clrf xB+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4402 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
0
heinrichsweikamp
parents:
diff changeset
4403 movff xC+0,lo
heinrichsweikamp
parents:
diff changeset
4404 movff xC+1,hi ; restore lo and hi with updated value
heinrichsweikamp
parents:
diff changeset
4405 return
heinrichsweikamp
parents:
diff changeset
4406
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4407 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4408
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4409 global convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4410 convert_mbar_to_feet: ; convert value in lo:hi from mbar to feet
0
heinrichsweikamp
parents:
diff changeset
4411 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
4412 movff hi,xA+1
heinrichsweikamp
parents:
diff changeset
4413
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4414 movlw LOW d'328' ; 328feet/100m
0
heinrichsweikamp
parents:
diff changeset
4415 movwf xB+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4416 movlw HIGH d'328'
0
heinrichsweikamp
parents:
diff changeset
4417 movwf xB+1
heinrichsweikamp
parents:
diff changeset
4418
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4419 call mult16x16 ; xA*xB=xC (lo:hi * 328)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4420
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4421 movlw d'50' ; round up
0
heinrichsweikamp
parents:
diff changeset
4422 addwf xC+0,F
heinrichsweikamp
parents:
diff changeset
4423 movlw 0
heinrichsweikamp
parents:
diff changeset
4424 addwfc xC+1,F
heinrichsweikamp
parents:
diff changeset
4425 addwfc xC+2,F
heinrichsweikamp
parents:
diff changeset
4426 addwfc xC+3,F
heinrichsweikamp
parents:
diff changeset
4427
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4428 movlw LOW .10000
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4429 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4430 movlw HIGH .10000
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4431 movwf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4432
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4433 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
0
heinrichsweikamp
parents:
diff changeset
4434
heinrichsweikamp
parents:
diff changeset
4435 movff xC+0,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4436 movff xC+1,hi ; restore lo and hi with updated value
0
heinrichsweikamp
parents:
diff changeset
4437 return
heinrichsweikamp
parents:
diff changeset
4438
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4439 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4440
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4441 global convert_celsius_to_fahrenheit ; convert value in lo:hi from celsius to fahrenheit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4442 convert_celsius_to_fahrenheit: ; convert value in lo:hi from celsius to fahrenheit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4443 movff lo,xA+0 ; temperature in 1/10 of °C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4444 movff hi,xA+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4445
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4446 movlw LOW d'1000' ; offset °C value by 1000 to get out of any negative numbers
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4447 addwf xA+0,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4448 movlw HIGH d'1000'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4449 addwfc xA+1,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4450
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4451 movlw d'18' ; adjust scaling: 1°C = 1.8°F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4452 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4453 clrf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4454
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4455 call mult16x16 ; xA*xB=xC (lo:hi * 18)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4456
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4457 movlw d'10'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4458 movwf xB+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4459 clrf xB+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4460
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4461 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4462
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4463 movlw LOW d'1480' ; adjust offset: subtract above offset of 1000 * 1.8 = 1800 now and add 320 => subtract 1480
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4464 subwf xC+0,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4465 movlw HIGH d'1480'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4466 subwfb xC+1,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4467
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4468 movff xC+0,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4469 movff xC+1,hi ; restore lo and hi with updated value
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4470 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4471
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
4472 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4473
0
heinrichsweikamp
parents:
diff changeset
4474 END