annotate src/tft_outputs.asm @ 628:cd58f7fc86db

3.05 stable work
author heinrichsweikamp
date Thu, 19 Sep 2019 12:01:29 +0200
parents c40025d8e750
children 237931377539
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3 ; File tft_outputs.asm next combined generation V3.04.3
0
heinrichsweikamp
parents:
diff changeset
4 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5 ; high-level Display Outputs
0
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
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
12 #include "hwos.inc" ; mandatory header
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
13 #include "shared_definitions.h" ; mailbox from/to p2_deco.c
582
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 "strings.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
17 #include "convert.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
18 #include "varargs.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
19 #include "math.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
20 #include "eeprom_rs232.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
21 #include "adc_lightsensor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
22 #include "surfmode.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
23 #include "divemode.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
24 #include "external_flash.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
25 #include "ghostwriter.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
26 #include "customview.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
27 #include "i2c.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
28 #include "colorschemes.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
29 #include "calibrate.inc"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
30 #include "gaslist.inc"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
31 #include "rx_ops.inc"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
32
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
33
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
34 ;---- external Functions -----------------------------------------------------
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
35
0
heinrichsweikamp
parents:
diff changeset
36 extern aa_wordprocessor
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
37 extern get_first_gas_to_WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
38
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
39
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
40 ;---- external Texts ---------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
41
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
42 extern tFirmware
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
43 extern tHardware
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
44 extern tSerial
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
45 extern tTotalDives
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
46 extern tBatteryV
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
47 extern tUptime
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
48 extern tPPO2MIN
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
49 extern tPPO2Max
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
50 extern tPPO2DECO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
51 extern tbar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
52
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
53 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
54 extern tPPO2MINCC
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
55 ENDIF
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
56
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
57 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
58 extern tFirmware_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
59 ENDIF
0
heinrichsweikamp
parents:
diff changeset
60
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
61 IFDEF _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
62 extern tCalX,tCalY,tCalZ
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
63 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
64
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
65
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
66 tft_out CODE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
67
0
heinrichsweikamp
parents:
diff changeset
68 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
69
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
70 global TFT_debug_output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
71 TFT_debug_output:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
72 ifndef _debug_output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
73 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
74 else
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
75 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
76 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
77
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
78 ; WIN_TINY .100,.30 ; surface mode: fits under the textual logo in the upper right corner
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
79 ; WIN_TINY .35, .0 ; dive mode: fits to the right side of the depth label
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
80 WIN_TINY .0, .0 ; dive mode: overwrites depth label
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
81 call TFT_standard_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
82 lfsr FSR2,buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
83
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
84 ; deco engine scheduling performance
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
85 MOVII int_O_profiling_overrun,mpr ; runtime +/- versus target
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
86 btfss mpr+1,7
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
87 bra TFT_debug_output_1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
88 bcf mpr+1,7
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
89 PUTC "-"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
90 bra TFT_debug_output_2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
91 TFT_debug_output_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
92 PUTC " "
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
93 TFT_debug_output_2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
94 output_16_3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
95 PUTC "."
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
96 MOVII int_O_profiling_overrun_max,mpr ; max runtime
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
97 output_16_3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
98 PUTC "."
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
99 movff char_O_profiling_overrun_phase,WREG ; calculation phase causing the max runtime
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
100 output_hex
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
101 PUTC "."
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
102 movff char_O_profiling_runs_norm,mpr ; runs/cycle normal plan
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
103 output_99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
104 PUTC "."
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
105 movff char_O_profiling_runs_alt,mpr ; runs/cycle alternative plan
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
106 output_99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
107 STRCAT_PRINT ""
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
108 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
109 endif
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
110
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
111
0
heinrichsweikamp
parents:
diff changeset
112 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
113
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
114 global TFT_divemask_color
0
heinrichsweikamp
parents:
diff changeset
115 TFT_divemask_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
116 movlw color_green
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
117 btfsc divemode ; in dive mode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
118 rcall TFT_divemask_color_dive
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
119 bra TFT_standard_color0
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
120
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
121 TFT_divemask_color_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
122 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
123 incf WREG
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
124 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
125 retlw color_scheme_divemode_mask1 ;0
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
126 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
127 retlw color_scheme_divemode_mask2 ;1
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
128 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
129 retlw color_scheme_divemode_mask3 ;2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
130 retlw color_scheme_divemode_mask4 ;3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
131
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
132
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
133 global TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
134 TFT_memo_color: ; information, values within normal range, things without a need to react upon
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
135 movlw color_white
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
136 bra TFT_standard_color0
605
5ce603c29750 gas color coding fixed
heinrichsweikamp
parents: 604
diff changeset
137 TFT_memo_color_dive:
5ce603c29750 gas color coding fixed
heinrichsweikamp
parents: 604
diff changeset
138 retlw color_white
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
139
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
140 global TFT_advice_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
141 TFT_advice_color: ; advices to do something, but without essential need to actually do it
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
142 movlw color_green
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
143 bra TFT_standard_color0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
144 TFT_advice_color_dive:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
145 retlw color_green
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
146
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
147 global TFT_attention_color ; important things to be aware of and things that are developing towards a warning
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
148 TFT_attention_color:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
149 movlw color_yellow
0
heinrichsweikamp
parents:
diff changeset
150 bra TFT_standard_color0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
151 TFT_attention_color_dive:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
152 retlw color_yellow
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
153
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
154 global TFT_warning_color ; important things with immediate need to react upon
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
155 TFT_warning_color:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
156 movlw color_red
0
heinrichsweikamp
parents:
diff changeset
157 bra TFT_standard_color0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
158 TFT_warnings_color_dive:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
159 retlw color_red
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
160
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
161
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
162 global TFT_disabled_color
0
heinrichsweikamp
parents:
diff changeset
163 TFT_disabled_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
164 movlw color_lightblue
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
165 btfsc divemode ; in dive mode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
166 rcall TFT_disabled_color_dive ; YES
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
167 bra TFT_standard_color0
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
168 TFT_disabled_color_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
169 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
170 incf WREG
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
171 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
172 retlw color_scheme_divemode_dis1 ; 0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
173 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
174 retlw color_scheme_divemode_dis2 ; 1
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
175 dcfsnz WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
176 retlw color_scheme_divemode_dis3 ; 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
177 retlw color_scheme_divemode_dis4 ; 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
178
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
179
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
180 global TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
181 TFT_standard_color:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
182 setf WREG ; default white
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
183 btfsc divemode ; in dive mode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
184 rcall TFT_standard_color_dive
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
185 ;bra TFT_standard_color0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
186 TFT_standard_color0:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
187 goto TFT_set_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
188
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
189
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
190 TFT_standard_color_dive:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
191 movff opt_dive_color_scheme,WREG ; 0-3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
192 incf WREG
0
heinrichsweikamp
parents:
diff changeset
193 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
194 retlw color_scheme_divemode_std1 ; 0
0
heinrichsweikamp
parents:
diff changeset
195 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
196 retlw color_scheme_divemode_std2 ; 1
0
heinrichsweikamp
parents:
diff changeset
197 dcfsnz WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
198 retlw color_scheme_divemode_std3 ; 2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
199 retlw color_scheme_divemode_std4 ; 3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
200
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
201
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
202 global TFT_color_code_tank_pres_sac
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
203 TFT_color_code_tank_pres_sac: ; color-code a tank pressure or SAC rate, data in hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
204 btfss hi,int_not_avail_flag ; is the not-available flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
205 bra TFT_color_code_tank_pres_1 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
206 bcf hi,int_not_avail_flag ; YES - clear not-available flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
207 TFT_color_code_tank_pres_0: ; entry point for outdated flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
208 bcf hi,int_outdated_flag ; clear outdated flag (it may be set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
209 bcf hi,int_warning_flag ; clear warning flag (it may be set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
210 bcf hi,int_attention_flag ; clear attention flag (it may be set)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
211 bra TFT_disabled_color ; set to disabled color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
212 TFT_color_code_tank_pres_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
213 btfsc hi,int_outdated_flag ; is the outdated flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
214 bra TFT_color_code_tank_pres_0 ; YES - handle alike with not-available flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
215 TFT_color_code_tank_pres_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
216 btfss hi,int_warning_flag ; is the warning flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
217 bra TFT_color_code_tank_pres_3 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
218 bcf hi,int_warning_flag ; YES - clear warning flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
219 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
220 bra TFT_warning_color ; - set to warning color and return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
221 TFT_color_code_tank_pres_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
222 btfss hi,int_attention_flag ; is the attention flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
223 bra TFT_memo_color ; NO - set to memo color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
224 bcf hi,int_attention_flag ; YES - clear attention flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
225 bra TFT_attention_color ; - set to attention color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
226
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
227
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
228 global TFT_color_code_gaslist
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
229 TFT_color_code_gaslist: ; color-code a gas (%O2 in hi) according to current absolute pressure
0
heinrichsweikamp
parents:
diff changeset
230 ; Check very high ppO2 manually
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
231 MOVII pressure_abs_10,xA
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
232 movff hi,xB+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
233 clrf xB+1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
234 call mult16x16 ; hi * absolute pressure / 10
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
235 ; Check if ppO2 > 6.55 bar
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
236 tstfsz xC+2 ; char_I_O2_ratio * absolute pressure / 10 > 65536, i.e. ppO2 > 6.55 bar ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
237 bra TFT_warning_color ; YES - warn in warning color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
238 ; Check if ppO2 > 3.30 bar
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
239 btfsc xC+1,7
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
240 bra TFT_warning_color ; YES - warn in warning color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
241 ; Check for low ppO2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
242 MOVII xC,sub_a
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
243 movff char_I_ppO2_min,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
244 mullw d'100' ; char_I_ppO2_min*100
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
245 MOVII PRODL,sub_b
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
246 call cmpU16 ; compare (sub_a - sub_b)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
247 btfsc neg_flag ; lower than ppO2 min?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
248 bra TFT_warning_color ; YES - set warning color and return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
249 ; Check for high ppO2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
250 movff char_O_deco_info,WREG ; bank-safe copy of deco info vector
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
251 btfsc WREG,deco_mode ; are we in deco?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
252 bra TFT_color_code_gaslist_deco ; YES - check against ppO2 max deco only
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
253 ; NO - check against ppO2 max travel/normal and deco
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
254 ; Check for ppO2 max travel/normal
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
255 movff char_I_ppO2_max_work,WREG ; ppo2 max during working phase
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
256 mullw d'100' ; char_I_ppO2_max_work*100
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
257 ADDLI ppO2_margin_on_max,PROD ; add ppO2 margin on max value to compensate for surface pressures > 1000 hPa
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
258 MOVII PRODL,sub_b ; copy result to sub_b
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
259 call cmpU16 ; compare (sub_a - sub_b)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
260 btfss neg_flag ; higher than ppO2 max travel/deco?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
261 rcall TFT_attention_color ; YES - set attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
262 ; Check for ppO2 max deco
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
263 TFT_color_code_gaslist_deco:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
264 movff char_I_ppO2_max_deco,WREG ; ppo2 max for deco
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
265 mullw d'100' ; char_I_ppO2_max_deco * 100
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
266 ADDLI ppO2_margin_on_max,PROD ; add ppO2 margin on max value to compensate for surface pressures > 1000 hPa
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
267 MOVII PRODL,sub_b ; copy result to sub_b
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
268 call cmpU16 ; compare (sub_a - sub_b)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
269 btfss neg_flag ; higher than ppO2 max deco?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
270 bra TFT_warning_color ; YES - set warning color and return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
271 return ; NO - keep current color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
272
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
273
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
274 TFT_color_code_ceiling: ; color-code the ceiling depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
275 btfsc hi,char_invalid_flag ; is the invalid flag set? (bit 7 here)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
276 bra TFT_color_code_ceiling_1 ; YES - set disabled color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
277 MOVII pressure_rel_cur_cached,sub_a; NO - get current pressure to sub_a
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
278 MOVII mpr,sub_b ; - get ceiling to sub_b
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
279 call cmpU16 ; - sub_a - sub_b = relative pressure [mbar] - int_O_ceiling [mbar]
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
280 btfss neg_flag ; - is current depth < ceiling (too shallow) ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
281 bra TFT_memo_color ; NO - set to memo color and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
282 movff char_O_deco_warnings,WREG ; YES - bank-safe copy of deco warnings
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
283 btfsc WREG,outside_warning ; - are we currently outside of the ZH-L16 model?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
284 bra TFT_warning_color ; YES - set to warnings color and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
285 bra TFT_attention_color ; NO - set to attention color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
286 TFT_color_code_ceiling_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
287 bcf hi,char_invalid_flag ; clear the invalid flag (bit 7 here)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
288 bra TFT_disabled_color ; set to disabled color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
289
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
290
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
291 TFT_color_code_stop: ; color-code the stop depth: memo color if below stop depth,
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
292 ; attention color if above stop but below ceiling,
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
293 ; warning color if above stop and ceiling
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
294 ; (ceiling depth is calculated using current GF)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
295 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
296 btfsc WREG,char_invalid_flag ; is the invalid flag set?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
297 bra TFT_disabled_color ; YES - set to disabled color and return
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
298 movff char_O_deco_depth+0,WREG ; NO - get depth of first stop in meters into WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
299 subwf depth_meter,W ; - compute current depth - stop depth
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
300 btfsc STATUS,C ; - result negative?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
301 bra TFT_color_code_stop_1 ; NO - not shallower than stop depth, check for ascent advice
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
302 MOVII int_O_ceiling,sub_b ; YES - get ceiling depth in mbar
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
303 btfsc sub_b+1,char_invalid_flag ; - is the invalid flag set? (bit 7 here)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
304 bra TFT_warning_color ; YES - set to warning color and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
305 MOVII pressure_rel_cur_cached,sub_a; NO - get current pressure
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
306 call cmpU16 ; - sub_a - sub_b = relative pressure - int_O_ceiling
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
307 btfsc neg_flag ; - is ceiling > current depth?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
308 bra TFT_warning_color ; YES - set to warning color and return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
309 bra TFT_attention_color ; NO - set to attention color and return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
310 TFT_color_code_stop_1:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
311 movff char_O_deco_depth+0,WREG ; get depth of first stop in meters into WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
312 incf WREG,W ; compute stop depth + 1 meter
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
313 subwf depth_meter,W ; compute current depth - (first stop depth + 1 meter)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
314 btfss STATUS,C ; result negative?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
315 bra TFT_memo_color ; YES - within 1 meter of stop depth, use memo color
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
316 btfss deco_region ; NO - within deco stops region?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
317 bra TFT_memo_color ; NO - use memo color
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
318 bsf win_invert ; YES - give ascent advice, ...
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
319 bra TFT_advice_color ; - ... and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
320
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
321
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
322 TFT_color_code_depth:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
323 TSTOSS opt_modwarning ; MOD warning switched on?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
324 bra TFT_color_code_depth_no_mod ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
325 btfsc depth_limit_exceeded ; YES - deeper than depth limit?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
326 bra TFT_color_code_depth_warn ; YES - set to warning color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
327 bra TFT_color_code_depth_mod ; NO - check depth against MOD and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
328 TFT_color_code_depth_no_mod:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
329 btfsc depth_limit_exceeded ; NO - deeper than depth limit?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
330 bra TFT_warning_color ; YES - set to warning color and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
331 bra TFT_memo_color ; NO - set to memo color and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
332 TFT_color_code_depth_mod:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
333 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
334 movff opt_dive_mode,WREG ; get deco mode: 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
335 decfsz WREG,F ; in CCR mode?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
336 bra TFT_color_code_depth_no_ccr ; NO - continue checking for ppO2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
337 btfss bailout_mode ; YES - check if in bailout
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
338 bra TFT_color_code_depth_outside; NO - continue checking for outside ZHL16 model
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
339 ENDIF
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
340 TFT_color_code_depth_no_ccr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
341 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
342 btfsc WREG,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
343 bra TFT_color_code_depth_warn ; YES - animate in warning design
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
344 TFT_color_code_depth_outside:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
345 movff char_O_deco_warnings,WREG ; bank-safe copy of deco warnings
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
346 btfsc WREG,outside_warning ; are we currently outside of the ZH-L16 model?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
347 bra TFT_color_code_depth_warn ; YES - activate depth warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
348 bcf depth_warning ; NO - terminate depth warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
349 btfsc WREG,outside_attention ; - are we near to outside of the ZH-L16 model?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
350 bra TFT_color_code_depth_att ; YES - activate depth attention
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
351 bcf depth_attention ; NO - terminate depth attention
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
352 bra TFT_memo_color ; - select memo color and return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
353 TFT_color_code_depth_warn:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
354 bsf depth_warning ; activate depth warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
355 bra TFT_warning_color ; select warning color and return...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
356 TFT_color_code_depth_att:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
357 bsf depth_attention ; activate depth attention
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
358 bra TFT_attention_color ; select attention color and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
359
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
360
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
361 global TFT_color_code_cns
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
362 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
363 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
364 bra TFT_color_code_cns_1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
365 bcf hi,int_invalid_flag ; YES - clear invalid flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
366 bcf hi,int_warning_flag ; clear warning flag (it may be set)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
367 bcf hi,int_attention_flag ; clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
368 bra TFT_disabled_color ; set to disabled color and return
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
369 TFT_color_code_cns_1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
370 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
371 bra TFT_color_code_cns_2 ; NO
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
372 bcf hi,int_warning_flag ; YES - clear warning flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
373 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
374 bra TFT_warning_color ; - set to warning color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
375 TFT_color_code_cns_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
376 btfss hi,int_attention_flag ; is the attention flag set?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
377 bra TFT_memo_color ; NO - set to memo color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
378 bcf hi,int_attention_flag ; YES - clear attention flag
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
379 bra TFT_attention_color ; - set to attention color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
380
0
heinrichsweikamp
parents:
diff changeset
381
heinrichsweikamp
parents:
diff changeset
382 TFT_color_code_gf:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
383 ; with int_O_lead_supersat, the upper byte is solely used for the flags
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
384 ; 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
385 btfsc hi,int_invalid_flag ; is the invalid flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
386 bra TFT_disabled_color ; YES - set to disabled color and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
387 btfsc hi,int_warning_flag ; NO - is the warning flag set?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
388 bra TFT_warning_color ; YES - set to warning color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
389 btfsc hi,int_attention_flag ; NO - is the attention flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
390 bra TFT_attention_color ; YES - set to attention color and return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
391 bra TFT_memo_color ; NO - set to memo color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
392
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
393
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
394 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
395 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
396 bra TFT_color_code_ppo2_1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
397 bcf hi,int_warning_flag ; YES - clear warning flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
398 bcf hi,int_attention_flag ; clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
399 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
400 bcf hi,int_low_flag ; clear low warning flag (it may be set)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
401 bra TFT_warning_color ; warn in warning color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
402 TFT_color_code_ppo2_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
403 btfss hi,int_attention_flag ; is the attention flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
404 bra TFT_color_code_ppo2_2 ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
405 bcf hi,int_attention_flag ; YES - clear attention flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
406 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
407 bcf hi,int_low_flag ; clear low warning flag (it may be set)
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
408 bra TFT_attention_color ; set to attention color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
409 TFT_color_code_ppo2_2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
410 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
411 bcf hi,int_low_flag ; clear low warning flag (it may be set)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
412 bra TFT_memo_color ; set to memo color and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
413
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
414 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
415
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
416 IFDEF _ccr_pscr
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
417
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
418 TFT_color_code_ppo2_hud: ; color-code ppO2 values (ppO2 in --:lo [cbar]) by its value
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
419 movff char_O_deco_info,WREG ; get the deco info vector
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
420 btfss WREG,deco_mode ; are we in deco?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
421 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
422 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
423 bra TFT_color_code_ppo2_hud_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
424 TFT_color_code_ppo2_hud_a:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
425 movff char_I_ppO2_max_work,WREG ; ppO2 max while in working phase
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
426 TFT_color_code_ppo2_hud_b:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
427 cpfsgt lo ; lo > threshold?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
428 bra TFT_color_code_ppo2_hud1 ; NO - continue with checking for ppO2 low
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
429 bra TFT_warning_color ; YES - set warning color and return
0
heinrichsweikamp
parents:
diff changeset
430 TFT_color_code_ppo2_hud1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
431 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
432 decfsz WREG,F ; now: 0=CC, 1=Gauge, 2=Apnea, 3=PSCR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
433 bra TFT_color_code_ppo2_hud_nocc; not CCR...
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
434 btfsc bailout_mode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
435 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
436 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
437 bra TFT_color_code_ppo2_hud_cont
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
438 TFT_color_code_ppo2_hud_nocc:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
439 movff char_I_ppO2_min,WREG ; PPO2 min for all other modes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
440 TFT_color_code_ppo2_hud_cont:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
441 cpfslt lo ; lo < char_I_ppO2_min?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
442 bra TFT_memo_color ; NO - set memo color and return...
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
443 bra TFT_warning_color ; Yes - set warning color and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
444
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
445 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
446
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
447 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
448
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
449 TFT_color_code_battery: ; color-code the battery display, with battery percent in lo
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
450 movlw battery_warn_level_36+1 ; get threshold for 3.6 Volt battery warning, incremented by 1
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
451 btfss battery_is_36v ; actually a 3.6 Volt battery detected?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
452 movlw battery_warn_level_15+1 ; NO - replace with 1.5 Volt battery warning, incremented by 1
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
453 cpfsgt batt_percent ; is battery percent < threshold?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
454 bra TFT_warning_color ; YES - set to warning color and return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
455 bra TFT_memo_color ; NO - set to memo color and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
456
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
457
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
458 global TFT_color_code_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
459 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
460 movwf up ; copy gas number (1-6) to up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
461 movlw color_white ; Default color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
462 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
463 movlw color_white ; color for gas 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
464 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
465 movlw color_green ; color for gas 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
466 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
467 movlw color_red ; color for gas 3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
468 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
469 movlw color_yellow ; color for gas 4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
470 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
471 movlw color_cyan ; color for gas 5
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
472 dcfsnz up,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
473 movlw color_pink ; color for gas 6
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
474 goto TFT_set_color ; set color...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
475
0
heinrichsweikamp
parents:
diff changeset
476
heinrichsweikamp
parents:
diff changeset
477 ; ****************************************************************************
heinrichsweikamp
parents:
diff changeset
478
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
479 global TFT_show_OC_startgas_surface
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
480 TFT_show_OC_startgas_surface: ; show first gas and "OSTC2-like" active gases
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
481 ; Show first gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
482 WIN_SMALL surf_decotype_column+.1,surf_decotype_row+.30
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
483 call get_first_gas_to_WREG ; get first gas (1-5) into WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
484 decf WREG,W ; 1-5 -> 0-4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
485 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
486 call gaslist_strcat_gas ; input: PRODL : gas number (0..4), Output: Text appended into buffer pointed by FSR2.
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
487 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
488 ; Show boxes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
489 WIN_TOP surf_decotype_row+.30+.25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
490 WIN_LEFT surf_decotype_boxes_left1+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
491 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
492 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
493 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
494 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
495 STRCPY_PRINT "1"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
496 decfsz hi,F ; Type = 1 (First)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
497 bra DISP_active_gas_surfmode3 ; NO - skip box
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
498 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
499 DISP_active_gas_surfmode3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
500 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
501 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
502 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
503 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
504 WIN_LEFT surf_decotype_boxes_left2+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
505 STRCPY_PRINT "2"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
506 decfsz hi,F ; Type = 1 (First)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
507 bra DISP_active_gas_surfmode4 ; NO - skip box
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
508 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
509 DISP_active_gas_surfmode4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
510 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
511 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
512 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
513 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
514 WIN_LEFT surf_decotype_boxes_left3+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
515 STRCPY_PRINT "3"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
516 decfsz hi,F ; Type = 1 (First)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
517 bra DISP_active_gas_surfmode5 ; NO - skip box
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
518 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
519 DISP_active_gas_surfmode5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
520 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
521 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
522 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
523 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
524 WIN_LEFT surf_decotype_boxes_left4+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
525 STRCPY_PRINT "4"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
526 decfsz hi,F ; Type = 1 (First)?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
527 bra DISP_active_gas_surfmode6 ; NO - skip box
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
528 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
529 DISP_active_gas_surfmode6:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
530 rcall TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
531 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
532 tstfsz hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
533 rcall TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
534 WIN_LEFT surf_decotype_boxes_left5+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
535 STRCPY_PRINT "5"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
536 rcall TFT_standard_color ; reset color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
537 decfsz hi,F ; type = 1 (First)?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
538 bra DISP_active_gas_surfmode7 ; NO - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
539 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left5, surf_decotype_boxes_left5+.8 ;top, bottom, left, right
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
540 DISP_active_gas_surfmode7:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
541 return ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
542
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
543
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
544 global TFT_show_color_schemes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
545 TFT_show_color_schemes: ; update the color schemes
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
546 bsf divemode ; switch to dive mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
547 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
548 WIN_TINY .12,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
549 STRCAT_TEXT_PRINT tDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
550 WIN_TINY .62,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
551 STRCAT_TEXT_PRINT tMaxDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
552 WIN_TINY .122,.40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
553 STRCAT_TEXT_PRINT tDivetime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
554
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
555 ; Show some demo screen
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
556
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
557 ; Depth demo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
558 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
559 WIN_MEDIUM .3,.54
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
560 MOVLI .5172,mpr
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
561 bsf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
562 bsf ignore_digit4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
563 output_16 ; full meters in big font
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
564 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
565 STRCAT_PRINT "" ; display full meters
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
566 WIN_SMALL .25,.66
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
567 MOVLI .5172,mpr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
568 PUTC "."
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
569 movlw d'4'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
570 movwf ignore_digits
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
571 bsf ignore_digit5 ; (flag will be cleared by output_16)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
572 output_16dp d'0' ; .1m in SMALL font
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
573 STRCAT_PRINT "" ; display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
574
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
575 ; Max. Depth demo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
576 WIN_MEDIUM .64,.54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
577 bsf ignore_digit4 ; no 0.1m
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
578 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
579 MOVLI .6349,mpr
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
580 output_16
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
581 STRCAT_PRINT "" ; display full meters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
582 bcf leftbind
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
583 ; .1m in SMALL font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
584 WIN_SMALL .87,.66
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
585 PUTC "."
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
586 movlw d'4'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
587 movwf ignore_digits
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
588 bsf ignore_digit5 ; (flag will be cleared by output_16)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
589 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
590 MOVLI .6349,mpr
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
591 output_16dp d'0'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
592 STRCAT_PRINT "" ; display decimeters
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
593 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
594
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
595 ; Divetime demo
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
596 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
597 movff rtc_latched_mins,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
598 clrf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
599 WIN_MEDIUM .103, .54
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
600 output_16_3 ; limit to 999 and display only (0-999)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
601 STRCAT_PRINT "" ; show minutes in large font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
602 WIN_SMALL .139, .66 ; left position for two sec figures
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
603 PUTC ':'
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
604 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
605 movff rtc_latched_secs,lo
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
606 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
607 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
608 STRCAT_PRINT "" ; show seconds in small font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
609
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
610 bcf divemode ; terminate dive mode again
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
611 return
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
612
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
613
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
614 global TFT_show_divemode_mask
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
615 TFT_show_divemode_mask: ; display mask in dive mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
616 call TFT_divemask_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
617
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
618 ; depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
619 WIN_TINY dm_mask_depth_column,dm_mask_depth_row ; position for "Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
620 btfss alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
621 bra TFT_divemode_mask_depth_text ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
622 WIN_TINY dm_mask_depth_column_alt,dm_mask_depth_row ; YES - alternative position for "Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
623 TFT_divemode_mask_depth_text:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
624 STRCAT_TEXT_PRINT tDepth ; print "Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
625
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
626 ; avg or max depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
627 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
628 bra TFT_divemode_mask_avg_max_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
629
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
630 WIN_TINY dm_mask_maxdepth_col_nvsi,dm_mask_maxdepth_row ; default position for "max.Depth"/"avg.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
631 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
632 bra TFT_divemode_mask_max_avg_pos ; NO - keep position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
633 WIN_TINY dm_mask_maxdepth_col,dm_mask_maxdepth_row ; YES - adopt position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
634 TFT_divemode_mask_max_avg_pos:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
635 btfsc FLAG_apnoe_mode ; in apnea mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
636 bra TFT_divemode_mask_max_text ; YES - always draw max depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
637 TSTOSS opt_2ndDepthDisp ; NO - shall draw avg depth instead of max depth?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
638 bra TFT_divemode_mask_max_text ; NO - print "max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
639 STRCAT_TEXT_PRINT tAvgDepth ; YES - print "avg.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
640 bra TFT_divemode_mask_time_pos ; - continue with dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
641 TFT_divemode_mask_max_text:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
642 STRCAT_TEXT_PRINT tMaxDepth ; print "max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
643 bra TFT_divemode_mask_time_pos ; continue with dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
644 TFT_divemode_mask_avg_max_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
645 btfss FLAG_gauge_mode ; in gauge mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
646 bra TFT_divemode_mask_time_pos ; NO - continue with dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
647 WIN_TINY dm_gauge_max_depth_text_col,dm_gauge_max_depth_text_row ; YES - set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
648 STRCAT_TEXT_PRINT tMaxDepth ; - print "max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
649 WIN_TINY dm_gauge_avg_depth_text_col,dm_gauge_avg_depth_text_row ; - set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
650 STRCAT_TEXT_PRINT tDiveTotalAvg ; - print "Total Avg"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
651 ;bra TFT_divemode_mask_time_pos ; - continue with dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
652
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
653 ; dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
654 TFT_divemode_mask_time_pos:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
655 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row ; position for "Divetime"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
656 TFT_divemode_mask_time_text:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
657 STRCAT_TEXT_PRINT tDivetime ; print "Divetime"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
658 btfss FLAG_apnoe_mode ; in apnea mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
659 bra TFT_standard_color ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
660 WIN_TINY dm_total_apnoe_text_col,dm_total_apnoe_text_row; YES - set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
661 STRCPY_TEXT_PRINT tApnoeTotal ; - print "Total"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
662 bra TFT_standard_color ; - done
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
663
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
664 ;=========================================================================
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
665
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
666 global TFT_velocity_show
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
667 TFT_velocity_show:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
668 rcall TFT_memo_color ; set default color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
669 btfsc neg_flag_velocity ; descending?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
670 rcall TFT_velocity_set_color ; NO - set color for text dependent on speed and set threshold for VSI graph
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
671 rcall TFT_velocity_num ; show the numerical VSI
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
672 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
673 bra TFT_standard_color ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
674 btfsc neg_flag_velocity ; YES - in ascent?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
675 bra TFT_velocity_graph_show ; YES - show the graph
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
676 bra TFT_velocity_graph_clear_1 ; NO - clear the graph
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
677
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
678 TFT_speed_table:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
679 ; use a depth-dependent ascent rate warning
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
680 ; depth(ft): <20 >20 >40 >60 >75 >88 >101 >115 >128 >144 >164
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
681 ; 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
682 ; depth(m): <=6 >6 >12 >18 >23 >27 >31 >35 >39 >44 >50
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
683 ; 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
684 ; 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
685
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
686 ; < depth (m), warning speed, attention speed, unused
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
687 DB .6,.7,.5,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
688 DB .12,.8,.6,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
689 DB .18,.9,.7,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
690 DB .23,.10,.8,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
691 DB .27,.11,.8,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
692 DB .31,.13,.10,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
693 DB .35,.15,.12,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
694 DB .39,.17,.13,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
695 DB .44,.18,.14,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
696 DB .50,.19,.15,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
697 DB .200,.20,.15,.0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
698
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
699 TFT_velocity_set_color: ; set color based on speed table or use static thresholds, with divA+0 = m/min
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
700 bsf aux_flag ; for alternative layout: default is to show numerical VSI
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
701 ; check if old/new ascend logic is used
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
702 TSTOSS opt_vsitextv2 ; 0=standard, 1=dynamic
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
703 bra TFT_velocity_set_color_static ; static ascend rate limit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
704
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
705 ; point to speed table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
706 movlw LOW (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
707 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
708 movlw HIGH (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
709 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
710 movlw UPPER (TFT_speed_table-.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
711 movwf TBLPTRU
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
712
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
713 TFT_velocity_set_color_next:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
714 TBLRD*+ ; 3 dummy reads
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
715 TBLRD*+
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
716 TBLRD*+
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
717 TBLRD*+ ; get speed threshold
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
718 movf depth_meter,W ; current depth in m
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
719 cpfsgt TABLAT ; threshold > current depth ?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
720 bra TFT_velocity_set_color_next ; NO - try next
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
721
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
722 TBLRD*+ ; get warning speed threshold
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
723 movf TABLAT,W ; ...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
724 movwf divA+1 ; copy for graph routine
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
725 cpfslt divA+0 ; actual vertical speed smaller than warning threshold?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
726 bra TFT_warning_color ; NO - set warning color (and return)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
727 TBLRD*+ ; get attention speed threshold
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
728 movf TABLAT,W ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
729 cpfslt divA+0 ; actual vertical speed smaller than attention threshold?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
730 bra TFT_attention_color ; NO - set attention color and return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
731 bcf aux_flag ; YES - don't show in alternative layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
732 bra TFT_memo_color ; - set memo color and return
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
733
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
734 TFT_velocity_set_color_static:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
735 movlw color_code_velocity_warn_high ; threshold for warning in m/min
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
736 movwf divA+1 ; copy for graph routine
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
737 cpfslt divA+0 ; actual vertical speed smaller than warning threshold?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
738 bra TFT_warning_color ; NO - set warning color (and return)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
739 movlw color_code_velocity_attn_high ; threshold for attention in m/min
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
740 cpfslt divA+0 ; actual vertical speed smaller than attention threshold?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
741 bra TFT_attention_color ; NO - set attention color and return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
742 bcf aux_flag ; YES - don't show in alternative layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
743 bra TFT_memo_color ; - set memo color and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
744
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
745 TFT_velocity_num:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
746 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
747 bra TFT_velocity_num_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
748 ; NO - set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
749 WIN_SMALL dm_velocity_text_col_norm, dm_velocity_text_row_norm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
750 TFT_velocity_num_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
751 bsf velocity_active_num ; set numerical velocity as shown
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
752 TSTOSS opt_units ; - 0=meter, 1=feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
753 bra TFT_velocity_num_metric ; 0 - meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
754 ;bra TFT_velocity_num_imperial ; 1 - feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
755
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
756 TFT_velocity_num_imperial:
0
heinrichsweikamp
parents:
diff changeset
757 movff divA+0,WREG ; divA+0 = m/min
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
758 mullw .100 ; PROD = mbar/min
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
759 MOVII PRODL,mpr ; copy to hi:lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
760 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
761 tstfsz hi ; > 255 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
762 setf lo ; YES - set lo to 255
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
763 movlw '-' ; load coding for minus sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
764 btfsc neg_flag_velocity ; ascending?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
765 movlw '+' ; YES - replace with coding for plus sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
766 movwf POSTINC2 ; put sign into output buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
767 output_99 ; print rate
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
768 STRCAT_TEXT tVelImperial ; print unit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
769 bra TFT_velocity_num_finish ; do finishing tasks
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
770
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
771 TFT_velocity_num_metric:
0
heinrichsweikamp
parents:
diff changeset
772 movff divA+0,lo ; divA+0 = m/min
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
773 movlw '-' ; load coding for minus sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
774 btfsc neg_flag_velocity ; ascending?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
775 movlw '+' ; YES - replace with coding for plus sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
776 movwf POSTINC2 ; put sign into output buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
777 output_99 ; print rate
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
778 STRCAT_TEXT tVelMetric ; print unit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
779 ;bra TFT_velocity_num_finish ; do finishing tasks
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
780
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
781 TFT_velocity_num_finish:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
782 btfss alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
783 bra TFT_velocity_num_finish_1 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
784 movlw "'" ; load encoding of minute sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
785 movff WREG,buffer+4 ; put it after m (meter) / f (feet)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
786 clrf WREG ; load string terminator
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
787 movff WREG,buffer+5 ; terminate string after minute sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
788 TFT_velocity_num_finish_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
789 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
790 bcf win_invert ; end inverse printing
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
791 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
792
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
793 TFT_velocity_num_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
794 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
795 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
796 btfss neg_flag_velocity ; NO - in ascent?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
797 bcf aux_flag ; NO - clear aux flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
798 btfsc aux_flag ; - above attention or warning threshold?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
799 bsf win_invert ; YES - print inverse
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
800 ; - set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
801 WIN_SMALL dm_velocity_text_col_alt, dm_velocity_text_row_alt
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
802 bra TFT_velocity_num_com ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
803
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
804
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
805 TFT_velocity_graph_show: ; with speed in divA+0 (m/min)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
806 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
807 bra TFT_standard_color ; YES - done (not implemented)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
808
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
809 btfsc velocity_active_vsi ; was the graphical VSI shown before?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
810 bra TFT_velocity_graph_1 ; YES - no need to redraw the framework box
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
811 bsf velocity_active_vsi ; NO - remember it is shown as of now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
812 ; - draw the framework box
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
813 rcall TFT_divemask_color_dive ; - color -> WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
814 WIN_FRAME_COLOR dm_velocity_graph_top+.00, dm_velocity_graph_bot-.00, dm_velocity_graph_lft, dm_velocity_graph_rgt
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
815 rcall TFT_divemask_color_dive ; - color -> WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
816 WIN_FRAME_COLOR dm_velocity_graph_top+.10, dm_velocity_graph_bot-.10, dm_velocity_graph_lft, dm_velocity_graph_rgt
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
817 rcall TFT_divemask_color_dive ; - color -> WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
818 WIN_FRAME_COLOR dm_velocity_graph_top+.20, dm_velocity_graph_bot-.20, dm_velocity_graph_lft, dm_velocity_graph_rgt
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
819 rcall TFT_divemask_color_dive ; - color -> WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
820 WIN_FRAME_COLOR dm_velocity_graph_top+.30, dm_velocity_graph_bot-.30, dm_velocity_graph_lft, dm_velocity_graph_rgt
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
821
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
822 TFT_velocity_graph_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
823 movff divA+0,hi ; copy ascend speed (in m/min) to hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
824 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
825 clrf xA+1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
826 MOVLI .5,xB ; threshold for color warning (5 color normal + 2 color warning)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
827 call div16x16 ; xC = xA / xB with xA as remainder
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
828 ; xC+0 holds step size in m/min (e.g. =3 for 15m/min warning threshold)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
829 movff hi,xA+0 ; velocity in m/min
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
830 clrf xA+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
831 movff xC+0,xB+0 ; step size
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
832 clrf xB+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
833 call div16x16 ; xC = xA / xB with xA as remainder
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
834
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
835 movff xC+0,lo ; copy amount of segments to show to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
836 incf lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
837 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
838 bra DISP_graph_vel_0_fill
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
839 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
840 bra DISP_graph_vel_1_fill
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
841 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
842 bra DISP_graph_vel_2_fill
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
843 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
844 bra DISP_graph_vel_3_fill
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
845 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
846 bra DISP_graph_vel_4_fill
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
847 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
848 bra DISP_graph_vel_5_fill
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
849 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
850 bra DISP_graph_vel_6_fill
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
851 ;bra DISP_graph_vel_7_fill
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
852
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
853 DISP_graph_vel_7_fill:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
854 rcall TFT_warnings_color_dive ; color -> WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
855 WIN_BOX_COLOR dm_velocity_graph_top+.2, dm_velocity_graph_top+.8, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
856 DISP_graph_vel_6_fill:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
857 rcall TFT_warnings_color_dive ; color -> WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
858 WIN_BOX_COLOR dm_velocity_graph_top+.12, dm_velocity_graph_top+.18, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
859 DISP_graph_vel_5_fill:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
860 rcall TFT_attention_color_dive ; color -> WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
861 WIN_BOX_COLOR dm_velocity_graph_top+.22, dm_velocity_graph_top+.28, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
862 DISP_graph_vel_4_fill:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
863 rcall TFT_standard_color_dive ; color -> WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
864 WIN_BOX_COLOR dm_velocity_graph_top+.32, dm_velocity_graph_top+.38, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
865 DISP_graph_vel_3_fill:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
866 rcall TFT_standard_color_dive ; color -> WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
867 WIN_BOX_COLOR dm_velocity_graph_top+.42, dm_velocity_graph_top+.48, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
868 DISP_graph_vel_2_fill:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
869 rcall TFT_standard_color_dive ; color -> WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
870 WIN_BOX_COLOR dm_velocity_graph_top+.52, dm_velocity_graph_top+.58, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
871 DISP_graph_vel_1_fill:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
872 rcall TFT_standard_color_dive ; color -> WREG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
873 WIN_BOX_COLOR dm_velocity_graph_top+.62, dm_velocity_graph_top+.68, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
874 DISP_graph_vel_0_fill:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
875
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
876 movff xC+0,lo ; copy amount of segments to show to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
877 incf lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
878 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
879 bra DISP_graph_vel_0_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
880 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
881 bra DISP_graph_vel_1_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
882 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
883 bra DISP_graph_vel_2_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
884 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
885 bra DISP_graph_vel_3_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
886 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
887 bra DISP_graph_vel_4_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
888 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
889 bra DISP_graph_vel_5_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
890 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
891 bra DISP_graph_vel_6_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
892 bra DISP_graph_vel_7_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
893
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
894 DISP_graph_vel_0_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
895 WIN_BOX_BLACK dm_velocity_graph_top+.62, dm_velocity_graph_top+.68, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
896 DISP_graph_vel_1_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
897 WIN_BOX_BLACK dm_velocity_graph_top+.52, dm_velocity_graph_top+.58, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
898 DISP_graph_vel_2_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
899 WIN_BOX_BLACK dm_velocity_graph_top+.42, dm_velocity_graph_top+.48, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
900 DISP_graph_vel_3_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
901 WIN_BOX_BLACK dm_velocity_graph_top+.32, dm_velocity_graph_top+.38, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
902 DISP_graph_vel_4_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
903 WIN_BOX_BLACK dm_velocity_graph_top+.22, dm_velocity_graph_top+.28, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
904 DISP_graph_vel_5_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
905 WIN_BOX_BLACK dm_velocity_graph_top+.12, dm_velocity_graph_top+.18, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
906 DISP_graph_vel_6_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
907 WIN_BOX_BLACK dm_velocity_graph_top+.2, dm_velocity_graph_top+.8, dm_velocity_graph_lft+.2, dm_velocity_graph_rgt-.2 ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
908 DISP_graph_vel_7_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
909 bra TFT_standard_color ; done
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
910
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
911
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
912 global TFT_velocity_clear
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
913 TFT_velocity_clear:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
914 btfss velocity_active_num ; was the numerical VSI shown in last cycle?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
915 bra TFT_velocity_clear_graph ; NO - no need to clear it, continue with graphical VSI
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
916 TFT_velocity_clear_num_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
917 bcf velocity_active_num ; YES - clear flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
918 btfsc alt_layout_active ; - in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
919 bra TFT_velocity_clear_num_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
920 ;bra TFT_velocity_clear_num_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
921
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
922 TFT_velocity_clear_num_norm: ; clear normal numerical area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
923 WIN_BOX_BLACK dm_velocity_text_row_norm, dm_velocity_text_bot_norm, dm_velocity_text_col_norm, dm_velocity_text_rgt_norm ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
924 bra TFT_velocity_clear_graph ; continue with graphical VSI
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
925
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
926 TFT_velocity_clear_num_alt: ; clear alternative numerical area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
927 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
928 bra TFT_velocity_clear_graph ; YES - skip
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
929 ; NO - clear area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
930 WIN_BOX_BLACK dm_velocity_text_row_alt, dm_velocity_text_bot_alt, dm_velocity_text_col_alt, dm_velocity_text_rgt_alt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
931 ;bra TFT_velocity_clear_graph ; continue with graphical VSI
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
932
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
933 TFT_velocity_clear_graph:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
934 btfss velocity_active_vsi ; was the graphical VSI shown in last cycle?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
935 bra TFT_standard_color ; NO - no need to clear it, done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
936 TFT_velocity_graph_clear_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
937 bcf velocity_active_vsi ; YES - clear flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
938 btfsc alt_layout_active ; - in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
939 bra TFT_standard_color ; YES - not implemented
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
940 ;bra TFT_velocity_clear_graph_alt ; YES - code provision for future implementation
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
941 ;bra TFT_velocity_clear_graph_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
942
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
943 TFT_velocity_clear_graph_norm ; clear normal graph area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
944 WIN_BOX_BLACK dm_velocity_graph_top, dm_velocity_graph_bot, dm_velocity_graph_lft, dm_velocity_graph_rgt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
945 bra TFT_standard_color ; done
0
heinrichsweikamp
parents:
diff changeset
946
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
947 ;=========================================================================
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
948
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
949 global TFT_clear_divemode_menu
0
heinrichsweikamp
parents:
diff changeset
950 TFT_clear_divemode_menu:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
951 WIN_BOX_BLACK dm_menu_row-.2, dm_menu_lower, dm_menu_left, dm_menu_right ; top, bottom, left, right - starts 2 pixel higher to completely wipe away the temperature display
0
heinrichsweikamp
parents:
diff changeset
952 return
heinrichsweikamp
parents:
diff changeset
953
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
954
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
955 global TFT_clear_deco_data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
956 TFT_clear_deco_data:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
957 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
958 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
959 ; NO - clear deco data area (alternative stop depth makes upper-left most corner)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
960 WIN_BOX_BLACK dm_decostop_row_alt_depth, dm_3rdrow_bot, dm_decostop_col_alt_depth, dm_3rdrow_rgt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
961 return ; - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
962
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
963
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
964 global TFT_show_ndl_mask
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
965 TFT_show_ndl_mask:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
966 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
967 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
968 call TFT_divemask_color ; NO - set text color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
969 ; - set position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
970 WIN_STD dm_ndl_text_column, dm_ndl_text_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
971 STRCPY_TEXT_PRINT tNDL ; - print "NDL"
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
972 btfss deco_region ; - was the dive within deco stops region?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
973 bra TFT_standard_color ; NO - done
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
974 btfsc safety_stop_active ; YES - safety stop shown?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
975 bra TFT_standard_color ; YES - done
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
976 TFT_show_slow_reminder:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
977 call TFT_attention_color ; NO - set color
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
978 ; - set position
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
979 WIN_STD dm_safetystop_text_column+.5,dm_safetystop_text_row+.5
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
980 STRCPY_TEXT tSlow ; - print "SLOW" reminder
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
981 STRCAT_PRINT 0x94 ; - append an up-arrow
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
982 bra TFT_standard_color ; - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
983
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
984
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
985 global TFT_show_tts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
986 TFT_show_tts:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
987 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
988 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
989 call TFT_memo_color ; NO - default to memo color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
990 MOVII int_O_TTS_norm,mpr ; - get the TTS
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
991 btfsc hi,int_invalid_flag ; - is the invalid flag set?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
992 call TFT_disabled_color ; YES - use disabled color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
993 bcf hi,int_invalid_flag ; - eventually clear the invalid flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
994 btfss alt_layout_active ; - in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
995 bra TFT_display_tts_999x ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
996 MOVII mpr, sub_a ; YES - copy TTS to sub_a
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
997 MOVLI .100,sub_b ; - load 100 into sub_b
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
998 call cmpU16 ; - sub_a - sub_b = TTS - 100
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
999 btfss neg_flag ; - TTS >= 100 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1000 bra TFT_display_tts_999 ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1001 ;bra TFT_display_tts_99 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1002
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1003 TFT_display_tts_99:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1004 btfsc tts_greater_99 ; was TTS > 99 mins last time?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1005 rcall TFT_display_tts_clear ; YES - clear remains from TTS > 99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1006 ; set output position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1007 WIN_MEDIUM dm_tts_value_col_99, dm_tts_value_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1008 output_99 ; display 0...99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1009 STRCAT_PRINT "'" ; print "'"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1010 bcf tts_greater_99 ; last TTS shown was <= 99 mins
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1011 bra TFT_standard_color ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1012
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1013 TFT_display_tts_999: ; set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1014 WIN_MEDIUM dm_tts_value_col_999, dm_tts_value_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1015 output_16_3 ; display 0...999
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1016 STRCAT_PRINT "" ; finalize output (no "'" here - not enough space available)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1017 bsf tts_greater_99 ; last TTS shown was > 99 mins
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1018 bra TFT_standard_color ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1019
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1020 TFT_display_tts_999x: ; set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1021 WIN_MEDIUM dm_tts_value_col_999x, dm_tts_value_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1022 output_16_3 ; display 0...999
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1023 STRCAT_PRINT "'" ; print "'"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1024 bra TFT_standard_color ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1025
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1026 TFT_display_tts_clear: ; clear remains from TTS > 99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1027 WIN_BOX_BLACK dm_tts_value_row, dm_tts_value_row+.31, dm_tts_value_col_999, dm_tts_value_col_99 ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1028 call TFT_memo_color ; restore default memo color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1029 movff int_O_TTS_norm+1,WREG ; get the high byte of the TTS
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1030 btfsc WREG,int_invalid_flag ; is the invalid flag set?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1031 call TFT_disabled_color ; YES - restore disabled color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1032 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1033
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1034
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1035 global TFT_show_ndl
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1036 TFT_show_ndl:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1037 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1038 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1039 movff char_O_NDL_norm,lo ; NO - get NDL time in normal plan
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1040 btfsc deco_locked ; - was the dive in deco?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1041 bra TFT_show_ndl_norm ; YES - use normal layout
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1042 btfsc alt_layout_active ; NO - alternative layout active?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1043 bra TFT_show_ndl_alt ; YES - use alternative layout
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1044 ;bra TFT_show_ndl_norm ; NO - use normal layout
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1045
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1046 TFT_show_ndl_norm: ; set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1047 WIN_MEDIUM dm_ndl_value_col_norm,dm_ndl_value_row_norm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1048 call TFT_memo_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1049 output_8 ; display 0...240
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1050 TFT_show_ndl_exit_1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1051 STRCAT_PRINT "'" ; print minutes symbol
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1052 TFT_show_ndl_exit_2:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1053 goto TFT_standard_color ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1054
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1055 TFT_show_ndl_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1056 btfsc safety_stop_active ; is the safety stop active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1057 bra TFT_show_ndl_alt_safety ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1058 ; clear potential remains from NDL normal and set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1059 WIN_BOX_BLACK dm_ndl_value_row_norm, dm_3rdrow_bot, dm_ndl_value_col_norm, dm_ndl_value_col_alt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1060 WIN_LARGE dm_ndl_value_col_alt, dm_ndl_value_row_alt
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1061 call TFT_memo_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1062 output_99 ; display 0...99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1063 STRCAT_PRINT "" ; finalize output
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1064 bra TFT_show_ndl_exit_2 ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1065
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1066 TFT_show_ndl_alt_safety:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1067 WIN_MEDIUM dm_ndl_value_col_norm,dm_ndl_value_row_norm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1068 call TFT_memo_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1069 PUTC " " ; fill first digit position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1070 output_99 ; display 0...99
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1071 bra TFT_show_ndl_exit_1 ; print minutes symbol and done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1072
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1073
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1074 global TFT_divemode_sign_show
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1075 TFT_divemode_sign_show:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1076 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1077 bra TFT_divemode_sign_show_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1078 ;bra TFT_divemode_sign_show_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1079
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1080 TFT_divemode_sign_show_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1081 WIN_TOP dm_sign_row_norm ; set row position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1082 WIN_LEFT dm_sign_col_norm ; set column position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1083 bra TFT_divemode_sign_show_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1084
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1085 TFT_divemode_sign_show_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1086 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1087 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1088 btfsc sign_shown ; NO - sign already shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1089 bra TFT_divemode_sign_show_alt_1; YES - no need to clear area again
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1090 btfsc bailout_mode ; NO - in bailout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1091 bra TFT_divemode_sign_show_alt_1; YES - no need to clear the area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1092 ; NO - eventually clear area from "bar" label and loop mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1093 WIN_BOX_BLACK dm_active_dil_row, dm_3rdrow_bot, dm_active_sp_label_col, dm_sign_rgt_alt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1094 TFT_divemode_sign_show_alt_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1095 WIN_TOP dm_sign_row_alt ; - set row position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1096 WIN_LEFT dm_sign_col_alt ; - set column position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1097 ;bra TFT_divemode_sign_show_com ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1098
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1099 TFT_divemode_sign_show_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1100 bsf sign_shown ; flag that the advice/attention/warning sign is shown
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1101 btfsc message_warning ; do we have a warning?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1102 bra TFT_divemode_sign_show_warn ; YES - show warning sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1103 btfsc message_attention ; NO - do we have an attention?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1104 bra TFT_divemode_sign_show_att ; YES - show attention sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1105 btfsc message_advice ; NO - do we have an advice message?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1106 bra TFT_divemode_sign_show_adv ; YES - show advice sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1107 return ; NO - false alarm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1108
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1109
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1110 TFT_divemode_sign_color_warn: ; custom colors table for dive_warning2 icon - warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1111 db .4, 0 ; #colors, spare
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1112 dw 0x0000 ; color 0x00: outside black
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1113 dw 0xff80 ; color 0x01: triangle yellow
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1114 dw 0xff80 ; color 0x02: exclamation mark yellow
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1115 dw 0xf800 ; color 0x03: inside red
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1116
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1117 TFT_divemode_sign_color_adv: ; custom colors table for dive_warning2 icon - advice
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1118 db .4, 0 ; #colors, spare
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1119 dw 0x0000 ; color 0x00: outside black
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1120 dw 0xffff ; color 0x01: triangle white
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1121 dw 0xffff ; color 0x02: exclamation mark white
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1122 dw 0x0780 ; color 0x03: inside green
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1123
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1124 TFT_divemode_sign_show_warn:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1125 TFT_WRITE_PROM_IMAGE_CUST_COLOR TFT_divemode_sign_color_warn; set custom colors for warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1126 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1127 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1128
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1129 TFT_divemode_sign_show_att:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1130 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show sign (with default colors)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1131 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1132
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1133 TFT_divemode_sign_show_adv:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1134 TFT_WRITE_PROM_IMAGE_CUST_COLOR TFT_divemode_sign_color_adv ; set custom colors for advice
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1135 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1136 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1137
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1138
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1139 global TFT_divemode_sign_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1140 TFT_divemode_sign_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1141 btfss sign_shown ; is the advice/attention/warning sign shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1142 return ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1143 bcf sign_shown ; YES - clear advice/attention/warning sign area and its flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1144 btfsc alt_layout_active ; - alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1145 bra TFT_divemode_sign_clear_alt ; - YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1146 ;bra TFT_divemode_sign_clear_norm; - NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1147
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1148 TFT_divemode_sign_clear_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1149 WIN_BOX_BLACK dm_sign_row_norm, dm_sign_bot_norm, dm_sign_col_norm, dm_sign_rgt_norm ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1150 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1151
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1152 TFT_divemode_sign_clear_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1153 WIN_BOX_BLACK dm_sign_row_alt, dm_sign_bot_alt, dm_sign_col_alt, dm_sign_rgt_alt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1154 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1155
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1156
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1157 global TFT_show_deco_mask
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1158 TFT_show_deco_mask:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1159 bcf safety_stop_active ; flag safety stop is not shown any more TODO: needed?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1160 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1161 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1162 btfsc alt_layout_active ; NO - in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1163 bra TFT_show_deco_mask_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1164 ;bra TFT_show_deco_mask_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1165
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1166 TFT_show_deco_mask_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1167 WIN_STD dm_tts_text_col_norm, dm_tts_text_row_norm ; set text position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1168 bra TFT_show_deco_mask_common ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1169
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1170 TFT_show_deco_mask_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1171 WIN_TINY dm_tts_text_col_alt, dm_tts_text_row_alt ; set text position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1172 STRCPY "Stop/" ; print "Stop/"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1173 ;bra TFT_show_deco_mask_common ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1174
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1175 TFT_show_deco_mask_common:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1176 call TFT_divemask_color ; set text color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1177 STRCAT_TEXT_PRINT tTTS ; print "TTS"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1178 bra TFT_display_exit_1 ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1179
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1180
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1181 TFT_display_deco_depth: ; output depth (stored in lo) to POSTINC2 with "m" or "ft"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1182 TSTOSS opt_units ; get unit (0=m, 1=ft)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1183 bra TFT_display_deco_depth_m ; 0 - meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1184 ;bra TFT_display_deco_depth_ft ; 1 - feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1185
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1186 TFT_display_deco_depth_ft:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1187 call convert_meter_to_feet ; convert value in lo from meters to feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1188 output_16_3 ; output stop depth (000-999)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1189 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1190
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1191 TFT_display_deco_depth_m:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1192 output_99 ; output stop depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1193 STRCAT_TEXT tMeters ; print unit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1194 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1195
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1196
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1197 global TFT_show_deco
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1198 TFT_show_deco:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1199 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1200 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1201
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1202 call TFT_color_code_stop ; color-code output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1203 movff char_O_deco_depth,lo ; get depth of first stop in meters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1204
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1205 TSTOSC opt_units ; get unit (0=m, 1=ft)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1206 bra TFT_show_deco_norm ; 1 - ft can only be displayed in normal layout due to space required for 3 digit depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1207
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1208 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1209 bra TFT_show_deco_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1210 ;bra TFT_show_deco_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1211
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1212 TFT_show_deco_norm: ; set position for combined depth and time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1213 WIN_MEDIUM dm_decostop_col_norm, dm_decostop_row_norm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1214 rcall TFT_display_deco_depth ; output depth (stored in lo) to POSTINC2 with "m" or "ft"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1215 PUTC ' ' ; put a space char between depth and time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1216 bra TFT_display_deco_common ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1217
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1218 TFT_show_deco_alt: ; set position for depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1219 WIN_LARGE dm_decostop_col_alt_depth, dm_decostop_row_alt_depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1220 output_99 ; output stop depth (2 digits, usable for meters only)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1221 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1222 ; set position for time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1223 WIN_MEDIUM dm_decostop_col_alt_time, dm_decostop_row_alt_time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1224 call TFT_memo_color ; back to memo color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1225 bcf win_invert ; back to non-inverted output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1226 ;bra TFT_display_deco_common ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1227
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1228 TFT_display_deco_common:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1229 movff char_O_deco_time,lo ; get stop time of the first stop in minutes
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1230 output_99DD ; print minutes or double dots if null
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1231 STRCAT_PRINT "'" ; add minutes sign
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1232 bcf win_invert ; back to non-inverted output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1233 TFT_display_exit_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1234 goto TFT_standard_color ; and return...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1235
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1236
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1237 global TFT_decoplan_mask ; mask for deco plan
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1238 TFT_decoplan_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1239 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1240 WIN_TINY dm_custom_decoplan_title_column, dm_custom_decoplan_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1241 STRCPY_TEXT_PRINT tDiveDecoplan
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1242 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1243
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1244
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1245 global TFT_decoplan ; data for deco plan - stops 2 - 7 (stop 1 is shown in the main screen)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1246 TFT_decoplan:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1247 lfsr FSR0,char_O_deco_depth ; load base address of stops table
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1248 clrf ex ; will be used for auxiliary flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1249 call TFT_memo_color ; set default output color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1250 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
1251 btfsc lo,char_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1252 call TFT_disabled_color ; YES - set to disabled color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1253 ; 2nd stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1254 WIN_SMALL dm_cust_dstop_2nd_stop_column, dm_cust_dstop_2nd_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1255 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1256 ; 3rd stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1257 WIN_SMALL dm_cust_dstop_3rd_stop_column, dm_cust_dstop_3rd_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1258 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1259 ; 4th stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1260 bsf ex,4 ; flag we are on 4th screen position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1261 WIN_SMALL dm_cust_dstop_4th_stop_column, dm_cust_dstop_4th_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1262 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1263 bcf ex,4 ; clear 4th position flag again
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1264 ; 5th stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1265 WIN_SMALL dm_cust_dstop_5th_stop_column, dm_cust_dstop_5th_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1266 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1267 ; 6th stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1268 WIN_SMALL dm_cust_dstop_6th_stop_column, dm_cust_dstop_6th_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1269 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1270 ; 7th stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1271 WIN_SMALL dm_cust_dstop_7th_stop_column, dm_cust_dstop_7th_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1272 rcall TFT_decoplan_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1273 bra TFT_display_exit_1 ; set standard color and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1274
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1275 TFT_decoplan_helper:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1276 btfsc ex,0 ; no more stops to show?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1277 bra TFT_decoplan_helper_1 ; YES - skip checking next entry - it will be empty, too
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1278 movff PREINC0,lo ; NO - advance pointer to get the depth of the 2nd, 3rd, 4th, ... stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1279 tstfsz lo ; is the stop depth = 0, i.e. no stop entry?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1280 bra TFT_decoplan_helper_3 ; NO - show stop data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1281 TFT_decoplan_helper_1: ; no more stop table entries
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1282 bsf ex,0 ; flag that there are no more stop table entries
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1283 btfss ex,4 ; are we on the 4th screen position?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1284 bra TFT_decoplan_helper_2 ; NO - normal handling on this position
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1285 btfsc ex,1 ; YES - special handling, has any stop been shown?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1286 bra TFT_decoplan_helper_2 ; YES - print normal blanking
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1287 STRCPY_PRINT " ---- " ; NO - print a "no stops" indication (blanking potential previous content, too)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1288 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1289 TFT_decoplan_helper_2: ; no more stop table entries, blank potential previous content
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1290 STRCPY_PRINT " " ; wipe screen position by printing 7 spaces
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1291 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1292 TFT_decoplan_helper_3:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1293 rcall TFT_display_deco_depth ; output depth (stored in lo) to POSTINC2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1294 PUTC " " ; put a space char between depth and time
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1295 movlw NUM_STOPS ; offset between arrays holding depths and durations
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1296 movff PLUSW0,lo ; get duration of the current stop
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1297 output_99dd ; print duration, prints double dots if duration is zero
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1298 STRCAT_PRINT "'" ; append symbol for minutes and print to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1299 bsf ex,1 ; flag that a stop was shown
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1300 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1301
0
heinrichsweikamp
parents:
diff changeset
1302
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1303 global TFT_safety_stop_clear
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1304 TFT_safety_stop_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1305 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1306 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1307 btfss safety_stop_active ; NO - is the safety stop shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1308 return ; NO - done, nothing to do
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1309 ; YES - clear safety stop area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1310 WIN_BOX_BLACK dm_safetystop_row, dm_safetystop_bot, dm_safetystop_text_column, dm_safetystop_rgt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1311 bcf safety_stop_active ; - safety stop not shown any more
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1312 btfsc deco_region ; - was the dive within deco stops region?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1313 bra TFT_show_slow_reminder ; YES - show "SLOW" reminder
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1314 return ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1315
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1316
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1317 global TFT_safety_stop_show
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1318 TFT_safety_stop_show:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1319 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1320 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1321 btfsc safety_stop_active ; NO - is the safety stop shown already?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1322 bra TFT_safety_stop_show_time ; YES - just update the time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1323 ; NO - clear area that may be polluted by alternative NDL
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1324 WIN_BOX_BLACK dm_safetystop_row, dm_tts_value_row, dm_ndl_value_col_alt, dm_safetystop_rgt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1325 call TFT_divemask_color ; - set color for text
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1326 bsf safety_stop_active ; - flag safety stop is shown now
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1327 ; - set position for text
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1328 WIN_STD dm_safetystop_text_column, dm_safetystop_text_row
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1329 STRCPY_PRINT "Stop " ; - print "Stop" with a trailing space to wipe away potential other remains
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1330 TFT_safety_stop_show_time:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1331 call TFT_attention_color ; set color for time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1332 ; set position for time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1333 WIN_MEDIUM dm_safetystop_column, dm_safetystop_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1334 movff safety_stop_countdown,lo ; get remaining time in seconds, low byte, from safety stop timer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1335 clrf hi ; set remaining time in seconds, high byte, to zero
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1336 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1337 movff lo,up ; save seconds in up
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1338 movff hi,lo ; move minutes to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1339 bsf leftbind ; activate left-alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1340 output_8 ; print minutes
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1341 bcf leftbind ; deactivate left-alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1342 PUTC ':' ; print ":"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1343 movff up,lo ; move seconds to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1344 output_99x ; print seconds (2 digits with leading zero)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1345 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1346 bra TFT_display_exit_1 ; done
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1347
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1348
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1349 global TFT_avr_stopwatch_mask ; mask for average depth and stopwatch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1350 TFT_avr_stopwatch_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1351 call TFT_divemask_color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1352
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1353 IFNDEF _min_depth_option
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1354
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1355 WIN_TINY dm_custom_avr_stop_column1+.2,dm_custom_avr_stop_title_row
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1356 TSTOSS opt_2ndDepthDisp ; show avg depth instead of max depth in main screen?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1357 bra TFT_avr_stopwatch_mask_1 ; NO - draw avg depth in custom view then
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1358 btfss alt_layout_active ; YES - in alternative layout?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1359 bra TFT_avr_stopwatch_mask_max ; NO - show max depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1360 ;bra TFT_avr_stopwatch_mask_avg ; YES - show avg depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1361 TFT_avr_stopwatch_mask_avg:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1362 STRCPY_TEXT_PRINT tDiveTotalAvg ; mask for average depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1363 bra TFT_avr_stopwatch_mask_2 ; continue
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1364 TFT_avr_stopwatch_mask_1:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1365 btfss alt_layout_active ; YES - in alternative layout?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1366 bra TFT_avr_stopwatch_mask_avg ; NO - show avg depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1367 ;bra TFT_avr_stopwatch_mask_max ; YES - show max depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1368 TFT_avr_stopwatch_mask_max:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1369 STRCPY_TEXT_PRINT tMaxDepth ; mask for maximum depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1370 ;bra TFT_avr_stopwatch_mask_2 ; continue
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1371 TFT_avr_stopwatch_mask_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1372 WIN_TINY dm_custom_avr_stop_column2+.3,dm_custom_avr_stop_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1373 STRCPY_TEXT_PRINT tDiveStopwatch
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1374 WIN_TINY dm_custom_avr_stop_column3-.8,dm_custom_avr_stop_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1375 STRCPY_TEXT_PRINT tDiveStopAvg
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1376 bra TFT_display_exit_1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1377
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1378 ELSE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1379
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1380 WIN_TINY dm_custom_avr_stop_column1+.2,dm_custom_avr_stop_title_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1381 STRCPY_PRINT "Max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1382 WIN_TINY dm_custom_avr_stop_column2+.3,dm_custom_avr_stop_title_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1383 STRCPY_PRINT "Avg.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1384 WIN_TINY dm_custom_avr_stop_column3-.8,dm_custom_avr_stop_title_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1385 STRCPY_PRINT "Min.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1386 bra TFT_display_exit_1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1387
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1388 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1389
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1390
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1391 global TFT_avr_stopwatch ; data for average depth and stopwatch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1392 TFT_avr_stopwatch:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1393 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1394 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1395
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1396 IFNDEF _min_depth_option
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1397
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1398 ; total average depth or max depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1399 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1400 TSTOSS opt_2ndDepthDisp ; show average depth instead of maximum depth in main screen?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1401
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1402 bra TFT_avr_stopwatch_1 ; NO - draw avg depth in custom view then
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1403 btfss alt_layout_active ; YES - in alternative layout?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1404 bra TFT_avr_stopwatch_max ; NO - show max depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1405 ;bra TFT_avr_stopwatch_avg ; YES - show avg depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1406 TFT_avr_stopwatch_avg:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1407 MOVII pressure_rel_avg_total,mpr ; get total dive average depth into hi:lo
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1408 bra TFT_avr_stopwatch_2 ; continue
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1409 TFT_avr_stopwatch_1:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1410 btfss alt_layout_active ; YES - in alternative layout?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1411 bra TFT_avr_stopwatch_avg ; NO - show avg depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1412 ;bra TFT_avr_stopwatch_max ; YES - show max depth
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1413 TFT_avr_stopwatch_max:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1414 MOVII pressure_rel_max_cached,mpr ; get maximum depth into hi:lo
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1415 ;bra TFT_avr_stopwatch_2 ; continue
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1416 TFT_avr_stopwatch_2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1417 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1418 TSTOSS opt_units ; 0=m, 1=ft
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1419 bra TFT_update_avr_stopwatch1_metric ; 0 - metric
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1420 TFT_update_avr_stopwatch1_imp: ; 1 - imperial
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1421 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1422 output_16 ; yxz
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1423 STRCAT " " ; wipe out remains from last output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1424 clrf WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1425 movff WREG,buffer+.3 ; limit string length to 3 digits
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1426 bra TFT_update_avr_stopwatch2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1427 TFT_update_avr_stopwatch1_metric:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1428 bsf ignore_digit5 ; no cm (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1429 output_16dp .3 ; yxz.a
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1430 PUTC " " ; wipe out remains from last output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1431 clrf WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1432 movff WREG,buffer+.4 ; limit string length to 4 = 3 digits + 1 half-size decimal dot
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1433 TFT_update_avr_stopwatch2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1434 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1435
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1436 ; stopped average depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1437 WIN_MEDIUM dm_custom_avr_stop_column3,dm_custom_avr_stop_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1438 MOVII pressure_rel_avg_trip,mpr ; get the resettable average depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1439 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1440 TSTOSS opt_units ; 0=m, 1=ft
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1441 bra TFT_update_avr_stopwatch2_metric ; 0 - metric
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1442 TFT_update_avr_stopwatch2_imp: ; 1 - imperial
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1443 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1444 output_16 ; yxz
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1445 STRCAT " " ; wipe out remains from last output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1446 clrf WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1447 movff WREG,buffer+.3 ; limit string length to 3 digits/characters
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1448 bra TFT_update_avr_stopwatch3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1449 TFT_update_avr_stopwatch2_metric:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1450 bsf ignore_digit5 ; no cm (flag will be cleared by output_16)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1451 output_16dp .3 ; yxz.a
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1452 PUTC " " ; wipe out remains from last output
589
8a7d2d8bcd33 limit string length to 4 digits/chars in average depth
heinrichsweikamp
parents: 587
diff changeset
1453 clrf WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1454 movff WREG,buffer+.4 ; limit string length to 4 = 3 digits + 1 half-size decimal dot
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1455 TFT_update_avr_stopwatch3:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1456 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1457
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1458 ELSE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1459
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1460 ; resettable maximum depth - needs ISR-safe copy!
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1461 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row ; column 0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1462 call TFT_memo_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1463 SMOVII pressure_rel_max_trip,mpr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1464 rcall TFT_avr_stopwatch_helper
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1465
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1466 ; resettable average depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1467 WIN_MEDIUM dm_custom_avr_stop_column2-.1,dm_custom_avr_stop_row ; column 54 - 1 = 53
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1468 call TFT_attention_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1469 MOVII pressure_rel_avg_trip,mpr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1470 rcall TFT_avr_stopwatch_helper
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1471
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1472 ; resettable minimum depth - needs ISR safe copy!
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1473 WIN_MEDIUM dm_custom_avr_stop_column3-.12,dm_custom_avr_stop_row ; column 118 - 12 = 106
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1474 call TFT_memo_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1475 SMOVII pressure_rel_min_trip,mpr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1476 rcall TFT_avr_stopwatch_helper
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1477
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1478 ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1479 bra TFT_display_exit_2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1480
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1481 TFT_avr_stopwatch_helper:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1482 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar]
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1483 output_16dp .3 ; yxz.ab
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1484 PUTC " " ; wipe out remains from last output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1485 clrf WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1486 movff WREG,buffer+.5 ; limit string length to 5 = 4 digits + 1 half-size decimal dot
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1487 STRCAT_PRINT ""
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1488 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1489
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1490 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1491
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1492 ; stopped dive time (will also be used by compass custom view)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1493 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1494 TFT_update_stopwatch: ; jump-in point for stopped dive time in compass custom view
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1495 MOVII divesecs_avg_trip,mpr ; get the resettable dive time (stopwatch)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1496 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1497 movlw .100 ; display layout will change if minutes become >= 100
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1498 cpfslt hi ; minutes < 100 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1499 bra TFT_update_stopwatch_2 ; NO - display hours:minutes
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1500 bcf aux_flag ; will print minutes : seconds
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1501 TFT_update_stopwatch_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1502 movf hi,W ; exchange lo and hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1503 movff lo,hi ; ...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1504 movwf lo ; ...
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1505 bcf leftbind ; include leading spaces
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1506 output_99 ; output minutes or hours ( 0 - 99)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1507 movlw ":" ; load standard separator
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1508 btfsc aux_flag ; will print hours : minutes ?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1509 movlw "'" ; YES - swap to alternative separator
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1510 movwf POSTINC2 ; print separator
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1511 movff hi,lo ; restore lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1512 output_99x ; output seconds or minutes
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1513 movlw .5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1514 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1515 clrf WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1516 movff WREG,buffer+.5 ; limit to 5 chars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1517 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1518 bra TFT_display_exit_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1519 TFT_update_stopwatch_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1520 movff hi,lo ; transfer minutes (low byte) to lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1521 movff up,hi ; transfer minutes (high byte) to hi
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1522 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1523 bsf aux_flag ; will print hours : minutes
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1524 bra TFT_update_stopwatch_1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1525
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1526
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1527 global TFT_CNS_mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1528 TFT_CNS_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1529 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1530 WIN_TINY dm_custom_cns3_column1, dm_custom_cns3_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1531 STRCPY_TEXT_PRINT tCNSsurf
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1532 WIN_TINY dm_custom_cns3_column2, dm_custom_cns3_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1533 btfsc FLAG_oc_mode ; in OC mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1534 bra TFT_CNS_mask_1 ; YES - print fTTS label
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1535 btfsc bailout_mode ; in bailout?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1536 bra TFT_CNS_mask_1 ; YES - print fTTS label (label will be printed, but a fTTS will actually not be calculated)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1537 TSTOSS opt_calc_asc_gasvolume ; bailout volume calculation requested?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1538 bra TFT_CNS_mask_1 ; NO - print fTTS label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1539 STRCPY_TEXT_PRINT tCNSBO ; YES - print bailout label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1540 bra TFT_CNS_mask_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1541 TFT_CNS_mask_1: ; OC or bailout
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1542 STRCPY_TEXT_PRINT tCNSfTTS ; print fTTS label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1543 TFT_CNS_mask_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1544 WIN_TINY dm_custom_cns3_column3, dm_custom_cns3_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1545 STRCPY_TEXT_PRINT tCNSnow
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1546 bra TFT_display_exit_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1547
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1548
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1549 global TFT_CNS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1550 TFT_CNS:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1551 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1552 ; CNS at end of normal dive
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1553 WIN_STD dm_custom_cns3_column1+.3,dm_custom_cns3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1554 MOVII int_O_CNS_norm,mpr ; get CNS at end of dive in normal plan
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1555 call TFT_color_code_cns
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1556 output_16_3 ; output as xxx
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1557 STRCAT_PRINT "% "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1558 ; fTTS / Bailout CNS, if enabled
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1559 WIN_STD dm_custom_cns3_column2+.2,dm_custom_cns3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1560 btfsc bailout_mode ; in bailout?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1561 bra TFT_CNS_3 ; YES - show "---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1562 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1563 bra TFT_CNS_1 ; NO - continue checking fTTS extra time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1564 btfss FLAG_oc_mode ; YES - in OC mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1565 bra TFT_CNS_2 ; NO - show CNS%
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1566 TFT_CNS_1: ; not in bailout, no volume calculation, and/or in OC mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1567 TSTOSS char_I_extra_time ; fTTS extra time configured?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1568 bra TFT_CNS_3 ; NO - show "---"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1569 TFT_CNS_2: ; YES - show CNS%
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1570 MOVII int_O_CNS_alt,mpr ; get CNS at end of dive in alternative plan
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1571 call TFT_color_code_cns ; color-code the CNS value
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1572 output_16_3 ; output as xxx
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1573 STRCAT_PRINT "% "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1574 bra TFT_CNS_4
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1575 TFT_CNS_3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1576 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1577 STRCPY_PRINT "--- "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1578 TFT_CNS_4:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1579 ; current CNS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1580 WIN_STD dm_custom_cns3_column3+.3,dm_custom_cns3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1581 MOVII int_O_CNS_current,mpr ; get current CNS
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1582 call TFT_color_code_cns
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1583 output_16_3 ; output as xxx
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1584 STRCAT_PRINT "%"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1585 TFT_display_exit_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1586 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1587 goto TFT_standard_color ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1588
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1589
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1590 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1591
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1592 IFDEF _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1593
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1594 global TFT_ppo2_sensors_mask ; mask for ppO2 sensors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1595 TFT_ppo2_sensors_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1596 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1597 WIN_TINY dm_custom_hud_sensor1_column+.4,dm_custom_hud_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1598 STRCPY_TEXT_PRINT tDiveHudMask1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1599 WIN_TINY dm_custom_hud_sensor2_column+.3,dm_custom_hud_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1600 STRCPY_TEXT_PRINT tDiveHudMask2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1601 WIN_TINY dm_custom_hud_sensor3_column+.2,dm_custom_hud_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1602 STRCPY_TEXT_PRINT tDiveHudMask3
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1603 bra TFT_display_exit_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1605
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1606 global TFT_ppo2_sensors ; data for ppO2 sensors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1607 TFT_ppo2_sensors:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1608 ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1609 ; Definition of the output:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1610 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1611 ; sensorX use voting o2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1612 ; _calibrated _O2 _logic _ppo2 Output Color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1613 ; _ok _sensorX _sensorX _sensorX
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1614 ;-----------------------------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1615 ; 0 -/- -/- -/- "----" TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1616 ; 1 0 -/- = 0 o2_ppo2_sensorX TFT_attention_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1617 ; 1 0 -/- > 0 o2_ppo2_sensorX TFT_disabled_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1618 ; 1 1 0 -/- o2_ppo2_sensorX TFT_color_code_ppo2_hud + win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1619 ; 1 1 1 -/- o2_ppo2_sensorX TFT_color_code_ppo2_hud
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1620 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1621 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1622 ; sensor 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1623 btfsc sensor1_calibrated_ok ; valid calibration?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1624 bra TFT_update_hud1b ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1625 btfsc sensor1_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1626 bra TFT_update_hud1b ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1627
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1628 ; no valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1629 WIN_STD dm_custom_hud_sensor1_column+.7, dm_custom_hud_row+.5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1630 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1631 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1632 bra TFT_update_hud2a ; continue with sensor 2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1633 TFT_update_hud1b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1634 ; sensor has a valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1635 WIN_MEDIUM dm_custom_hud_sensor1_column,dm_custom_hud_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1636 movff sensor1_ppO2,lo ; load ppO2 value into transfer storage for output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1637 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1638 btfsc use_O2_sensor1 ; in use?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1639 bra TFT_update_hud1d ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1640 ; valid calibration, but not in use
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1641 tstfsz lo ; sensor value = 0?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1642 bra TFT_update_hud1c ; no
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1643 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1644 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1645 bra TFT_update_hud1e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1646 TFT_update_hud1c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1647 ; 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
1648 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1649 bra TFT_update_hud1e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1650 TFT_update_hud1d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1651 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1652 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1653 btfsc voting_logic_sensor1 ; sensor value agrees with values of other sensors?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1654 bra TFT_update_hud1e ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1655 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1656 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1657 TFT_update_hud1e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1658 ; all coloring is set up now, let's write the value to the display!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1659 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1660 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1661 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1662
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1663 TFT_update_hud2a: ; sensor 2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1664 btfsc sensor2_calibrated_ok ; valid calibration?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1665 bra TFT_update_hud2b ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1666 btfsc sensor2_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1667 bra TFT_update_hud2b ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1668 ; no valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1669 WIN_STD dm_custom_hud_sensor2_column+.7, dm_custom_hud_row+.5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1670 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1671 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1672 bra TFT_update_hud3a ; continue with sensor 3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1673 TFT_update_hud2b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1674 ; sensor has a valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1675 WIN_MEDIUM dm_custom_hud_sensor2_column,dm_custom_hud_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1676 movff sensor2_ppO2,lo ; load ppO2 value into transfer storage for output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1677 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1678 btfsc use_O2_sensor2 ; in use?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1679 bra TFT_update_hud2d ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1680 ; valid calibration, but not in use
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1681 tstfsz lo ; sensor value = 0?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1682 bra TFT_update_hud2c ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1683 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1684 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1685 bra TFT_update_hud2e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1686 TFT_update_hud2c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1687 ; 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
1688 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1689 bra TFT_update_hud2e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1690 TFT_update_hud2d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1691 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1692 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1693 btfsc voting_logic_sensor2 ; sensor value agrees with values of other sensors?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1694 bra TFT_update_hud2e ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1695 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1696 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1697 TFT_update_hud2e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1698 ; all coloring is set up now, let's write the value to the display!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1699 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1700 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1701 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1702
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1703 TFT_update_hud3a: ; sensor 3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1704 btfsc sensor3_calibrated_ok ; valid calibration?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1705 bra TFT_update_hud3b ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1706 btfsc sensor3_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1707 bra TFT_update_hud3b ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1708 ; no valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1709 WIN_STD dm_custom_hud_sensor3_column+.7, dm_custom_hud_row+.5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1710 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1711 STRCPY_PRINT "---"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1712 bra TFT_update_hud4 ; done
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1713 TFT_update_hud3b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1714 ; sensor has a valid calibration
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1715 WIN_MEDIUM dm_custom_hud_sensor3_column,dm_custom_hud_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1716 movff sensor3_ppO2,lo ; load ppO2 value into transfer storage for output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1717 clrf hi ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1718 btfsc use_O2_sensor3 ; in use?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1719 bra TFT_update_hud3d ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1720 ; valid calibration, but not in use
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1721 tstfsz lo ; sensor value = 0?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1722 bra TFT_update_hud3c ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1723 ; valid calibration, not in use and value = 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1724 call TFT_attention_color ; output in yellow
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1725 bra TFT_update_hud3e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1726 TFT_update_hud3c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1727 ; 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
1728 call TFT_disabled_color ; output in light blue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1729 bra TFT_update_hud3e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1730 TFT_update_hud3d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1731 ; sensor has valid calibration and is in use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1732 call TFT_color_code_ppo2_hud ; With ppO2 [cbar] in lo
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1733 btfsc voting_logic_sensor3 ; sensor value agrees with values other sensors?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1734 bra TFT_update_hud3e ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1735 ; valid calibration, in use, but value does not agree with other sensors
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1736 bsf win_invert ; invert output
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1737 TFT_update_hud3e:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1738 ; all coloring is set up now, let's write the value to the display!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1739 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1740 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1741 bcf win_invert
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1742
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1743 TFT_update_hud4: ; closure
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1744 bra TFT_display_exit_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1745
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1746
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1747 global TFT_surface_sensor ; update O2 sensor data in surface mode
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1748 TFT_surface_sensor:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1749 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1750 WIN_SMALL surf_hud_sensor1_column,surf_hud_sensor1_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1751 btfsc sensor1_calibrated_ok
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1752 bra TFT_surface_sensor1 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1753 btfsc sensor1_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1754 bra TFT_surface_sensor1 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1755 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1756 STRCPY_PRINT "--- "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1757 bra TFT_surface_sensor2 ; skip sensor 1
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1758 TFT_surface_sensor1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1759 movff sensor1_ppO2,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1760 call TFT_color_code_ppo2_hud ; with ppO2 [cbar] in lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1761 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1762 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1763 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1764 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1765 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1766 TFT_surface_sensor2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1767 WIN_SMALL surf_hud_sensor2_column,surf_hud_sensor2_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1768 btfsc sensor2_calibrated_ok
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1769 bra TFT_surface_sensor3 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1770 btfsc sensor2_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1771 bra TFT_surface_sensor3 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1772 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1773 STRCPY_PRINT "--- "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1774 bra TFT_surface_sensor4 ; skip sensor 2
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1775 TFT_surface_sensor3:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1776 movff sensor2_ppO2,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1777 call TFT_color_code_ppo2_hud ; with ppO2 [cbar] in lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1778 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1779 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1780 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1781 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1782 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1783 TFT_surface_sensor4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1784 WIN_SMALL surf_hud_sensor3_column,surf_hud_sensor3_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1785 btfsc sensor3_calibrated_ok
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1786 bra TFT_surface_sensor5 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1787 btfsc sensor3_active ; valid HUD data for this sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1788 bra TFT_surface_sensor5 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1789 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1790 STRCPY_PRINT "--- "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1791 bra TFT_surface_sensor6 ; skip sensor 3
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1792 TFT_surface_sensor5:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1793 movff sensor3_ppO2,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1794 call TFT_color_code_ppo2_hud ; with ppO2 [cbar] in lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1795 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1796 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1797 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1798 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1799 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1800 TFT_surface_sensor6:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1801 TFT_display_exit_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1802 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1803 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1804
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1805
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1806 global TFT_sensor_mV
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1807 TFT_sensor_mV:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1808 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1809
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1810 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor1_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1811 SMOVII sensor1_mv,mpr ; in 0.1mV steps
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1812 STRCAT "1: "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1813 rcall TFT_sensor_mV_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1814
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1815 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor2_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1816 SMOVII sensor2_mv,mpr ; in 0.1mV steps
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1817 STRCAT "2: "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1818 rcall TFT_sensor_mV_helper
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1819
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1820 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1821 SMOVII sensor3_mv,mpr ; in 0.1mV steps
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1822 STRCAT "3: "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1823 rcall TFT_sensor_mV_helper
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1824 bcf leftbind
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1825
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1826 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row+.24 ; 4th row
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1827 btfss s8_digital_avail ; do we have a digital S8 interface?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1828 bra TFT_sensor_mV_optical_analog
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1829 STRCAT_PRINT "Digital"
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1830 bra TFT_display_exit_3
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1831 TFT_sensor_mV_optical_analog:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1832 btfss ir_power ; do we have a optical digital interface?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1833 bra TFT_sensor_mV_analog
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1834 STRCAT_PRINT "Optical"
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1835 bra TFT_display_exit_3
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1836 TFT_sensor_mV_analog: ; -> optical
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1837 STRCAT_PRINT "Analog"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1838 bra TFT_display_exit_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1839
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1840 TFT_sensor_mV_helper:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1841 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1842 STRCAT_PRINT "mV "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1843 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1844
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1845
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1846 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
1847 TFT_sensor_surface_warning:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1848 call TFT_warning_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1849 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
1850 bra TFT_sensor_mV2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1851 movff opt_x_s1+1,lo ; into bank1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1852 movf lo,W ; when opt_x_s1 > 255 the sensor will just give 8 mV at a ppO2 of 0.21 any more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1853 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
1854 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor1_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1855 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
1856 TFT_sensor_mV2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1857 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
1858 bra TFT_sensor_mV3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1859 movff opt_x_s2+1,lo ; into bank1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1860 movf lo,W ; when opt_x_s2 > 255 the sensor will just give 8 mV at a ppO2 of 0.21 any more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1861 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
1862 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor2_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1863 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
1864 TFT_sensor_mV3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1865 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
1866 bra TFT_sensor_mV4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1867 movff opt_x_s3+1,lo ; into bank1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1868 movf lo,W ; when opt_x_s3 > 255 the sensor will just give 8 mV at a ppO2 of 0.21 any more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1869 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
1870 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor3_row-.5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1871 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
1872 TFT_sensor_mV4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1873 bra TFT_display_exit_3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1874
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1875
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1876 global TFT_menu_calibrate
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1877 TFT_menu_calibrate: ; update mV data in calibration menu
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1878 btfss s8_digital_avail ; do we have a digital S8 interface?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1879 bra TFT_menu_calibrate_analog ; NO - use analog
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1880 btfss trigger_S8_data_update ; YES - new data frame received?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1881 bra TFT_menu_calibrate_common ; NO - use old values...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1882 bcf trigger_S8_data_update ; YES - clear update flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1883 call compute_mvolts_for_all_sensors ; - compute mV values from received data frame
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1884 bra TFT_menu_calibrate_common ; - continue with common part
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1885 TFT_menu_calibrate_analog:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1886 call get_analog_inputs ; read mV values from analog inputs
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1887 TFT_menu_calibrate_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1888 call TFT_attention_color ; show in yellow
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1889 bsf leftbind ; align to the left
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1890 WIN_SMALL surf_menu_sensor1_column,surf_menu2_sensor1_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1891 SMOVII sensor1_mv,mpr ; in 0.1mV steps
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1892 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1893 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1894 WIN_SMALL surf_menu_sensor2_column,surf_menu2_sensor2_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1895 SMOVII sensor2_mv,mpr ; in 0.1mV steps
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1896 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1897 STRCAT_PRINT "mV "
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1898 WIN_SMALL surf_menu_sensor3_column,surf_menu2_sensor3_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1899 SMOVII sensor3_mv,mpr ; in 0.1mV steps
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1900 output_16dp .4 ; xxx.y mV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1901 STRCAT_PRINT "mV "
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1902 bra TFT_display_exit_3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1903
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1904 ENDIF ; _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1905
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1906 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1907
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1908 global TFT_time_surfmode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1909 TFT_time_surfmode:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1910 WIN_SMALL surf_clock_column+.7,surf_clock_row
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1911 TFT_clock2: ; called from dive mode clock
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1912 call TFT_standard_color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1913 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1914 movff rtc_latched_hour,lo
0
heinrichsweikamp
parents:
diff changeset
1915 output_99
heinrichsweikamp
parents:
diff changeset
1916 movlw ':'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1917 movff rtc_latched_secs,lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1918 btfss lo,0 ; blinking every second
0
heinrichsweikamp
parents:
diff changeset
1919 movlw ' '
heinrichsweikamp
parents:
diff changeset
1920 movwf POSTINC2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1921 movff rtc_latched_mins,lo
0
heinrichsweikamp
parents:
diff changeset
1922 output_99x
heinrichsweikamp
parents:
diff changeset
1923 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
1924 return
heinrichsweikamp
parents:
diff changeset
1925
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1926
0
heinrichsweikamp
parents:
diff changeset
1927 global TFT_show_time_date_menu
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1928 global TFT_show_time_date_menu_fast
0
heinrichsweikamp
parents:
diff changeset
1929 TFT_show_time_date_menu:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1930 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of current date & time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1931 TFT_show_time_date_menu_fast:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1932 WIN_SMALL .20,.40 ; column, row - keep clear of the cursor area on the left!
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1933 call TFT_standard_color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1934 movff rtc_latched_hour,lo
0
heinrichsweikamp
parents:
diff changeset
1935 output_99
heinrichsweikamp
parents:
diff changeset
1936 PUTC ':'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1937 movff rtc_latched_mins,lo
0
heinrichsweikamp
parents:
diff changeset
1938 output_99x
heinrichsweikamp
parents:
diff changeset
1939 PUTC ':'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1940 movff rtc_latched_secs,lo
0
heinrichsweikamp
parents:
diff changeset
1941 output_99x
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1942 STRCAT " "
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1943 movff rtc_latched_day,lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1944 movff rtc_latched_month,hi
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1945 movff rtc_latched_year,up
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1946 call TFT_convert_date ; convert into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
0
heinrichsweikamp
parents:
diff changeset
1947 STRCAT_PRINT " "
heinrichsweikamp
parents:
diff changeset
1948 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1949
0
heinrichsweikamp
parents:
diff changeset
1950 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
1951
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1952 global TFT_surface_decosettings ; show all deco settings
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1953 TFT_surface_decosettings:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1954 ; Deco Mode
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1955 call TFT_standard_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1956 WIN_SMALL surf_gaslist_column,surf_gaslist_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1957 STRCAT_PRINT "ZH-L16"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1958 movff char_I_deco_model,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1959 iorwf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1960 bnz TFT_surface_decosettings1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1961 ; Display ZH-L16 sat/desat model
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1962 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1963 lfsr FSR2,buffer
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1964 movff char_I_desaturation_multiplier,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1965 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1966 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1967 STRCAT "%/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1968 movff char_I_saturation_multiplier,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1969 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1970 STRCAT_PRINT "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1971 bra TFT_surface_decosettings2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1972 ; Display ZH-L16-GF low/high model
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1973 TFT_surface_decosettings1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1974 TEXT_SMALL surf_gaslist_column+.43,surf_gaslist_row,tZHL16GF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1975 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1976 STRCPY_TEXT tGF ; GF:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1977 movff opt_GF_low,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1978 output_99x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1979 STRCAT "/"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1980 movff opt_GF_high,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1981 output_99x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1982 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1983 TFT_surface_decosettings2: ; fTTS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1984 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1985 STRCPY_TEXT tFTTSMenu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1986 movff char_I_extra_time,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1987 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1988 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1989 STRCAT_TEXT_PRINT tMinutes
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1990 ; Last Stop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1991 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1992 STRCPY_TEXT tLastDecostopSurf
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1993 movff opt_last_stop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1994 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1995 STRCAT_TEXT_PRINT tMeters
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1996 ; Salinity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1997 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1998 STRCPY_TEXT tDvSalinity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1999 movff opt_salinity,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2000 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2001 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2002 STRCAT_TEXT_PRINT tPercent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2003 return
0
heinrichsweikamp
parents:
diff changeset
2004
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2005
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2006 global TFT_divetimeout ; show timeout counter
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
2007 TFT_divetimeout:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2008 call TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2009 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2010 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2011 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2012 STRCPY 0x94 ; "End of dive" symbol
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2013 movff opt_diveTimeout,WREG ; in [min]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2014 mullw .60
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2015 MOVII PRODL, sub_a ; in seconds
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2016 MOVII dive_timeout_timer,sub_b
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2017 call subU16 ; sub_c = sub_a - sub_b (with UNSIGNED values)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2018 MOVII sub_c,mpr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2019 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2020 movf hi,W ; swap lo and hi
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2021 movff lo,hi ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2022 movwf lo ; ...
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
2023 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2024 PUTC ':'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2025 movff hi,lo ; copy hi to lo
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
2026 output_99x
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2027 movlw dm_warning_length ; dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2028 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
2029 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2030 bcf win_invert
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
2031 return
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
2032
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2033
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2034 global TFT_show_ftts
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2035 TFT_show_ftts:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2036 call TFT_set_message_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2037 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2038 return ; NO - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2039 btfsc FLAG_oc_mode ; YES - in OC mode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2040 bra TFT_display_ftts_1 ; YES - print fTTS label
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2041 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2042 bra TFT_display_ftts_1 ; NO - print fTTS label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2043 STRCPY "B/O" ; YES - print bailout label
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2044 bra TFT_display_ftts_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2045 TFT_display_ftts_1: ; OC or CCR/pSCR but no bailout volume calculation
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2046 STRCPY "@+" ; print fTTS label
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2047 TFT_display_ftts_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2048 movff char_I_extra_time,lo ; get fTTS delay time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2049 bsf leftbind ; print with alignment to the left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2050 output_8 ; print fTTS delay time
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2051 PUTC ":" ; ":"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2052 MOVII int_O_TTS_alt,mpr ; get alternative TTS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2053 call TFT_memo_color ; set memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2054 btfss hi,int_invalid_flag ; is the invalid flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2055 bra TFT_display_ftts_3 ; NO - keep memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2056 bcf hi,int_invalid_flag ; YES - clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2057 call TFT_disabled_color ; - switch to disabled color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2058 TFT_display_ftts_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2059 btfsc hi,int_not_yet_computed ; is the not-computed-yet flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2060 bra TFT_display_ftts_4 ; YES - show dashes
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2061 movf lo,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2062 iorwf hi,W ; extra_ascenttime = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2063 bz TFT_display_ftts_5 ; YES - show "NDL"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2064 movff char_O_deco_info,up ; get deco info vector
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2065 btfsc up,deco_zone ; fTTS <= TTS ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2066 call TFT_advice_color ; YES - set to advice color (green)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2067 output_16 ; print ascent time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2068 PUTC "'" ; print minutes symbol
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2069 bra TFT_display_ftts_6
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2070 TFT_display_ftts_4:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2071 STRCAT "---" ; "---" for not computed
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2072 bra TFT_display_ftts_6
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2073 TFT_display_ftts_5:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2074 STRCAT_TEXT tNDL ; "NDL"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2075 TFT_display_ftts_6:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2076 movlw dm_warning_length ; dive mode string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2077 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
0
heinrichsweikamp
parents:
diff changeset
2078 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2079 bcf leftbind ; clear left alignment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2080 goto TFT_standard_color ; ...and return
0
heinrichsweikamp
parents:
diff changeset
2081
heinrichsweikamp
parents:
diff changeset
2082
heinrichsweikamp
parents:
diff changeset
2083 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2084
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2085 global TFT_temp_surfmode
0
heinrichsweikamp
parents:
diff changeset
2086 TFT_temp_surfmode:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2087 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2088 WIN_SMALL surf_temp_column+3*8,surf_temp_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2089 TSTOSS opt_units ; 0=°C, 1=°F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2090 bra TFT_temp_surfmode_metric
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2091 STRCAT_TEXT tLogTunitF ; °F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2092 bra TFT_temp_surfmode_common
0
heinrichsweikamp
parents:
diff changeset
2093 TFT_temp_surfmode_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2094 STRCAT_TEXT tLogTunitC ; °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
2095 TFT_temp_surfmode_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2096 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2097 WIN_SMALL surf_temp_column,surf_temp_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2098 call TFT_memo_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2099 bra TFT_temp_common
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2100
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2101
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2102 global TFT_show_temp_divemode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2103 TFT_show_temp_divemode:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2104 btfsc dive_options_menu ; is the pre-menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2105 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2106 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2107 return ; YES - abort, no update of temperature now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2108 btfsc better_gas_blinking ; blinking better gas?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2109 return ; YES - abort, no update of temperature now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2110 btfsc better_dil_blinking ; blinking better diluent?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2111 return ; YES - abort, no update of temperature now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2112
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2113 WIN_SMALL dm_temp_column,dm_temp_row ; set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2114 call TFT_memo_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2115 movlw index_compass_dm ; index of compass custom view
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2116 cpfseq active_customview ; compass shown in custom view?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2117 bra TFT_temp_common ; NO - proceed with temperature
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2118 bra TFT_update_stopwatch ; YES - show resettable dive time instead of temperature
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
2119 TFT_temp_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2120 SMOVII temperature_cur,mpr ; ISR-safe 2 byte copy of current temperature to hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2121 TSTOSC opt_units ; 0=°C, 1=°F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2122 call convert_celsius_to_fahrenheit ; 1 - convert value in lo:hi from Celsius to Fahrenheit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2123 rcall TFT_convert_signed_16bit ; convert lo:hi into signed-short and adds '-' to POSTINC2 if required
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2124 btfsc neg_flag ; is the temperature negative?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2125 bra TFT_temp_common_2 ; YES - the minus sign has already been written
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2126 ; temp is positive, is it less than 10°C ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2127 tstfsz hi
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2128 bra TFT_temp_common_1 ; > 25.5°C, skip here
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2129 movlw .100
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2130 cpfslt lo
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2131 bra TFT_temp_common_1 ; > 10.0°C, skip here
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2132 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2133 output_16dp d'4' ; x.y°C
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2134 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2135 bra TFT_temp_common_3 ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2136 TFT_temp_common_1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2137 PUTC " " ; NO - write a space instead of the minus sign
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
2138 TFT_temp_common_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2139 bsf ignore_digit5 ; ignore decimal (flag will be cleared by output_16)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2140 output_16_3 ; output 0-999 without decimal -> writes ' ' - 99
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2141 movff buffer+2,lo ; get output from unit position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2142 movlw " " ; load code of the space character
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2143 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
2144 bra TFT_temp_common_3 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2145 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
2146 movlw "0" ; load code of the zero character
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2147 movff WREG,buffer+2 ; replace space with a zero
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
2148 TFT_temp_common_3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2149 btfss divemode ; are we in dive mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2150 bra TFT_temp_common_5 ; NO - no unit to append
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2151 TSTOSS opt_units ; YES - check unit type: 0=°C, 1=°F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2152 bra TFT_temp_common_4 ; go metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2153 STRCAT_TEXT tLogTunitF ; append °F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2154 bra TFT_temp_common_5
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
2155 TFT_temp_common_4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2156 STRCAT_TEXT tLogTunitC ; append °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
2157 TFT_temp_common_5:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2158 STRCAT_PRINT "" ; output to screen
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2159 TFT_temp_common_6:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2160 goto TFT_standard_color ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2161
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2162
0
heinrichsweikamp
parents:
diff changeset
2163 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2164
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2165 global TFT_show_menu_cursor_divemode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2166 TFT_show_menu_cursor_divemode:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2167 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
2168 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
2169 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2170
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2171 movlw dm_menu_item1_column-.8
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2172 btfsc menu_pos_cur,2 ; > 3 ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2173 movlw dm_menu_item4_column-.8 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2174 movwf win_leftx2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2175
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2176 movff menu_pos_cur,lo ; copy menu position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2177 movlw dm_menu_item6_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2178 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2179 movlw dm_menu_item1_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2180 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2181 movlw dm_menu_item2_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2182 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2183 movlw dm_menu_item3_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2184 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2185 movlw dm_menu_item4_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2186 dcfsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2187 movlw dm_menu_item5_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2188 movwf win_top
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2189 movlw FT_SMALL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2190 movwf win_font
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2191 STRCPY_PRINT "\xb7" ; print cursor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2192 return
145
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
2193
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2194 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2195
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2196 global TFT_show_active_gas_divemode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2197 TFT_show_active_gas_divemode: ; display gas (OC) or setpoint/ppO2 & gas (CCR, pSCR)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2198 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2199 return ; YES - abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2200 btfsc FLAG_apnoe_mode ; in apnoe mode?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2201 return ; YES - done
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2202 btfsc FLAG_gauge_mode ; in gauge mode?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2203 return ; YES - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2204
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2205 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2206 btfsc FLAG_oc_mode ; in OC mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2207 bra TFT_active_gas ; YES - show OC gas
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2208 ;bra TFT_active_sp ; NO - show setpoint and diluent
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2209
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2210 TFT_active_sp:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2211 btfss bailout_mode ; in bailout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2212 bra TFT_active_sp_loop ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2213 ;bra TFT_active_sp_bailout ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2214
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2215 TFT_active_sp_bailout:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2216 WIN_SMALL dm_active_dil_column, dm_active_dil_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2217 call TFT_attention_color ; - set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2218 STRCPY_TEXT_PRINT tDiveBailout ; - print "Bailout"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2219 bra TFT_active_gas ; - continue showing OC bailout gas
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2220
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2221 TFT_active_sp_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2222 MOVII int_O_breathed_ppO2,mpr ; copy ppO2 [cbar] to hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2223 call TFT_color_code_ppo2 ; color-code the output by the ppO2 of the loop gas mixture
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2224 btfss timebase_1sec ; on even second?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2225 bra TFT_active_sp_print ; YES - print ppO2 with normal rendering
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2226 btfsc sp_fallback ; NO - check if in fallback condition
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2227 bra TFT_active_sp_fallback ; YES - process fallback case
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2228 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
2229 btfss WREG,int_warning_flag ; warning flag set?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2230 bra TFT_active_sp_print ; NO - ppO2 is ok, print ppO2 with normal rendering
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2231 bra TFT_active_sp_invers ; YES - print with inverse rendering
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2232 TFT_active_sp_fallback: ; set up fallback case
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2233 call TFT_attention_color ; set color to yellow
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2234 TFT_active_sp_invers: ; blinking common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2235 bsf win_invert ; print in inverse
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2236 TFT_active_sp_print: ; set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2237 WIN_MEDIUM dm_active_gas_sp_value_col, dm_active_gas_sp_value_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2238 bsf leftbind ; print left-aligned
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2239 output_16dp .3 ; print ppO2 as x.xx
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2240 bcf leftbind ; back to right alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2241 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2242 bcf win_invert ; end inverse printing
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2243
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2244 btfsc sign_shown ; advice/attention/warning sign shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2245 bra TFT_active_diluent ; YES - skip display of "bar" and loop mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2246
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2247 btfsc velocity_active_vsi ; graphical vertical speed indicator shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2248 bra TFT_active_diluent ; YES - skip display of "bar" and loop mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2249
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2250 TFT_active_sp_label:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2251 WIN_STD dm_active_sp_label_col, dm_active_sp_label_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2252 call TFT_memo_color ; select memo color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2253 STRCAT "bar" ; print "bar"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2254 IFDEF _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2255 movff opt_ccr_mode,WREG ; get setpoint mode =0: Fixed SP, =1: Sensor, =2: Auto SP
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2256 sublw .1 ; opt_ccr_mode = 1 (Sensor) ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2257 bnz TFT_active_sp_label_1 ; NO - skip
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
2258 btfsc alt_layout_active ; YES - in alternative layout?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
2259 bra TFT_active_sp_label_1 ; YES - no space available for the "*"
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
2260 PUTC "*" ; NO - add "*"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2261 TFT_active_sp_label_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2262 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2263 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2264
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2265 TFT_active_loop_mode:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2266 WIN_TINY dm_active_sp_label_col, dm_active_dil_row+.3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2267 call TFT_memo_color ; set memo color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2268 btfsc FLAG_ccr_mode ; in CCR mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2269 bra TFT_active_loop_mode_ccr ; YES - print CCR label
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2270 btfsc FLAG_pscr_mode ; in pSCR mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2271 bra TFT_active_loop_mode_pscr ; YES - print pSCR label
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2272 bra TFT_active_diluent ; NO to both - should not happen
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2273 TFT_active_loop_mode_ccr:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2274 STRCPY_TEXT_PRINT tDvCCR ; print "CCR"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2275 bra TFT_active_diluent ; continue with diluent
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2276 TFT_active_loop_mode_pscr:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2277 STRCPY_TEXT_PRINT tDvPSCR ; print "pSCR"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2278 ;bra TFT_active_diluent ; continue with diluent
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2279
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2280 TFT_active_diluent:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2281 MOVII int_O_pure_ppO2,mpr ; get ppO2 [cbar] into hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2282 call TFT_color_code_ppo2 ; color-code the output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2283 btfss better_dil_available ; better diluent available?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2284 bra TFT_active_diluent_show ; NO - print in normal rendering
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2285 btg better_dil_blinking ; YES - toggle blink bit...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2286 btfss better_dil_blinking ; blink now?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2287 bra TFT_active_diluent_show ; NO - print in normal rendering
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2288 call TFT_attention_color ; YES - print in yellow color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2289 bsf win_invert ; - print in inverse
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2290 TFT_active_diluent_show:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2291 WIN_SMALL dm_active_dil_column, dm_active_dil_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2292 bra TFT_active_dil_gas_common ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2293 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2294
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2295 TFT_active_gas:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2296 MOVII int_O_breathed_ppO2,mpr ; copy ppO2 [cbar] into hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2297 call TFT_color_code_ppo2 ; color-code the output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2298 btfss better_gas_available ; better gas available?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2299 bra TFT_active_gas_print ; NO - print in normal rendering
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2300 btg better_gas_blinking ; YES - toggle blink bit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2301 btfss better_gas_blinking ; blink now?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2302 bra TFT_active_gas_print ; NO - print in normal rendering
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2303 call TFT_attention_color ; YES - blink in yellow
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2304 bsf win_invert ; print in inverse
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2305 TFT_active_gas_print:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2306 WIN_STD dm_active_gas_sp_value_col, dm_active_sp_label_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2307 TFT_active_dil_gas_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2308 movff char_I_O2_ratio,lo ; lo now stores O2 in %
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2309 IFDEF _helium
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2310 movff char_I_He_ratio,hi ; hi now stores He in %
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2311 ELSE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2312 clrf hi ; set hi to zero (no He)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2313 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2314 call gaslist_show_mix ; print "Nxlo", "Txlo/hi", "Air" or "O2"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2315 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2316 bcf win_invert ; end inverse printing
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2317 goto TFT_standard_color ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2318
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2319 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2320
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2321 global TFT_decotype_surface
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2322 TFT_decotype_surface:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2323 WIN_STD surf_decotype_column,surf_decotype_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2324 WIN_COLOR color_lightblue
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2325 movff opt_dive_mode,lo ; 0=OC, 1=CCR, 2=Gauge, 3=Apnoe, 4=pSCR
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2326 tstfsz lo ; in OC mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2327 bra TFT_decotype_surface_2 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2328 TFT_decotype_surface_1:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2329 STRCAT_TEXT_PRINT tDvOC ; OC
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2330 bra TFT_display_decotype_exit
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2331 TFT_decotype_surface_2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2332 decfsz lo,F ; in CCR mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2333 bra TFT_decotype_surface_3 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2334 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2335 STRCAT_TEXT_PRINT tDvCC ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2336 call TFT_standard_color
113
heinrichsweikamp
parents: 106
diff changeset
2337 WIN_TINY surf_decotype_column+.18,surf_decotype_row+.12
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2338 TSTOSS opt_ccr_mode ; > 0, i.e. not Fixed SP ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2339 bra TFT_display_decotype_cc_fixed ; NO - fixed then
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2340 IFDEF _external_sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2341 ; Sensor or Auto SP mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2342 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2343 sublw .2 ; mode = Auto SP ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2344 bz TFT_display_decotype_cc_auto ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2345 STRCPY_TEXT tCCRModeSensor ; NO - Sensor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2346 bra TFT_display_decotype_cc_common ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2347 ENDIF ; _external_sensor
337
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2348 TFT_display_decotype_cc_auto:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2349 STRCPY_TEXT tCCRModeAutoSP ; Auto SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2350 bra TFT_display_decotype_cc_common
113
heinrichsweikamp
parents: 106
diff changeset
2351 TFT_display_decotype_cc_fixed:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2352 STRCPY_TEXT tCCRModeFixedSP ; fixed SP
113
heinrichsweikamp
parents: 106
diff changeset
2353 TFT_display_decotype_cc_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2354 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2355 movff WREG,buffer+.8 ; limit string length to 8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2356 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2357 bra TFT_display_decotype_exit
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2358 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2359 TFT_decotype_surface_3:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2360 decfsz lo,F ; in gauge mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2361 bra TFT_decotype_surface_4 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2362 TFT_decotype_surface_3_1: ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2363 STRCAT_TEXT_PRINT tDvGauge
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2364 bra TFT_display_decotype_exit
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2365 TFT_decotype_surface_4:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2366 decfsz lo,F ; in apnea mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2367 bra TFT_decotype_surface_5 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2368 TFT_decotype_surface_4_1: ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2369 STRCAT_TEXT_PRINT tDvApnea
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2370 bra TFT_display_decotype_exit
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2371 TFT_decotype_surface_5:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2372 STRCAT_TEXT_PRINT tDvPSCR ; last but not least: must be pSCR then
0
heinrichsweikamp
parents:
diff changeset
2373 TFT_display_decotype_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2374 goto TFT_standard_color ; and return...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2375
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2376
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2377 global TFT_decotype_logbook
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2378 TFT_decotype_logbook: ; used from logbook and from deco calculator (simulator.asm)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2379 bsf aux_flag ; default to dive with deco calculation
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2380 tstfsz lo ; lo holds 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR, in OC mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2381 bra TFT_decotype_logbook_1_2 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2382 bra TFT_decotype_surface_1 ; YES - OC
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2383 TFT_decotype_logbook_1_2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2384 decfsz lo,F ; in CCR mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2385 bra TFT_decotype_logbook_1_3 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2386 STRCAT_TEXT_PRINT tDvCC ; YES - print "CCR"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2387 bra TFT_display_decotype_exit ; - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2388 TFT_decotype_logbook_1_3:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2389 decfsz lo,F ; in gauge mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2390 bra TFT_decotype_logbook_1_4 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2391 bcf aux_flag ; YES - dive without deco data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2392 bra TFT_decotype_surface_3_1 ; - gauge
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2393 TFT_decotype_logbook_1_4:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2394 decfsz lo,F ; in apnea mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2395 bra TFT_decotype_logbook_1_5 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2396 bcf aux_flag ; YES - dive without deco data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2397 bra TFT_decotype_surface_4_1 ; - apnea
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2398 TFT_decotype_logbook_1_5:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2399 bra TFT_decotype_surface_5 ; last but not least: must be pSCR then
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2400
0
heinrichsweikamp
parents:
diff changeset
2401 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2402
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2403 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2404
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2405 global TFT_splist_surfmode ; show setpoint list
0
heinrichsweikamp
parents:
diff changeset
2406 TFT_splist_surfmode:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2407 bsf short_gas_descriptions ; use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2408 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2409 ;SP 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2410 WIN_SMALL surf_gaslist_column,surf_gaslist_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2411 clrf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2412 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2413 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2414 ;SP 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2415 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2416 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2417 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2418 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2419 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2420 ;SP 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2421 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2422 movlw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2423 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2424 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2425 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2426 ;SP 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2427 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2428 movlw .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2429 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2430 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2431 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2432 ;SP 5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2433 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2434 movlw .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2435 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2436 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2437 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2438 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2439 return
0
heinrichsweikamp
parents:
diff changeset
2440
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2441 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2442
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2443 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2444
0
heinrichsweikamp
parents:
diff changeset
2445 global TFT_gaslist_surfmode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2446 TFT_gaslist_surfmode: ; displays gas list
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2447 bsf short_gas_descriptions ; use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2448 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2449 ;Gas 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2450 WIN_SMALL surf_gaslist_column,surf_gaslist_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2451 clrf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2452 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2453 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2454 ;Gas 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2455 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2456 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2457 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2458 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2459 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2460 ;Gas 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2461 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2462 movlw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2463 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2464 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2465 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2466 ;Gas 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2467 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2468 movlw .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2469 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2470 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2471 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2472 ;Gas 5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2473 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2474 movlw .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2475 movwf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2476 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2477 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2478 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2479 bcf win_invert ; clear flag for inverted output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2480 return
0
heinrichsweikamp
parents:
diff changeset
2481
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2482 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2483
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2484 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2485
0
heinrichsweikamp
parents:
diff changeset
2486 global TFT_dillist_surfmode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2487 TFT_dillist_surfmode: ; displays diluent list
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2488 bsf is_diluent_menu ; enable using diluents
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2489 rcall TFT_gaslist_surfmode ; use OC gas routine
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2490 bcf is_diluent_menu ; disable using diluents
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2491 return
0
heinrichsweikamp
parents:
diff changeset
2492
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2493 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2494
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2495 ;==================================================================
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2496
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2497 global TFT_show_depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2498 TFT_show_depth:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2499 MOVII pressure_rel_cur_cached,mpr ; copy relative pressure to hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2500 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar]
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2501 call TFT_color_code_depth ; set warning / attention flags and color-code the output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2502 rcall TFT_depth_blink ; control animation (blinking)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2503 rcall TFT_depth_position_m_ft ; set output position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2504
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2505 TSTOSS opt_units ; 0=m, 1=ft ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2506 bra TFT_depth_metric ; 0 - metric
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2507 ;bra TFT_depth_imperial ; 1 - imperial
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2508
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2509 TFT_depth_imperial:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2510 MOVLI .30,sub_a ; display 0 ft if shallower than 30 cm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2511 MOVII mpr,sub_b
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2512 call cmpU16 ; compare (sub_a - sub_b)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2513 btfss neg_flag ; depth shallower than 30 cm ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2514 bra depth_0_feet ; YES - print a zero directly
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2515 call convert_mbar_to_feet ; NO - convert value in hi:lo from mbar to feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2516 bsf leftbind ; - print left-aligned
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2517 output_16 ; - feet in large or huge font
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2518 bcf leftbind ; - reset alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2519 movlw .3 ; - limit to three chars
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2520 call TFT_fillup_with_spaces ; - fill up FSR2 with spaces
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2521 STRCAT_PRINT "" ; - finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2522 TFT_depth_imperial_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2523 bcf win_invert ; - reset invert flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2524 bra TFT_depth_exit ; - show target depth if in simulator mode and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2525
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2526 depth_0_feet:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2527 STRCAT_PRINT "0 " ; print a zero directly
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2528 bra TFT_depth_imperial_1 ; continue with common part
0
heinrichsweikamp
parents:
diff changeset
2529
heinrichsweikamp
parents:
diff changeset
2530 TFT_depth_metric:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2531 ; full meters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2532 MOVLI .9999,sub_a ; 9999 mbar = 99.99 m
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2533 MOVII mpr, sub_b ; current depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2534 call cmpU16 ; compare (sub_a - sub_b)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2535 btfsc neg_flag ; current depth < 100 meter ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2536 bra TFT_depth_metric_100m ; NO - current depth >= 100 meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2537
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2538 btfsc cur_depth_greater_100m ; was the current depth >= 100 meter during last call?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2539 rcall TFT_depth_box_black ; YES - clear depth area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2540 bcf cur_depth_greater_100m ; current depth is now < 100 meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2541
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2542 MOVLI .999,sub_a ; 999 mbar = 9.99 meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2543 MOVII mpr, sub_b ; current depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2544 call cmpU16 ; compare (sub_a - sub_b)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2545 movlw ' ' ; load coding of a space char
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2546 btfss neg_flag ; current depth < 10 meter ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2547 movwf POSTINC2 ; YES - print a leading space char
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2548
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2549 MOVLI .99,sub_a ; 99 mbar = 99 cm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2550 MOVII mpr,sub_b ; current depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2551 call cmpU16 ; compare (sub_a - sub_b)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2552 btfss neg_flag ; current depth < 1 meter ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2553 bra TFT_depth_metric_0m ; YES - (1)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2554 bsf ignore_digit4 ; NO - show depth in full meters, i.e. ignore digits 4 and 5
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2555 bsf leftbind ; - print left-aligned
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2556 output_16 ; - print depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2557 bcf leftbind ; - reset alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2558 bra TFT_depth_metric_com ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2559 TFT_depth_metric_0m:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2560 STRCAT "0" ; (1) - print a zero directly
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2561 TFT_depth_metric_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2562 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2563
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2564 ; decimeters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2565 rcall TFT_depth_position_dm ; set output position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2566 PUTC "." ; print a decimal point
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2567 MOVLI .30,sub_a ; 30 mbar = 0.3 meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2568 MOVII mpr,sub_b ; current depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2569 call cmpU16 ; compare (sub_a - sub_b)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2570 btfss neg_flag ; current depth < 0.3 meter ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2571 bra depth_0_decimeter ; YES - (2)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2572 movlw d'4' ; NO - omit leading digits holding the meters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2573 movwf ignore_digits ; - ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2574 bsf ignore_digit5 ; - omit last digit holding the centimeters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2575 output_16dp d'0' ; - print decimeters only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2576 STRCAT_PRINT "" ; - finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2577 bcf win_invert ; - reset invert flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2578 bra TFT_depth_exit ; - show target depth if in simulator mode and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2579 depth_0_decimeter:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2580 STRCAT_PRINT "0" ; (2) - print a zero directly and finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2581 bcf win_invert ; - reset invert flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2582 bra TFT_depth_exit ; - show target depth if in simulator mode and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2583
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2584 TFT_depth_metric_100m: ; show full meters only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2585 btfss cur_depth_greater_100m ; was the current depth >= 100 meter during last call?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2586 rcall TFT_depth_box_black ; NO - clear depth area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2587 bsf cur_depth_greater_100m ; depth is >= 100 meter now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2588 bsf ignore_digit4 ; show depth in full meters, i.e. ignore digits 4 and 5
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2589 bsf leftbind ; print left-aligned
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2590 output_16 ; print depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2591 bcf leftbind ; reset alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2592 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2593 bcf win_invert ; reset invert flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2594 bra TFT_depth_exit ; show target depth if in simulator mode and return
0
heinrichsweikamp
parents:
diff changeset
2595
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2596 TFT_depth_blink:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2597 TSTOSS opt_modwarning ; 0=standard, 1=blink
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2598 return ; standard, done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2599 btfsc depth_warn_att_last ; was there a warning or attention on the depth in the previous cycle?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2600 bra TFT_depth_blink_prev ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2601 btfsc depth_warning ; NO - do we have a depth warning now?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2602 bra TFT_depth_blink_new ; YES - so we have a warning now but not previously
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2603 btfsc depth_attention ; NO - do we have a depth attention now?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2604 bra TFT_depth_blink_new ; YES - so we have attention now but not previously
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2605 bra TFT_depth_blink_none ; NO - no warning in previous cycle, no warning now, reset all flags
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2606
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2607 TFT_depth_blink_prev:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2608 ; we had a warning or attention in previous cycle, check if we still have a warning or attention
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2609 btfsc depth_warning ; do we still have a warning?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2610 bra TFT_depth_blink_prev_1 ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2611 btfsc depth_attention ; NO - do we still have an attention?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2612 bra TFT_depth_blink_prev_1 ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2613 ; we had a warning or attention before, but not now any more - clear depth area from previous color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2614 rcall TFT_depth_box_black ; NO - clear depth area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2615 ;bra TFT_depth_blink_none ; - reset all flags
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2616
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2617 TFT_depth_blink_none:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2618 bcf win_invert ; print non-inverted
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2619 bcf depth_inverse_last ; memorize depth was printed in normal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2620 bcf depth_warn_att_last ; memorize there was no warning or attention
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2621 goto TFT_memo_color ; select memo color and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2622
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2623 TFT_depth_blink_prev_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2624 ; we had a warning or attention in previous cycle, and we still have a warning or attention
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2625 btfss depth_inverse_last ; was the depth printed in inverse last time?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2626 bra TFT_depth_blink_set ; NO - print in inverse now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2627 bra TFT_depth_blink_reset ; YES - print in normal now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2628
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2629 TFT_depth_blink_new:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2630 ; we had no warning or attention in previous cycle, but now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2631 bsf depth_warn_att_last ; memorize that the depth had a warning or attention
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2632 ;bra TFT_depth_blink_set ; start with inverse display
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2633
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2634 TFT_depth_blink_set:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2635 ; fill the area with respective color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2636 call TFT_attention_color_dive ; select attention color as default
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2637 btfsc depth_warning ; do we have a warning?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2638 call TFT_warnings_color_dive ; YES - replace with warning color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2639 rcall TFT_depth_box_color ; color depth area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2640 bsf win_invert ; print in inverse
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2641 bsf depth_inverse_last ; memorize depth was printed in inverse
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2642 return ; done
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2643
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2644 TFT_depth_blink_reset:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2645 ; fill the area with black color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2646 rcall TFT_depth_box_black ; clear depth area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2647 bcf win_invert ; print non-inverted
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2648 bcf depth_inverse_last ; memorize depth was printed in normal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2649 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2650
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2651
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2652 TFT_depth_position_m_ft:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2653 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2654 bra TFT_depth_position_m_ft_alt ; YES - (1)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2655 WIN_LARGE dm_depth_col_large,dm_depth_row_large ; NO - normal layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2656 return ; - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2657 TFT_depth_position_m_ft_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2658 WIN_HUGE dm_depth_col_huge, dm_depth_row_huge ; (1) - alternative layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2659 return ; - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2660
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2661 TFT_depth_position_dm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2662 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2663 bra TFT_depth_position_dm_alt ; YES - (1)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2664 WIN_MEDIUM dm_depth_dm_col_medium, dm_depth_dm_row_medium ; NO - normal layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2665 return ; - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2666 TFT_depth_position_dm_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2667 WIN_LARGE dm_depth_dm_col_large, dm_depth_dm_row_large ; (1) - alternative layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2668 return ; - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2669
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2670 TFT_depth_box_black:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2671 clrf WREG ; select black color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2672 TFT_depth_box_color:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2673 movff win_color1,mpr+2 ; backup output color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2674 movff win_color2,mpr+3 ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2675 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2676 bra TFT_depth_box_alt ; YES - (1)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2677 WIN_BOX_COLOR dm_depth_row_large,dm_depth_bot_large,dm_depth_col_large,dm_depth_rgt_large ; NO - top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2678 bra TFT_depth_box_exit ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2679 TFT_depth_box_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2680 WIN_BOX_COLOR dm_mask_depth_row, dm_depth_bot_huge, dm_depth_col_huge, dm_depth_rgt_huge ; (1) - full meters area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2681 TFT_depth_box_exit:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2682 movff mpr+2,win_color1 ; restore output color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2683 movff mpr+3,win_color2 ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2684 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2685
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2686 TFT_depth_exit:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2687 btfss alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2688 bra TFT_depth_exit_1 ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2689 btfsc depth_inverse_last ; YES - was last output in inverse mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2690 bra TFT_depth_exit_1 ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2691 call TFT_divemask_color ; NO - set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2692 WIN_TINY dm_mask_depth_column_alt,dm_mask_depth_row ; - set position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2693 STRCAT_TEXT_PRINT tDepth ; - restore "Depth" title
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2694 TFT_depth_exit_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2695 btfss sensor_override_active ; pressure sensor override active (simulator mode)?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2696 goto TFT_standard_color ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2697 ;bra TFT_depth_target ; YES - show target depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2698
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2699 TFT_depth_target: ; show simulated target depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2700 call TFT_attention_color ; select attention color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2701 TSTOSS opt_units ; check unit selection (0=m or 1=ft)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2702 bra TFT_depth_target_metric ; 0 - metric
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2703 ;bra TFT_depth_target_imperial ; 1 - imperial
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2704
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2705 TFT_depth_target_imperial:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2706 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2707 bra TFT_depth_target_imperial_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2708 ;bra TFT_depth_target_imperial_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2709
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2710 TFT_depth_target_imperial_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2711 WIN_TINY dm_mask_depth_column+.40,dm_mask_depth_row ; position right of depth label
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2712 bra TFT_depth_target_imperial_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2713
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2714 TFT_depth_target_imperial_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2715 WIN_TINY dm_mask_depth_column+.62,dm_mask_depth_row+.20 ; position within last digit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2716 ;bra TFT_depth_target_imperial_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2717
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2718 TFT_depth_target_imperial_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2719 movff simulatormode_depth,lo ; copy target depth to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2720 call convert_meter_to_feet ; convert value in lo from meters to feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2721 output_16_3 ; display only last three digits from a 16 bit value (0-999)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2722 STRCAT_PRINT "ft" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2723 goto TFT_standard_color ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2724
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2725 TFT_depth_target_metric:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2726 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2727 bra TFT_depth_target_metric_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2728 ;bra TFT_depth_target_metric_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2729
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2730 TFT_depth_target_metric_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2731 WIN_TINY dm_mask_depth_column+.38,dm_mask_depth_row+.22 ; position right of full meters, above decimal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2732 bra TFT_depth_target_metric_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2733
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2734 TFT_depth_target_metric_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2735 WIN_TINY dm_mask_depth_column+.65,dm_mask_depth_row+.20 ; position right of full meters, above decimal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2736 ;bra TFT_depth_target_metric_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2737
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2738 TFT_depth_target_metric_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2739 movff simulatormode_depth,lo ; copy target depth to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2740 output_8 ; display number
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2741 STRCAT_PRINT "m" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2742 goto TFT_standard_color ; done
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2743
0
heinrichsweikamp
parents:
diff changeset
2744 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2745
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2746 global TFT_custom_text
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2747 TFT_custom_text: ; show the custom text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2748 lfsr FSR0, opt_name ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2749 WIN_SMALL surf_customtext_column,surf_customtext_row1 ; 1st row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2750 rcall TFT_custom_text_2 ; show up to 12 chars and print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2751 incfsz lo,F ; was lo=255?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2752 return ; NO - all done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2753 lfsr FSR0, opt_name+.12 ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2754 WIN_SMALL surf_customtext_column,surf_customtext_row2 ; 2nd row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2755 rcall TFT_custom_text_2 ; show up to 12 chars and print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2756 incfsz lo,F ; was lo=255?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2757 return ; NO - all done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2758 lfsr FSR0, opt_name+.24 ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2759 WIN_SMALL surf_customtext_column,surf_customtext_row3 ; 3rd row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2760 rcall TFT_custom_text_2 ; show up to 12 chars and print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2761 incfsz lo,F ; was lo=255?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2762 return ; NO - all done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2763 lfsr FSR0, opt_name+.36 ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2764 WIN_SMALL surf_customtext_column,surf_customtext_row4 ; 4th row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2765 rcall TFT_custom_text_2 ; show up to 12 chars and print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2766 incfsz lo,F ; was lo=255?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2767 return ; NO - all done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2768 lfsr FSR0, opt_name+.48 ; source
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2769 WIN_SMALL surf_customtext_column,surf_customtext_row5 ; 5th row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2770 ;bra TFT_custom_text_2 ; show up to 12 chars, print and return...
0
heinrichsweikamp
parents:
diff changeset
2771
heinrichsweikamp
parents:
diff changeset
2772 TFT_custom_text_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2773 lfsr FSR2, buffer ; destination
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2774 movlw .12
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2775 movwf lo ; length/line
0
heinrichsweikamp
parents:
diff changeset
2776 TFT_custom_text_3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2777 movf POSTINC0,W ; get byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2778 bz TFT_custom_text_4 ; end if NULL
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2779 movwf POSTINC2 ; NO - copy
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2780 decfsz lo,F ; max length reached ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2781 bra TFT_custom_text_3 ; NO - loop
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2782 setf lo ; lo=255 -> more to come
0
heinrichsweikamp
parents:
diff changeset
2783 TFT_custom_text_4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2784 clrf POSTINC2 ; mark end of string
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2785 goto aa_wordprocessor ; print and return
0
heinrichsweikamp
parents:
diff changeset
2786
heinrichsweikamp
parents:
diff changeset
2787
heinrichsweikamp
parents:
diff changeset
2788 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2789
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2790 global TFT_pres_surfmode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2791 TFT_pres_surfmode:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2792 WIN_SMALL surf_press_column+.8,surf_press_row
0
heinrichsweikamp
parents:
diff changeset
2793 call TFT_standard_color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2794 SMOVII pressure_abs, sub_a ; make ISR-safe 2 byte copy of current absolute pressure to sub_a
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2795 MOVII pressure_abs_ref,sub_b ; copy absolute pressure from 30 minutes ago to sub_b
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2796 MOVII sub_a,mpr ; store current pressure also in hi:lo for output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2797 call subU16 ; sub_c = sub_a - sub_b
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2798 btfsc neg_flag ; pressure lower?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2799 rcall update_surf_press2 ; YES - swap arguments
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2800 tstfsz sub_c+1 ; > 255 mbar difference?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2801 bra update_surf_press_common ; YES - display
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2802 movlw .11 ; 10 mbar noise suppression margin
0
heinrichsweikamp
parents:
diff changeset
2803 subwf sub_c+0,W
heinrichsweikamp
parents:
diff changeset
2804 btfsc STATUS,C
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2805 bra update_surf_press_common ; YES - display
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2806 MOVII pressure_abs_ref,mpr ; NO - overwrite with stable value
0
heinrichsweikamp
parents:
diff changeset
2807 update_surf_press_common:
heinrichsweikamp
parents:
diff changeset
2808 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2809 ; Show only 4 digits
0
heinrichsweikamp
parents:
diff changeset
2810 movff buffer+1,buffer+0
heinrichsweikamp
parents:
diff changeset
2811 movff buffer+2,buffer+1
heinrichsweikamp
parents:
diff changeset
2812 movff buffer+3,buffer+2
heinrichsweikamp
parents:
diff changeset
2813 movff buffer+4,buffer+3
heinrichsweikamp
parents:
diff changeset
2814 movlw 0x00
heinrichsweikamp
parents:
diff changeset
2815 movff WREG,buffer+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2816 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2817 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2818 WIN_SMALL surf_press_column+(4+1)*8,surf_press_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2819 STRCPY_TEXT_PRINT tMBAR ; mbar (hPa)
0
heinrichsweikamp
parents:
diff changeset
2820 return
heinrichsweikamp
parents:
diff changeset
2821
heinrichsweikamp
parents:
diff changeset
2822 update_surf_press2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2823 MOVII sub_a,sub_b
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2824 MOVII pressure_abs_ref,sub_a
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2825 goto subU16 ; sub_c = sub_a - sub_b and return...
0
heinrichsweikamp
parents:
diff changeset
2826
heinrichsweikamp
parents:
diff changeset
2827 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2828
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2829 global TFT_batt_surfmode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2830 TFT_batt_surfmode:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2831 ; color-code according to battery percent
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2832 movff batt_percent,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2833 clrf hi
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2834 call TFT_color_code_battery
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2835
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2836 ; set up charging indicator and temperature warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2837 clrf WREG ; default to no indication/warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2838 btfsc cc_active ; charging in CC mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2839 movlw color_yellow ; YES - set output color to yellow
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2840 btfsc cv_active ; charging in CV mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2841 movlw color_green ; YES - set output color to green
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2842 btfsc battery_overtemp ; battery over-temperature detector tripped?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2843 movlw color_red ; YES - set output color to red
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2844 tstfsz WREG ; any indicator or warning active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2845 bsf win_invert ; YES - set output to inverse
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2846 tstfsz WREG ; any indicator or warning active (asked again)?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2847 call TFT_set_color ; YES - set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2848
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2849 WIN_SMALL batt_percent_column+.2,batt_percent_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2850 output_16_3 ; display only last three digits from a 16 bit value (0-999)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2851 STRCAT_PRINT "% "
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2852 bcf win_invert
0
heinrichsweikamp
parents:
diff changeset
2853 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2854 WIN_TINY batt_voltage_column+.15,batt_voltage_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2855 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
2856 PUTC "T"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2857 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2858 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2859 PUTC ":"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2860 MOVII batt_voltage,mpr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2861 output_16dp .2
0
heinrichsweikamp
parents:
diff changeset
2862 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2863 PUTC 'V'
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2864 movff buffer+8,buffer+6
0
heinrichsweikamp
parents:
diff changeset
2865 movlw 0x00
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2866 movff WREG,buffer+7 ; only "x.yV"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2867 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
2868 return
heinrichsweikamp
parents:
diff changeset
2869
heinrichsweikamp
parents:
diff changeset
2870 ;update_battery_debug:
heinrichsweikamp
parents:
diff changeset
2871 ; call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2872 ; WIN_TINY .70,.0
heinrichsweikamp
parents:
diff changeset
2873 ; movff battery_gauge+5,xC+3
heinrichsweikamp
parents:
diff changeset
2874 ; movff battery_gauge+4,xC+2
heinrichsweikamp
parents:
diff changeset
2875 ; movff battery_gauge+3,xC+1
heinrichsweikamp
parents:
diff changeset
2876 ; movff battery_gauge+2,xC+0
heinrichsweikamp
parents:
diff changeset
2877 ; ; battery_gauge:6 is nAs
heinrichsweikamp
parents:
diff changeset
2878 ; ; devide through 65536
heinrichsweikamp
parents:
diff changeset
2879 ; ; devide through 152
heinrichsweikamp
parents:
diff changeset
2880 ; ; Result is 0.01Ah in xC+1:xC+0
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2881 ; MOVLI .152,xB
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2882 ; call div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder
0
heinrichsweikamp
parents:
diff changeset
2883 ; bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2884 ; MOVII xC,mpr
0
heinrichsweikamp
parents:
diff changeset
2885 ; output_16
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2886 ; STRCAT_PRINT "x.01Ah"
0
heinrichsweikamp
parents:
diff changeset
2887 ; bcf leftbind
heinrichsweikamp
parents:
diff changeset
2888 ; return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2889
0
heinrichsweikamp
parents:
diff changeset
2890 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2891
heinrichsweikamp
parents:
diff changeset
2892 global TFT_convert_signed_16bit
heinrichsweikamp
parents:
diff changeset
2893 TFT_convert_signed_16bit:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2894 bcf neg_flag ; clear flag for negative number by default
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2895 btfss hi,7 ; negative number?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2896 return ; NO - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2897 ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2898 bsf neg_flag ; set flag for negative number
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2899 PUTC '-' ; display a minus sign ("-")
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2900 comf hi ; complement hi:lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2901 negf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2902 btfsc STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2903 incf hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2904 return ; done
0
heinrichsweikamp
parents:
diff changeset
2905
heinrichsweikamp
parents:
diff changeset
2906 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2907
heinrichsweikamp
parents:
diff changeset
2908 global TFT_convert_date
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2909 TFT_convert_date: ; convert into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2910 movff opt_dateformat,WREG ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2911 movwf EEDATA ; used as temp here
0
heinrichsweikamp
parents:
diff changeset
2912 tstfsz EEDATA
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2913 bra TFT_convert_date_1 ; opt_dateformat is 1 or 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2914 ; opt_dateformat is 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2915 ; use MMDDYY
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2916 movff lo,hy ; incoming: lo = day, hi = month
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2917 movff hi,lo ; swap
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2918 movff hy,hi ; now: lo = month, hi = day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2919 bra TFT_convert_date_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2920
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2921 TFT_convert_date_1:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2922 decfsz EEDATA,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2923 bra TFT_convert_date_2 ; opt_dateformat is 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2924 ; opt_dateformat is 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2925 ; use DDMMYY
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2926 TFT_convert_date_common:
0
heinrichsweikamp
parents:
diff changeset
2927 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2928 output_99x ; with lo = month or day or year
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2929 PUTC '.'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2930 movff hi,lo ; now lo = day or month or month
0
heinrichsweikamp
parents:
diff changeset
2931 output_99x
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2932 PUTC '.'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2933 movff up,lo ; now lo = year or year or day
0
heinrichsweikamp
parents:
diff changeset
2934 output_99x
heinrichsweikamp
parents:
diff changeset
2935 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2936 return
heinrichsweikamp
parents:
diff changeset
2937
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2938 TFT_convert_date_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2939 ; opt_dateformat is 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2940 ; use YYMMDD
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2941 movff lo,hy ; incoming: lo = day, up = year
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2942 movff up,lo ; swap
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2943 movff hy,up ; now : lo = year, up = day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2944 bra TFT_convert_date_common
0
heinrichsweikamp
parents:
diff changeset
2945
heinrichsweikamp
parents:
diff changeset
2946 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2947
heinrichsweikamp
parents:
diff changeset
2948 global TFT_convert_date_short
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2949 TFT_convert_date_short: ; convert into "DD/MM" or "MM/DD" or "MM/DD" in postinc2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2950 movff opt_dateformat,WREG ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2951 movwf EEDATA ; used as temp here
0
heinrichsweikamp
parents:
diff changeset
2952 tstfsz EEDATA
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2953 bra TFT_convert_date_short_1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2954 ; opt_dateformat is 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2955 ; use MMDD(YY)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2956 TFT_convert_date_short_0:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2957 movff lo,hy ; incoming: lo = day, hi = month
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2958 movff hi,lo ; swap
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2959 movff hy,hi ; now: lo = month, hi = day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2960 bra TFT_convert_date_short_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2961
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2962 TFT_convert_date_short_1:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2963 decfsz EEDATA,F
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2964 bra TFT_convert_date_short_0; opt_dateformat is 2 -> use (YY)MMDD
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2965 ; opt_dateformat is 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2966 ; use DDMM(YY)
0
heinrichsweikamp
parents:
diff changeset
2967 TFT_convert_date_short_common:
heinrichsweikamp
parents:
diff changeset
2968 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2969 output_99x ; with lo = month or day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2970 PUTC '.'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2971 movff hi,lo ; now lo = day or month
0
heinrichsweikamp
parents:
diff changeset
2972 output_99x
heinrichsweikamp
parents:
diff changeset
2973 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2974 return
heinrichsweikamp
parents:
diff changeset
2975
heinrichsweikamp
parents:
diff changeset
2976 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2977
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2978 global TFT_date_surfmode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2979 TFT_date_surfmode:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2980 WIN_SMALL surf_date_column,surf_date_row
0
heinrichsweikamp
parents:
diff changeset
2981 call TFT_standard_color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2982 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2983 movff rtc_latched_day,lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2984 movff rtc_latched_month,hi
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2985 movff rtc_latched_year,up
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2986 call TFT_convert_date ; convert into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
0
heinrichsweikamp
parents:
diff changeset
2987 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2988 return
heinrichsweikamp
parents:
diff changeset
2989
heinrichsweikamp
parents:
diff changeset
2990 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2991
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2992 global TFT_show_max_depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2993 TFT_show_max_depth:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2994 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2995 bra TFT_show_max_depth_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2996
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2997 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2998 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2999 bra TFT_show_max_depth_1 ; NO - keep position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3000 ; YES - adopt output position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3001 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3002
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3003 TFT_show_max_depth_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3004 btfsc FLAG_apnoe_mode ; in apnoe mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3005 bra TFT_max_depth_apnoe ; YES - different handling in apnoe mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3006
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3007 TSTOSS opt_2ndDepthDisp ; show average depth instead of max depth?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3008 bra TFT_max_depth_current ; NO - show max depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3009 ;bra TFT_avg_depth_current ; YES - show avg depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3010
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3011 TFT_avg_depth_current:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3012 MOVII pressure_rel_avg_total,mpr ; YES - get total dive average depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3013 bra TFT_max_depth_common ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3014
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3015 TFT_max_depth_apnoe:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3016 btfss apnoe_at_surface ; apnoe mode, at the surface?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3017 bra TFT_max_depth_current ; NO - show max depth of current dive
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3018 MOVII apnoe_max_pressure,mpr ; YES - show max depth of all dives so far
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3019 bra TFT_max_depth_common ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3020
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3021 TFT_max_depth_current:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3022 MOVII pressure_rel_max_cached,mpr ; get the "normal" max depth in mbar = cm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3023 ;bra TFT_max_depth_common ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3024
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3025 TFT_max_depth_common:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3026 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3027 TSTOSS opt_units ; 0=m or 1=ft ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3028 bra TFT_max_depth_metric ; 0 - use metric version
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3029 ;bra TFT_max_depth_imperial ; 1 - use imperial version
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3030
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3031 TFT_max_depth_imperial:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3032 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3033 call TFT_memo_color ; set output color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3034 output_16_3 ; print depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3035 bra TFT_max_depth_finish ; finish output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3036
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3037 TFT_max_depth_metric:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3038 MOVLI .9999,sub_a ; 9999 mbar = 99.99 m
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3039 MOVII mpr, sub_b ; depth, also used to back-up hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3040 call cmpU16 ; sub_a - sub_b = 99.99 - depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3041 btfsc neg_flag ; depth < 100 meter ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3042 bra TFT_max_depth_greater_100m ; NO - greater than 100 m
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3043 ;bra TFT_max_depth_shallower_100m; YES - shallower than 100 m
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3044
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3045 TFT_max_depth_shallower_100m:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3046 btfss max_depth_greater_100m ; was depth >= 100 m during last call?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3047 bra TFT_max_depth_metric_show ; NO - show depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3048 bcf max_depth_greater_100m ; YES - clear flag, last depth shown now not > 99.84 m anymore
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3049 bra TFT_max_depth_clear ; - clear depth area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3050
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3051 TFT_max_depth_greater_100m:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3052 btfsc max_depth_greater_100m ; was depth >= 100 m during last call?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3053 bra TFT_max_depth_metric_show ; YES - show depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3054 bsf max_depth_greater_100m ; NO - set flag, last depth shown now > 99.84 m
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3055 ;bra TFT_max_depth_clear ; - clear depth area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3056
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3057 TFT_max_depth_clear:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3058 WIN_BOX_BLACK dm_max_depth_row, dm_max_depth_bot, dm_max_depth_column, dm_max_depth_rgt ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3059 ;bra TFT_max_depth_metric_show
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3060
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3061 TFT_max_depth_metric_show:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3062 call TFT_memo_color ; set output color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3063 btfss max_depth_greater_100m ; depth to show >= 100 m ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3064 bra TFT_max_depth_metric_m_dm ; NO - show meters and decimeters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3065 bsf ignore_digit4 ; YES - crop decimeters and centimeters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3066 bsf leftbind ; - print left-aligned
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3067 output_16 ; - print depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3068 bra TFT_max_depth_finish ; - finish output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3069
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3070 TFT_max_depth_metric_m_dm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3071 MOVLI .999,sub_a ; load 9.99 meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3072 call cmpU16 ; sub_a - sub_b = 9.99 - depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3073 movlw ' ' ; load a space character
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3074 btfss neg_flag ; depth shallower than 10 meter ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3075 movwf POSTINC2 ; YES - add the space character
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3076 MOVLI .99,sub_a ; load 0.99 m
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3077 call cmpU16 ; sub_a - sub_b = 0.99 m - depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3078 btfss neg_flag ; depth shallower than 1 meter ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3079 bra TFT_max_depth_metric_zero ; YES - manually display a zero
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3080 bsf ignore_digit4 ; NO - crop decimeters and centimeters
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3081 bsf leftbind ; - align left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3082 output_16 ; - display full meters
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3083 STRCAT_PRINT "" ; - finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3084 bra TFT_max_depth_metric_dm ; - continue with decimeters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3085
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3086 TFT_max_depth_metric_zero:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3087 STRCAT_PRINT "0" ; print a zero
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3088 ;bra TFT_max_depth_metric_dm ; continue with decimeters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3089
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3090 TFT_max_depth_metric_dm:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3091 WIN_SMALL dm_max_depth_dm_column_nvsi, dm_max_depth_dm_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3092 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3093 bra TFT_max_depth_metric_dm_1 ; NO - keep position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3094 ; YES - adopt position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3095 WIN_SMALL dm_max_depth_dm_column, dm_max_depth_dm_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3096 TFT_max_depth_metric_dm_1:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3097 PUTC "." ; print decimal point
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3098 MOVII sub_b,mpr ; restore depth in hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3099 movlw d'4' ; crop leading 4 digits (don't show the full meters)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3100 movwf ignore_digits ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3101 bsf ignore_digit5 ; crop last digit (no centimeters, flag will be cleared by output_16)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3102 bsf leftbind ; print left-aligned
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3103 output_16dp d'0' ; print decimal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3104 TFT_max_depth_finish:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3105 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3106 bcf leftbind ; back to default right alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3107 goto TFT_standard_color ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3108
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3109
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3110 TFT_show_max_depth_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3111 btfsc FLAG_apnoe_mode ; in apnoe mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3112 bra TFT_show_apnoe_max_depth ; YES - use apnoe surface output also in alternative dive mode screen
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3113 btfsc FLAG_gauge_mode ; NO - in gauge mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3114 bra TFT_show_gauge_max_avg_depth; YES - show both, max and avg depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3115 return ; NO - nothing to do
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3116
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3117 TFT_show_gauge_max_avg_depth:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3118 call TFT_memo_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3119 WIN_MEDIUM dm_gauge_max_depth_col, dm_gauge_max_depth_row ; set position for max depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3120 rcall TFT_show_gauge_max_depth ; show max depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3121 call TFT_memo_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3122 WIN_MEDIUM dm_gauge_avg_depth_col, dm_gauge_avg_depth_row ; set position for avg depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3123 MOVII pressure_rel_avg_total,mpr ; get average depth into hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3124 bra TFT_show_gauge_depth ; show avg depth and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3125
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3126
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3127 global TFT_show_apnoe_max_depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3128 TFT_show_apnoe_max_depth:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3129 ; title
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3130 WIN_TINY dm_apnoe_last_max_depth_text_col, dm_apnoe_last_max_depth_text_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3131 call TFT_divemask_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3132 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3133 bra TFT_show_apnoe_max_depth_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3134 STRCPY_TEXT_PRINT tApnoeMax ; NO - print "Last Descent"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3135 bra TFT_show_apnoe_max_depth_com ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3136 TFT_show_apnoe_max_depth_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3137 STRCPY_TEXT_PRINT tMaxDepth ; print "Max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3138 TFT_show_apnoe_max_depth_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3139 ; value
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3140 WIN_MEDIUM dm_apnoe_last_max_depth_column, dm_apnoe_last_max_depth_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3141 call TFT_memo_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3142 TFT_show_gauge_max_depth:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3143 MOVII pressure_rel_max_cached,mpr ; get max depth into hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3144 TFT_show_gauge_depth:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3145 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar]
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3146 TSTOSS opt_units ; 0=m, 1=ft
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3147 bra TFT_display_apnoe_last_m_metric ; 0 - metric
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3148 TFT_display_apnoe_last_max_imp: ; 1 - imperial
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3149 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3150 output_16
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3151 bra TFT_max_depth_finish ; finish output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3152 TFT_display_apnoe_last_m_metric:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3153 bsf ignore_digit5 ; do not display centimeters (flag will be cleared by output_16)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3154 output_16dp d'3'
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3155 bra TFT_max_depth_finish ; finish output
0
heinrichsweikamp
parents:
diff changeset
3156
heinrichsweikamp
parents:
diff changeset
3157 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3158
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3159 global TFT_show_divetime
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3160 TFT_show_divetime:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3161 call TFT_memo_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3162 SMOVTT counted_divetime_mins,mpr ; ISR-safe 3 byte copy of minutes:2 (mpr+1:mpr+0) and seconds (mpr+2)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3163 btfsc show_only_divemins ; shall suppress display of seconds?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3164 bra TFT_show_divetime_min_only ; YES - show minutes only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3165 movlw .99 ; NO - load 99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3166 cpfsgt mpr+0 ; - dive time > 99 minutes ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3167 bra TFT_show_divetime_min_sec ; NO - show min:sec
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3168 bsf show_only_divemins ; YES - set flag to suppress the display of seconds for the rest of the dive
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3169 btfsc alt_layout_active ; - in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3170 bra TFT_show_divetime_clear_alt ; YES - clear min:sec area of alternative layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3171 ;bra TFT_show_divetime_clear_norm ; NO - clear min:sec area of normal layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3172
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3173 TFT_show_divetime_clear_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3174 WIN_BOX_BLACK dm_divetime_row, dm_divetime_bot_medium, dm_divetime_col_medium, dm_divetime_rgt ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3175 bra TFT_show_divetime_min_only_norm ; show minutes only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3176
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3177 TFT_show_divetime_clear_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3178 WIN_BOX_BLACK dm_divetime_row, dm_divetime_bot_large, dm_divetime_col_large, dm_divetime_rgt ;top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3179 bra TFT_show_divetime_min_only_alt ; show minutes only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3180
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3181 TFT_show_divetime_min_sec:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3182 ; show the minutes
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3183 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3184 bra TFT_show_divetime_min_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3185 ;bra TFT_show_divetime_min_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3186
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3187 TFT_show_divetime_min_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3188 WIN_MEDIUM dm_divetime_col_medium, dm_divetime_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3189 bra TFT_show_divetime_min_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3190
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3191 TFT_show_divetime_min_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3192 WIN_LARGE dm_divetime_col_large, dm_divetime_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3193 ;bra TFT_show_divetime_min_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3194
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3195 TFT_show_divetime_min_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3196 output_99 ; displays only last two digits from a 8 bit value (0-99)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3197 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3198
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3199 ; show the seconds
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3200 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3201 bra TFT_show_divetime_sec_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3202 ;bra TFT_show_divetime_sec_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3203
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3204 TFT_show_divetime_sec_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3205 WIN_SMALL dm_divetime_sec_col_small, dm_divetime_sec_row_small
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3206 bra TFT_show_divetime_sec_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3207
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3208 TFT_show_divetime_sec_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3209 WIN_MEDIUM dm_divetime_sec_col_medium, dm_divetime_sec_row_medium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3210 ;bra TFT_show_divetime_sec_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3211
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3212 TFT_show_divetime_sec_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3213 PUTC ':' ; print separator char
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3214 movff mpr+2,lo ; copy seconds to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3215 bsf leftbind ; activate left-alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3216 output_99x ; displays only last two figures from a 8 bit value with leading zero (00-99)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3217 bcf leftbind ; deactivate left-alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3218 bra TFT_divemins_exit ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3219
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3220 TFT_show_divetime_min_only:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3221 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3222 bra TFT_show_divetime_min_only_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3223 ;bra TFT_show_divetime_min_only_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3224
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3225 TFT_show_divetime_min_only_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3226 WIN_MEDIUM dm_divetime_minonly_col_medium, dm_divetime_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3227 output_16_4 ; print minutes (4 digits)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3228 bra TFT_divemins_exit ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3229
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3230 TFT_show_divetime_min_only_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3231 WIN_LARGE dm_divetime_minonly_col_large, dm_divetime_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3232 output_16_3 ; print minutes (3 digits)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3233 ;bra TFT_divemins_exit ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3234
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3235 TFT_divemins_exit:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3236 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3237 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
3238
heinrichsweikamp
parents:
diff changeset
3239 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3240
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3241 global TFT_show_apnoe_surface
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3242 TFT_show_apnoe_surface:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3243 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3244 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
3245 STRCPY_TEXT_PRINT tApnoeSurface
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3246 call TFT_memo_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3247 WIN_MEDIUM dm_apnoe_surface_time_column, dm_apnoe_surface_time_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3248 SMOVII apnoe_surface_mins,mpr ; ISR-safe copy of minutes to lo and seconds to hi
0
heinrichsweikamp
parents:
diff changeset
3249 output_8
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3250 PUTC ':'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3251 movff hi,lo ; copy seconds to lo
0
heinrichsweikamp
parents:
diff changeset
3252 output_99x
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3253 bra TFT_display_apnoe_exit ; and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3254
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3255
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3256 global TFT_show_apnoe_times
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3257 TFT_show_apnoe_times: ; descent dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3258 ; current dive time
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3259 call TFT_memo_color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3260 WIN_MEDIUM dm_divetime_apnoe_col, dm_divetime_apnoe_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3261 SMOVII apnoe_dive_mins,mpr ; ISR-safe copy of minutes to lo and seconds to hi
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3262 output_99 ; display 0-99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3263 STRCAT_PRINT "" ; show minutes
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3264 WIN_SMALL dm_divetime_apnoe_secs_col, dm_divetime_apnoe_secs_row ; left position for two sec figures
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3265 PUTC ':'
0
heinrichsweikamp
parents:
diff changeset
3266 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3267 movff hi,lo ; copy seconds to lo
0
heinrichsweikamp
parents:
diff changeset
3268 output_99x
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3269 STRCAT_PRINT "" ; show seconds
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3270 ; overall dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3271 WIN_MEDIUM dm_apnoe_total_divetime_col, dm_apnoe_total_divetime_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3272 SMOVTT counted_divetime_mins,mpr ; ISR-safe 3 byte copy of minutes:2 and seconds
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3273 clrf hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3274 bcf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3275 output_16_3 ; displays only last three figures from a 16 bit value (0-999)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3276 STRCAT_PRINT "" ; show minutes in large font
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3277 WIN_SMALL dm_apnoe_total_divetime_secs_col, dm_apnoe_total_divetime_secs_row ; left position for two sec figures
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3278 PUTC ':'
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3279 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3280 movff up,lo ; copy minutes from up to lo
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3281 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3282 TFT_display_apnoe_exit:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3283 STRCAT_PRINT ""
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3284 bcf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3285 goto TFT_standard_color ; and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3286
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3287
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3288 global TFT_clear_apnoe_surface
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3289 TFT_clear_apnoe_surface:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3290 ; clear surface data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3291 WIN_BOX_BLACK dm_apnoe_last_max_depth_text_row, .239, dm_apnoe_last_max_depth_column, .159 ; top, bottom, left, right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3292 goto TFT_standard_color ; and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3293
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3294
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3295 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3296 ; check if firmware is within expiry period, will return aux_flag set if not
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3297
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3298 check_expiry: ; check if it is time for a firmware update
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3299 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3300 movff rtc_latched_day,lo ; get current day
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3301 movff rtc_latched_month,hi ; get current month
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3302 movff rtc_latched_year,up ; get current year
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3303 bsf aux_flag ; set firmware as expired by default
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3304 movlw firmware_expire_year ; start with checking year
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3305 cpfsgt up ; current year > expiry year ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3306 bra check_expiry_Y ; NO - continue checks
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3307 return ; YES - expired
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3308 check_expiry_Y:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3309 cpfseq up ; current year = expiry year ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3310 bra check_expiry_ok ; NO - must be < then, OK whatever month & day
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3311 movlw firmware_expire_month ; YES - continue checking month
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3312 cpfsgt hi ; current month > expiry month ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3313 bra check_expiry_M ; NO - continue checks
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3314 return ; YES - expired
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3315 check_expiry_M:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3316 cpfseq hi ; current month = expiry month ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3317 bra check_expiry_ok ; NO - must be < then, OK whatever day
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3318 movlw firmware_expire_day ; YES - continue checking day
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3319 cpfsgt lo ; current day > expiry day ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3320 bra check_expiry_ok ; NO - must be <= then, OK
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3321 return ; YES - expired
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3322 check_expiry_ok:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3323 bcf aux_flag
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3324 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3325
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3326 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3327 ; append firmware BETA status to current string, including color-coding
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3328
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3329 global TFT_cat_beta_release
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3330 TFT_cat_beta_release: ; entry point for printing "Release" / "Beta #"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3331 bsf aux_flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3332 bra TFT_cat_beta_common
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3333 TFT_cat_beta_rel: ; entry point for printing "Rel." / "B. #"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3334 bcf aux_flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3335 TFT_cat_beta_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3336 IFDEF _DEBUG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3337 btfss aux_flag ; shall show long version?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3338 bra TFT_cat_debug_short ; NO - show short version
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3339 STRCAT "DEBUG" ; YES - show long version
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3340 goto TFT_warning_color ; - set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3341 TFT_cat_debug_short:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3342 STRCAT "DBG." ; show short version
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3343 goto TFT_warning_color ; set color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3344 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3345 movlw softwareversion_beta ; =0: release, =1: beta 1, =2: beta 2, ...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3346 movwf lo ; copy to lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3347 tstfsz lo ; release version?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3348 bra TFT_cat_beta_1 ; NO - must be beta version then
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3349 btfss aux_flag ; YES - shall show long version?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3350 bra TFT_cat_beta_2 ; NO - show short version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3351 rcall check_expiry ; YES - check expiry date
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3352 btfsc aux_flag ; - within expiry date?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3353 bra TFT_cat_beta_4 ; NO - give update cue
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3354 STRCAT "Release" ; YES - print "Release"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3355 return ; - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3356 TFT_cat_beta_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3357 btfss aux_flag ; shall show long version?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3358 bra TFT_cat_beta_3 ; NO - show short version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3359 STRCAT "Beta " ; YES - show long version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3360 TFT_cat_beta_1a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3361 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3362 output_8 ; print beta version number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3363 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3364 goto TFT_attention_color ; and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3365 TFT_cat_beta_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3366 STRCAT "Rel." ; short version for "Release"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3367 return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3368 TFT_cat_beta_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3369 STRCAT "B." ; short version for "Beta"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3370 bra TFT_cat_beta_1a ; append beta version number
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3371 TFT_cat_beta_4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3372 STRCAT "update!" ; print update cue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3373 goto TFT_attention_color ; and return
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3374 ENDIF ; ELSE / _DEBUG
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3375
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3376 ;-----------------------------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3377 ; show firmware update message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3378 ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3379 ; all text outputs are hard-coded since language switching
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3380 ; has not yet been initialized when this code is executed
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3381
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3382 global show_fw_mesg_update
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3383 global show_fw_mesg_kept
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3384 show_fw_mesg_update:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3385 call TFT_standard_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3386 ; show update message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3387 WIN_SMALL .20,.100
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3388 STRCPY_PRINT "Update successful!"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3389 ; show firmware version
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3390 WIN_SMALL .20,.140
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3391 STRCPY "New Firmware: "
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3392 bra show_fw_mesg_common
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3393 show_fw_mesg_kept:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3394 call TFT_standard_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3395 ; show reboot message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3396 WIN_SMALL .60,.100
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3397 STRCPY_PRINT "Reboot"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3398 ; show firmware version
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3399 WIN_SMALL .30,.140
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3400 STRCPY "Firmware: "
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3401 show_fw_mesg_common:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3402 rcall TFT_cat_firmware ; show firmware version x.y and color-code + invert if outdated
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3403 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3404 bcf win_invert ; back to normal (non inverted) output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3405 ; show firmware beta status
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3406 call TFT_standard_color ; color to use if it is a release version
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3407 WIN_SMALL .60,.180
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3408 rcall TFT_cat_beta_release ; show "Release" or "BETA" + issue
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3409 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3410 goto TFT_standard_color ; reset color and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3411
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3412 ;-----------------------------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3413 ; show serial and firmware version for comm mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3414
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3415 global TFT_show_serial_and_firmware
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3416 global TFT_show_firmware
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3417 TFT_show_serial_and_firmware:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3418 STRCPY "#"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3419 call TFT_cat_serial
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3420 STRCAT " "
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3421 STRCAT "v"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3422 TFT_show_firmware:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3423 call TFT_cat_firmware ; will set win_invert if outdated
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3424 STRCAT " "
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3425 call TFT_cat_beta_release
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3426 STRCAT_PRINT ""
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3427 bcf win_invert ; clear win_invert
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3428 goto TFT_standard_color ; ...and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3429
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3430 ;-----------------------------------------------------------------------------
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3431 ; For the Information menu: append total dives
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3432
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3433 global info_menu_total_dives
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3434 info_menu_total_dives:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3435 lfsr FSR1,tTotalDives
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3436 call strcat_text
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3437 TFT_cat_total_dives:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3438 read_int_eeprom .2
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3439 movff EEDATA,lo
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3440 read_int_eeprom .3
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3441 movff EEDATA,hi
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3442 bsf leftbind
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3443 output_16
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3444 bcf leftbind
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3445 return
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3446
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3447 ;-----------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3448 ; append firmware version to current string, including color-coding
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3449
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3450 global TFT_cat_firmware
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3451 TFT_cat_firmware:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3452 movlw softwareversion_x
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3453 movwf lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3454 bsf leftbind
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3455 output_8 ; print major in 1 or 2 digit format
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3456 PUTC '.'
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3457 movlw softwareversion_y
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3458 movwf lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3459 output_99x ; print minor in two digit format
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3460 bcf leftbind
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3461 rcall check_expiry ; sets aux_flag if expired
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3462 btfss aux_flag ; expired?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3463 return ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3464 bsf win_invert ; YES - print in inverse
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3465 goto TFT_attention_color ; - print in attention color (and return)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3466
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3467 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3468 ; For the Information menu: firmware version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3469
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3470 global info_menu_firmware
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3471 info_menu_firmware:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3472 lfsr FSR1,tFirmware
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3473 call strcat_text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3474 rcall TFT_cat_firmware
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3475 PUTC " "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3476 rcall TFT_cat_beta_rel
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3477 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3478 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3479
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3480 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3481 ; For the Information menu: firmware version of the RX processor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3482
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3483 IFDEF _rx_functions
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3484
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3485 global info_menu_firmware_rx
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3486 global TFT_print_firmware_rx
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3487 info_menu_firmware_rx:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3488 lfsr FSR1,tFirmware_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3489 call strcat_text
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3490 TFT_print_firmware_rx:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3491 movff rx_firmware_cur_major,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3492 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3493 output_8
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3494 PUTC '.'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3495 movff rx_firmware_cur_minor,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3496 output_8
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3497 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3498 return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3499
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3500 ENDIF
0
heinrichsweikamp
parents:
diff changeset
3501
heinrichsweikamp
parents:
diff changeset
3502 ;-----------------------------------------------------------------------------
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3503 ; For the Information menu: serial number
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3504
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3505 global info_menu_serial
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3506 global TFT_cat_serial
0
heinrichsweikamp
parents:
diff changeset
3507 info_menu_serial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3508 lfsr FSR1,tSerial
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3509 call strcat_text
0
heinrichsweikamp
parents:
diff changeset
3510 TFT_cat_serial:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3511 clrf EEADRH
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3512 clrf EEADR ; get serial number LOW
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3513 call read_eeprom ; read byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3514 movff EEDATA,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3515 incf EEADR,F ; get serial number HIGH
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3516 call read_eeprom ; read byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3517 movff EEDATA,hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3518
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3519 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3520 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3521 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3522 return
0
heinrichsweikamp
parents:
diff changeset
3523
heinrichsweikamp
parents:
diff changeset
3524 ;-----------------------------------------------------------------------------
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3525 ; For the Information menu: hardware / software configuration
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3526
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3527 global info_menu_config
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3528 info_menu_config:
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3529 lfsr FSR1,tHardware
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3530 call strcat_text
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3531 call I2C_init_compass ; start compass
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3532 movf HW_descriptor,W ; copy hardware descriptor to WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3533 output_hex ; print as hex
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3534 PUTC "-" ; print a separator
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3535 movf HW_variants,W ; copy hardware variants to WREG
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3536 output_hex ; print as hex
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3537 PUTC "-" ; print a separator
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3538 movlw SW_CONF ; get software configuration
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3539 output_hex ; print as hex
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3540 return
0
heinrichsweikamp
parents:
diff changeset
3541
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3542
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3543 ;-----------------------------------------------------------------------------
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3544 ; For the Information menu: battery voltage
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3545
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3546 global info_menu_battery_volts
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3547 info_menu_battery_volts:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3548 lfsr FSR1,tBatteryV
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3549 call strcat_text
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3550 MOVII batt_voltage,mpr
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3551 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3552 output_16dp .2 ; x.xxx
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3553 STRCAT "V(T"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3554 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
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3555 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3556 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3557 PUTC ")"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3558 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3559
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3560 ;-----------------------------------------------------------------------------
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3561 ; For the Information menu: uptime
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3562
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3563 global info_menu_uptime
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3564 info_menu_uptime:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3565 lfsr FSR1,tUptime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3566 call strcat_text
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3567 SMOVFF uptime,xC ; ISR-safe copy of uptime:4 to xC:4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3568
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3569 info_menu_uptime_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3570 MOVLI .3600,xB ; one hour = 3600s
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3571 call div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder -> xC+1:xC+0 holds full hours
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3572 MOVII xC,xA
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3573 MOVLI .24,xB ; one day = 24 hours
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3574 call div16x16 ; xC:2 = xA:2 / xB:2 with xA as remainder -> xC+1:xC+0 holds full days, xA holds full hours
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3575 MOVII xC,mpr ; copy full days into hi:lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3576 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3577 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3578 PUTC "d"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3579 movff xA+0,lo ; full hours
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3580 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3581 PUTC "h"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3582 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3583 return ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3584
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
3585 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3586
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3587 IFDEF _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3588
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3589 global menu_cal_x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3590 menu_cal_x:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3591 lfsr FSR0,compass_CX_f
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3592 lfsr FSR1,tCalX
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3593 bra menu_cal_common
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3594
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3595 global menu_cal_y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3596 menu_cal_y:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3597 lfsr FSR0,compass_CY_f
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3598 lfsr FSR1,tCalY
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3599 bra menu_cal_common
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3600
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3601 global menu_cal_z
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3602 menu_cal_z:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3603 lfsr FSR0,compass_CZ_f
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3604 lfsr FSR1,tCalZ
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3605 ;bra menu_cal_common
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3606
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3607 menu_cal_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3608 call strcat_text
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3609 movff POSTINC0,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3610 movff POSTINC0,hi
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3611 call TFT_convert_signed_16bit ; convert lo:hi into signed-short and adds '-' to POSTINC2 if required
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3612 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3613 output_16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3614 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3615 return
544
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3616
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3617 ENDIF ; _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3618
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3619
0
heinrichsweikamp
parents:
diff changeset
3620 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
3621 ; ppO2 menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3622
0
heinrichsweikamp
parents:
diff changeset
3623 global divesets_ppo2_min
heinrichsweikamp
parents:
diff changeset
3624 divesets_ppo2_min:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3625 lfsr FSR1,tPPO2MIN
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3626 call strcat_text
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3627 movff char_I_ppO2_min,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3628 movlw ppo2_warning_low_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3629 bra divesets_ppo2_common
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3630
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3631
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3632 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3633
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3634 global divesets_ppo2_min_cc
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3635 divesets_ppo2_min_cc:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3636 lfsr FSR1,tPPO2MINCC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3637 call strcat_text
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3638 movff char_I_ppO2_min_loop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3639 movlw ppo2_warning_loop_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3640 bra divesets_ppo2_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3641
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3642 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3643
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3644 global divesets_ppo2_max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3645 divesets_ppo2_max:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3646 lfsr FSR1,tPPO2Max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3647 call strcat_text
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3648 movff char_I_ppO2_max_work,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3649 movlw ppo2_warning_high_default
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3650 bra divesets_ppo2_common
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3651
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3652 global divesets_ppo2_max_deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3653 divesets_ppo2_max_deco:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3654 lfsr FSR1,tPPO2DECO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3655 call strcat_text
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3656 movff char_I_ppO2_max_deco,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3657 movlw ppo2_warning_deco_default
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3658 ;bra divesets_ppo2_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3659
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3660 divesets_ppo2_common:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3661 movwf up ; save default value
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3662 clrf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3663 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3664 output_16dp d'3'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3665 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3666 lfsr FSR1,tbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3667 call strcat_text
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3668 movf up,W ; default value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3669 cpfseq lo ; current value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3670 bra divesets_ppo2_common2 ; not default, add *
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3671 return ; default, done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3672 divesets_ppo2_common2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3673 PUTC "*"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3674 return ; done
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3675
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3676 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3677
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3678 global TFT_clear_message_window
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3679 TFT_clear_message_window:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3680 btfss divemode ; in dive mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3681 bra TFT_clear_message_window_surf ; NO - clear surface mode area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3682 ;bra TFT_clear_message_window_dive ; YES - clear dive mode area
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3683
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3684 TFT_clear_message_window_dive:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3685 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3686 bra TFT_clear_message_window_dive_2 ; YES - clear dive mode area, 2nd row only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3687 ; NO - clear dive mode area, both rows
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3688 WIN_BOX_BLACK dm_warning_row, dm_warning_bot, dm_warning_column, dm_warning_rgt ; top, bottom, left, right
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3689 return ; - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3690
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3691 TFT_clear_message_window_surf:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3692 WIN_BOX_BLACK surf_warning1_row, surf_warning2_row+.24, surf_warning1_column, surf_warning1_column+.76 ; top, bottom, left, right
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3693 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3694
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3695
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3696 global TFT_clear_message_window_row2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3697 TFT_clear_message_window_row2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3698 btfss divemode ; in dive mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3699 bra TFT_clear_message_window_surf_2 ; NO - clear surface mode area, 2nd row only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3700 ;bra TFT_clear_message_window_dive_2 ; YES - clear dive mode area, 2nd row only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3701
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3702 TFT_clear_message_window_dive_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3703 WIN_BOX_BLACK dm_warning2_row, dm_warning2_bot, dm_warning2_column, dm_warning2_rgt ; top, bottom, left, right
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3704 bcf message_2nd_row_used ; - 2nd row is clear now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3705 return ; - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3706
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3707 TFT_clear_message_window_surf_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3708 WIN_BOX_BLACK surf_warning2_row, surf_warning2_row+.24, surf_warning2_column, surf_warning2_column+.76 ; top, bottom, left, right
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3709 bcf message_2nd_row_used ; 2nd row is clear now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3710 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3711
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3712
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3713 global TFT_fillup_with_spaces
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3714 TFT_fillup_with_spaces: ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3715 movwf lo ; save max. string length into lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3716 movf FSR2L,W ; get current string length
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3717 subwf lo,F ; lo-WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3718 btfsc STATUS,N ; longer then #lo already?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3719 return ; YES - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3720 tstfsz lo ; zero?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3721 bra TFT_fillup_with_spaces2 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3722 return ; YES - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3723 TFT_fillup_with_spaces2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3724 PUTC " " ; add one space
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3725 decfsz lo,F ; all done?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3726 bra TFT_fillup_with_spaces2 ; NO - loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3727 return ; YES - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3728
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3729 ;=============================================================================
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3730
0
heinrichsweikamp
parents:
diff changeset
3731 global TFT_desaturation_time
heinrichsweikamp
parents:
diff changeset
3732 TFT_desaturation_time:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3733 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3734 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3735 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3736 call TFT_memo_color
0
heinrichsweikamp
parents:
diff changeset
3737 STRCPY "Desat:"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3738 MOVII int_O_desaturation_time,mpr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3739 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3740 movf lo,W ; swap hi and lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3741 movff hi,lo ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3742 movwf hi ; ...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3743 output_99x ; hours
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3744 PUTC ':'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3745 movff hi,lo ; minutes
0
heinrichsweikamp
parents:
diff changeset
3746 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3747 movlw surf_warning_length ; only use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3748 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3749 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
3750 return
heinrichsweikamp
parents:
diff changeset
3751
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3752
0
heinrichsweikamp
parents:
diff changeset
3753 global TFT_nofly_time
heinrichsweikamp
parents:
diff changeset
3754 TFT_nofly_time:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3755 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3756 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3757 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3758 call TFT_memo_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3759 movff char_I_altitude_wait,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3760 tstfsz WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3761 bra TFT_nofly_time_1
0
heinrichsweikamp
parents:
diff changeset
3762 STRCPY "NoFly:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3763 bra TFT_nofly_time_2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3764 TFT_nofly_time_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3765 STRCPY "NoAlt:"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3766 TFT_nofly_time_2:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3767 MOVII int_O_nofly_time,mpr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3768 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3769 movf lo,W ; swap hi and lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3770 movff hi,lo ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3771 movwf hi ; ...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3772 output_99x ; hours
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3773 PUTC ':'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3774 movff hi,lo ; minutes
0
heinrichsweikamp
parents:
diff changeset
3775 output_99x
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3776 movlw surf_warning_length ; only use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3777 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3778 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
3779 return
heinrichsweikamp
parents:
diff changeset
3780
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3781 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3782
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3783 global TFT_warning_agf
0
heinrichsweikamp
parents:
diff changeset
3784 TFT_warning_agf:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3785 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3786 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3787 return ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3788 call TFT_attention_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3789 STRCPY_TEXT tDiveaGF_active ; "aGF!"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3790 movlw dm_warning_length ; dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3791 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3792 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3793 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3794
0
heinrichsweikamp
parents:
diff changeset
3795
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3796 global TFT_warning_fallback
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3797 TFT_warning_fallback: ; show fallback warning
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3798 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3799 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3800 return ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3801 call TFT_warning_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3802 STRCPY_TEXT tDiveFallback ; "Fallback!"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3803 movlw dm_warning_length ; dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3804 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3805 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3806 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3807
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3808 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3809
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3810 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3811
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3812 global TFT_advice_switch
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3813 TFT_advice_switch:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3814 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3815 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3816 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3817 call TFT_advice_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3818 STRCPY_TEXT tswap ; "Swap Tank"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3819 movlw dm_warning_length ; dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3820 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3821 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3822 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3823
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3824 global TFT_attention_transmitter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3825 TFT_attention_transmitter:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3826 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3827 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3828 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3829 call TFT_attention_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3830 STRCPY_TEXT tTransmitter ; "P.Transm."
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3831 movlw dm_warning_length ; dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3832 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3833 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3834 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3835
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3836 global TFT_attention_pres_reading
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3837 global TFT_warning_pres_reading
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3838 TFT_attention_pres_reading: ; entry point for attention
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3839 call TFT_attention_color ; use attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3840 bra TFT_common_pres_reading ; continue with common code
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3841 TFT_warning_pres_reading: ; entry point for warning
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3842 call TFT_warning_color ; use warnings color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3843 ;bra TFT_common_pres_reading ; continue with common code
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3844 TFT_common_pres_reading:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3845 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3846 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3847 return ; NO - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3848 STRCPY_TEXT tPressure ; "Tank Pres"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3849 movlw dm_warning_length ; dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3850 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3851 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3852 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3853
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3854 global TFT_attention_sac
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3855 TFT_attention_sac:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3856 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3857 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3858 return ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3859 MOVII int_O_SAC_measured,mpr ; copy measured SAC rate to hi:lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3860 call TFT_color_code_tank_pres_sac; color-code the output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3861 STRCPY_TEXT tSAC ; "SAC", needs to be exactly 3 chars long
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3862 STRCAT ": " ; ": "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3863 output_16_3 ; print as xxx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3864 PUTC " " ; print a dummy char to have string termination at the correct place
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3865 movff buffer+.7,buffer+.8 ; move decimal digit one position to the right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3866 movlw "." ; load coding of a decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3867 movff WREG,buffer+.7 ; place it before decimal digit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3868 STRCAT_PRINT "" ; dump buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3869 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3870
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3871 ENDIF ; _rx_functions
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3872
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3873 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3874
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3875 global TFT_info_deco
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3876 TFT_info_deco ; show info when decompression obligation is steady or decreasing
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3877 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3878 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3879 return ; NO - return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3880 call TFT_advice_color ; YES - actually it is a memo, but we break the rules here and display in advice color (green)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3881 STRCPY_TEXT tDecoInfo ; - write "Deco Zone"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3882 movlw dm_warning_length ; - select dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3883 rcall TFT_fillup_with_spaces ; - fill up FSR2 with spaces (total string length in #WREG)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3884 STRCAT_PRINT "" ; - print buffer
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3885 bra TFT_warn_att_info_exit ; - and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3886
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3887 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3888
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3889 IFDEF _cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3890
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3891 global TFT_info_cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3892 TFT_info_cave_mode:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3893 rcall TFT_set_message_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3894 tstfsz WREG ; is there room for the message?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3895 return ; NO - return
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3896 call TFT_memo_color ; YES - set memo color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3897 STRCPY_TEXT tCaveMode ; write "Cave Mode"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3898 movlw dm_warning_length ; select dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3899 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3900 STRCAT_PRINT "" ; print buffer
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3901 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3902
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3903 global TFT_info_dive_turned
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3904 TFT_info_dive_turned:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3905 rcall TFT_set_message_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3906 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3907 return ; NO - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3908 call TFT_attention_color ; YES - set attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3909 STRCPY_TEXT tDiveTurned ; write "Dv.turned"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3910 movlw dm_warning_length ; select dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3911 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3912 STRCAT_PRINT "" ; print buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3913 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3914
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3915 global TFT_warn_cave_shutdown
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3916 TFT_warn_cave_shutdown:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3917 rcall TFT_set_message_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3918 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3919 return ; NO - return
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3920 call TFT_warning_color ; YES - set warning color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3921 STRCPY_TEXT tCaveModeShutdown ; write "X-Cave-X"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3922 movlw dm_warning_length ; select dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3923 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3924 STRCAT_PRINT "" ; print buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3925 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3926
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3927 ENDIF ; _cave_mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3928
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3929 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3930
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3931 global TFT_warning_sat
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3932 TFT_warning_sat ; Saturation
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3933 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3934 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3935 return ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3936 MOVII int_O_lead_supersat,mpr ; bank-safe copy of leading tissue's supersaturation
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3937 call TFT_color_code_gf ; color-code output
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3938 ; STRCPY "GF: " ; the two spaces are on purpose to align the output with other warnings' outputs
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3939 STRCPY_TEXT tSAT ; print "Sat:"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3940 PUTC " " ; add a space to align the output with other warnings' outputs
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3941 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3942 output_8 ; print value of lo only, int_O_lead_supersat is limited to 255
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3943 PUTC "%"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3944 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3945 btfss divemode ; in dive mode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3946 movlw surf_warning_length ; NO - use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3947 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3948 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3949 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3950 bcf win_invert
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3951 TFT_warn_att_info_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3952 goto TFT_standard_color ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3953
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3954
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3955 global TFT_warning_mbubbles
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3956 TFT_warning_mbubbles:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3957 rcall TFT_set_message_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3958 tstfsz WREG ; is there room for the message?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3959 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3960 call TFT_attention_color ; set attention color as default
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3961 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3962 btfsc WREG,mbubble_warning ; are we in the microbubbles zone right now?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3963 call TFT_warning_color ; YES - reconfigure to warning color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3964 STRCPY_TEXT tMicroBubbles
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3965 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3966 btfss divemode ; in dive mode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3967 movlw surf_warning_length ; NO - use surface string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3968 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3969 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3970 bra TFT_warn_att_info_exit ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3971
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3972
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3973 global TFT_warning_outside
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3974 TFT_warning_outside:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3975 rcall TFT_set_message_window ; sets the row and column for the current warning
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3976 tstfsz WREG ; is there room for the message?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3977 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3978 call TFT_attention_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3979 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3980 btfsc WREG,outside_warning ; are we outside the ZH-L16 model right now?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3981 call TFT_warning_color ; YES - reconfigure to warning color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3982 STRCPY "X-ZHL16-X"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3983 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3984 btfss divemode ; in dive mode?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3985 movlw surf_warning_length ; NO - use surface string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3986 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3987 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3988 bra TFT_warn_att_info_exit ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3989
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3990
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3991 global TFT_warning_depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3992 TFT_warning_depth:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3993 rcall TFT_set_message_window ; sets the row and column for the current warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3994 tstfsz WREG ; is there room for the message?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3995 return ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3996 call TFT_warning_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3997 STRCPY_TEXT tMaxDepth ; "max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3998 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3999 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in WREG)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4000 STRCAT_PRINT ""
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4001 bra TFT_warn_att_info_exit ; and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4002
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4003
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4004 global TFT_warning_gas_needs_warn
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4005 TFT_warning_gas_needs_warn:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4006 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4007 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4008 return ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4009 call TFT_warning_color ; YES - set warning color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4010 bra TFT_warning_gas_needs_com ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4011
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4012 global TFT_warning_gas_needs_att
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4013 TFT_warning_gas_needs_att:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4014 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4015 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4016 return ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4017 call TFT_attention_color ; YES - set attention color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4018 ;bra TFT_warning_gas_needs_com ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4019
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4020 TFT_warning_gas_needs_com:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4021 STRCPY_TEXT tGasNeedsWarn ; print "Gas Needs"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4022 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4023 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in WREG)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4024 STRCAT_PRINT "" ; finalize output
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4025 bra TFT_warn_att_info_exit ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4026
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4027 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4028
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4029 IFDEF _helium
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4030
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4031 global TFT_warning_IBCD
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4032 TFT_warning_IBCD:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4033 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4034 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4035 return ; NO
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4036 call TFT_attention_color ; select attention color as default
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4037 STRCPY_TEXT tIBCD ; "IBCD N2He"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4038 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4039 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4040 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4041 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4042
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4043 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4044
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4045 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4046
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4047 global TFT_warning_no_BO_gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4048 TFT_warning_no_BO_gas:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4049 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4050 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4051 return ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4052 call TFT_warning_color ; select warning color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4053 STRCPY_TEXT tnoBOgas ; print "-B/O-Gas-"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4054 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4055 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in WREG)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4056 STRCAT_PRINT "" ; finalize output
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4057 bra TFT_warn_att_info_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4058
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4059
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4060 global TFT_advice_gas_change
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4061 TFT_advice_gas_change:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4062 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4063 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4064 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4065 call TFT_advice_color ; set advice color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4066 STRCPY_TEXT tgaschange ; "Change?"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4067 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4068 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in WREG)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4069 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4070 bra TFT_warn_att_info_exit ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4071
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4072 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4073
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4074 IFDEF _external_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4075
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4076 global TFT_warning_sensor_disagree
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4077 TFT_warning_sensor_disagree: ; show sensor disagree warning
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4078 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4079 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4080 return ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4081 call TFT_warning_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4082 STRCPY_TEXT tSensorDisagree ; "Sensors<>"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4083 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4084 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4085 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4086 bra TFT_warn_att_info_exit ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4087
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4088 ENDIF ; _external_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4089
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4090 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4091
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4092 TFT_set_message_window: ; set the row and column for the current message
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4093 ; ignore warning (now)?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4094 decf message_counter,W ; load (message counter - 1) into WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4095 bcf STATUS,C ; clear carry bit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4096 btfss alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4097 rrcf WREG,W ; NO - divide (message_counter-1) by 2 to get the page of the message
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4098 cpfseq message_page ; page of the message = current page ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4099 retlw .255 ; NO - do not show in this cycle (message window is not defined)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4100 btfss divemode ; YES - in dive mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4101 bra TFT_set_message_window_sf ; NO - setup for surface mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4102 ;bra TFT_set_message_window_dm ; YES - setup for dive mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4103
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4104 ; Dive Mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4105 TFT_set_message_window_dm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4106 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4107 bra TFT_set_message_window_dm_row2 ; YES - alternative layout only uses 2nd row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4108 btfss message_counter,0 ; NO - is the message number uneven?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4109 bra TFT_set_message_window_dm_row2 ; NO - use 2nd row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4110 ;bra TFT_set_message_window_dm_row1 ; YES - use 1st row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4111
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4112 TFT_set_message_window_dm_row1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4113 WIN_SMALL dm_warning1_column, dm_warning1_row ; set output position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4114 bcf message_2nd_row_used ; flag that the 2nd does not contain a message yet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4115 retlw .0 ; show in this cycle (message window is defined)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4116
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4117 TFT_set_message_window_dm_row2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4118 WIN_SMALL dm_warning2_column, dm_warning2_row ; set output position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4119 bsf message_2nd_row_used ; flag that the 2nd row contains a message now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4120 retlw .0 ; show in this cycle (message window is defined)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4121
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4122 ; Surface Mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4123 TFT_set_message_window_sf:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4124 btfss message_counter,0 ; is the message counter uneven?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4125 bra TFT_set_message_window_sf_row2 ; NO - use 2nd row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4126 ;bra TFT_set_message_window_sf_row1 ; YES - use 1st row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4127
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4128 TFT_set_message_window_sf_row1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4129 WIN_SMALL surf_warning1_column,surf_warning1_row ; set output position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4130 bcf message_2nd_row_used ; flag that the 2nd row does not contain a message yet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4131 retlw .0 ; show in this cycle (message window is defined)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4132
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4133 TFT_set_message_window_sf_row2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4134 WIN_SMALL surf_warning2_column,surf_warning2_row ; set output position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4135 bsf message_2nd_row_used ; flag that the 2nd row contains a message now
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4136 retlw .0 ; show in this cycle (message window is defined)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4137
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4138
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4139 global TFT_msg_batt_percent_divemode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4140 TFT_msg_batt_percent_divemode:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4141 rcall TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4142 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4143 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4144 movff batt_percent,lo ; get battery percent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4145 call TFT_color_code_battery ; color-code battery percent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4146 STRCPY "Batt:"
0
heinrichsweikamp
parents:
diff changeset
4147 bsf leftbind
heinrichsweikamp
parents:
diff changeset
4148 output_8
heinrichsweikamp
parents:
diff changeset
4149 bcf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4150 PUTC "%"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4151 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4152 btfss divemode ; in dive mode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4153 movlw surf_warning_length ; NO - use surface string length
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4154 rcall TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4155 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4156 bcf win_invert
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4157 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4158
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4159
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4160 global TFT_gf_factors_mask ; mask for GF factors
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4161 TFT_gf_factors_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4162 call TFT_divemask_color
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4163 WIN_TINY dm_custom_gf_column1,dm_custom_gf_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4164 STRCPY_TEXT_PRINT tGFactors
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4165 WIN_TINY dm_custom_gf_column3,dm_custom_gf_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4166 STRCPY_TEXT_PRINT taGFactors
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4167 ; Show GF (static)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4168 call TFT_disabled_color ; default to disabled color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4169 btfss use_aGF ; shall use alternative GF factors?
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4170 call TFT_memo_color ; NO - switch to memo color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4171 WIN_STD dm_custom_gf_column1, dm_custom_gf_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4172 bsf leftbind
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4173 movff opt_GF_low,lo ; get normal GF low
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4174 output_8 ; print normal GF low
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4175 PUTC "/" ; print "/"
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4176 movff opt_GF_high,lo ; get normal GF high
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4177 output_8 ; print normal GF high
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4178 STRCAT_PRINT "" ; finish output
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4179 ; Show aGF (static)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4180 call TFT_memo_color ; default to memo color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4181 TSTOSS opt_enable_aGF ; are alternative GF factors enabled?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4182 bra TFT_gf_factors_mask_3 ; NO - show "---" and return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4183 ; YES - show aGF and which one is active
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4184 WIN_STD dm_custom_gf_column2, dm_custom_gf_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4185 btfss use_aGF ; shall use aGF?
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4186 bra TFT_gf_factors_mask_1 ; NO - print "<- "
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4187 STRCPY_PRINT " ->" ; YES - print " ->"
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4188 bra TFT_gf_factors_mask_2 ; - continue with common part
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4189 TFT_gf_factors_mask_1:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4190 STRCPY_PRINT "<- " ; (NO) - print "<- "
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4191 TFT_gf_factors_mask_2: ; common part
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4192 btfss use_aGF ; shall use aGF?
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4193 call TFT_disabled_color ; NO - switch to disabled color
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4194 WIN_STD dm_custom_gf_column3, dm_custom_gf_row
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4195 movff opt_aGF_low,lo ; get aGF low
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4196 output_8 ; print
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4197 PUTC "/" ; print "/"
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4198 movff opt_aGF_high,lo ; get aGF high
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4199 output_8 ; print
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4200 STRCAT_PRINT "" ; finish output
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4201 bra TFT_custview_exit1 ; done
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4202 TFT_gf_factors_mask_3:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4203 WIN_STD dm_custom_gf_column3+.10, dm_custom_gf_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4204 STRCPY_PRINT "---"
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4205 bra TFT_custview_exit1 ; done
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4206
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4207
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4208 global TFT_ceiling_GF_tissue_mask ; mask for ceiling, current GF and tissues
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4209 TFT_ceiling_GF_tissue_mask:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4210 call TFT_divemask_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4211 WIN_TINY dm_custom_ceiling_column+.2,dm_custom_ceiling_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4212 STRCPY_TEXT_PRINT tCeiling
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4213 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4214 STRCPY_TEXT_PRINT tDiveTissues
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4215 WIN_TINY dm_custom_gf_column1+.5, dm_custom_gf_title_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4216 STRCPY_TEXT_PRINT tGFInfo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4217 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4218
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4219
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4220 global TFT_ceiling_GF_tissue ; data for ceiling, current GF and tissues
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4221 TFT_ceiling_GF_tissue:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4222 WIN_MEDIUM dm_custom_ceiling_column,dm_custom_ceiling_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4223 MOVII int_O_ceiling,mpr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4224 call TFT_color_code_ceiling ; color-code the output
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4225 call adjust_depth_with_salinity ; compute salinity setting into hi:lo [mbar]
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4226 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4227 TSTOSS opt_units ; 0=m, 1=ft
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4228 bra TFT_ceiling_tissue_cGF_m
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4229 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4230 output_16 ; yxz
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4231 bra TFT_ceiling_tissue_cGF0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4232 TFT_ceiling_tissue_cGF_m:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4233 bsf ignore_digit5 ; no cm (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4234 output_16dp .3 ; yxz.a
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4235 TFT_ceiling_tissue_cGF0:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4236 bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4237 STRCAT_PRINT " "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4238 ; Show tissue diagram
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4239 call TFT_dive_tissues ; show tissue pressure diagram
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4240 ; Show current supersaturation
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4241 WIN_MEDIUM dm_custom_clock_column+.3, dm_custom_gf_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4242 MOVII int_O_lead_supersat,mpr ; bank-safe copy of leading tissue's supersaturation
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4243 call TFT_color_code_gf ; color-code output
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4244 output_8 ; need to print lo only, int_O_lead_supersat value is limited to 255
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4245 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4246 WIN_STD dm_custom_clock_column+.40, dm_custom_gf_row+.5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4247 STRCAT_PRINT "%" ; % is printed in color set by TFT_color_code_gf, too
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4248 TFT_custview_exit1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4249 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4250 goto TFT_standard_color ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4251
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4252
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4253 global TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4254 TFT_clock_batt_surfpress_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4255 call TFT_divemask_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4256 WIN_TINY dm_custom_clock_column, dm_custom_clock_title_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4257 STRCPY_TEXT_PRINT tTime ; "Time"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4258 WIN_TINY dm_custom_battery_column, dm_custom_battery_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4259 STRCPY_TEXT_PRINT tBattery ; "Battery"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4260 WIN_TINY dm_custom_surfpres_column+.8, dm_custom_surfpres_title_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4261 STRCPY_TEXT_PRINT tSurface ; "Surface"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4262 ; Show configured Surface Pressure (done in mask, because it's static during the dive)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4263 call TFT_standard_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4264 WIN_SMALL dm_custom_surfpres_column, dm_custom_surfpres_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4265 MOVII pressure_surf,mpr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4266 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4267 PUTC ' '
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4268 STRCAT_TEXT_PRINT tMBAR ; mbar (hPa)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4269 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4270
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4271
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4272 global TFT_clock_batt_surfpress ; data for clock, battery and surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4273 TFT_clock_batt_surfpress:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4274 ; Update Clock
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4275 WIN_SMALL dm_custom_clock_column, dm_custom_clock_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4276 call TFT_standard_color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4277 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4278 movff rtc_latched_hour,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4279 output_99
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4280 PUTC ':'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4281 movff rtc_latched_mins,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4282 output_99x
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4283 PUTC ":"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4284 movff rtc_latched_secs,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4285 output_99x
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4286 STRCAT_PRINT ""
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4287 ; Show Battery Volt
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4288 call TFT_memo_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4289 WIN_SMALL dm_custom_battery_column, dm_custom_battery_volt_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4290 MOVII batt_voltage,mpr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4291 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4292 output_16dp .2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4293 PUTC 'V'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4294 movff buffer+5,buffer+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4295 movlw 0x00
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4296 movff WREG,buffer+5 ; only "x.yzV"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4297 STRCAT_PRINT ""
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4298 ; Show Battery Percent
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4299 WIN_SMALL dm_custom_battery_column+.7, dm_custom_battery_percent_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4300 movff batt_percent,lo ; get battery percent
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4301 call TFT_color_code_battery ; color-code battery percent
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4302 output_8
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4303 STRCAT "% "
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4304 movlw 0x00
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4305 movff WREG,buffer+4 ; only "xxx%"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4306 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4307 ; Surface pressure is shown in mask because it is static
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4308 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4309
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4310 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4311
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4312 IFDEF _ccr_pscr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4313
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4314 global TFT_pscr_info_mask ; mask for pSCR info
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4315 TFT_pscr_info_mask:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4316 rcall TFT_show_ppo2_mask
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4317 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4318 WIN_TINY dm_custom_pscr_drop_column, dm_custom_pscr_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4319 STRCPY_TEXT_PRINT tPSCR_O2_drop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4320 WIN_TINY dm_custom_pscr_ratio_column, dm_custom_pscr_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4321 STRCPY_TEXT_PRINT tPSCR_lungratio
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4322 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4323
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4324
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4325 global TFT_pscr_info ; data for pSCR info
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
4326 TFT_pscr_info:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4327 ;show ppO2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4328 WIN_MEDIUM dm_custom_ppo2_column,dm_custom_ppo2_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4329 MOVII int_O_pSCR_ppO2,mpr ; copy pSCR ppO2 to hi:lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4330 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4331 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4332 output_16dp .3 ; x.xx bar
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4333 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4334 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4335 ; Show drop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4336 WIN_STD dm_custom_pscr_drop_column+.11,dm_custom_pscr_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4337 call TFT_memo_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4338 movff char_I_PSCR_drop,lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4339 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4340 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4341 STRCAT_PRINT "%"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4342 ; Show lung ratio
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4343 WIN_STD dm_custom_pscr_ratio_column+.5,dm_custom_pscr_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4344 movff char_I_PSCR_lungratio,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4345 bsf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4346 STRCPY "1/"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4347 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4348 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4349 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4350
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4351 ENDIF ; _ccr_psrc
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4352
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4353 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4354
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4355 global TFT_gas_needs_ascent_mask ; mask for gas needs ascent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4356 TFT_gas_needs_ascent_mask:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4357 WIN_TINY dm_custom_gas_column_title, dm_custom_gas_mask_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4358 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4359 IFDEF _cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4360 movff char_O_deco_info,WREG ; get the deco info vector
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4361 btfss WREG,gas_needs_cave ; are the gas needs calculated for cave mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4362 bra TFT_gas_needs_mask_ascent_1 ; NO - show as direct ascent needs
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4363 bsf gas_needs_mode_last ; YES - remember last results were for cave mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4364 STRCPY_TEXT tGasNeedsCaveMode ; - "Gas Needs Cave Mode"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4365 bra TFT_gas_needs_mask_ascent_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4366 TFT_gas_needs_mask_ascent_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4367 bcf gas_needs_mode_last ; remember last results were for direct ascent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4368 STRCPY_TEXT tGasNeedsAscent ; "Gas Needs Ascent"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4369 TFT_gas_needs_mask_ascent_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4370 ELSE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4371 STRCPY_TEXT tGasNeedsAscent ; "Gas Needs Ascent"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4372 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4373 STRCAT_PRINT " (bar)" ; " (bar)"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4374 bra TFT_custview_exit1 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4375
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4376
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4377 global TFT_gas_needs_ascent ; data for gas needs ascent
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4378 TFT_gas_needs_ascent: ; LIMITATION: there is only space for 4 gases on the screen - if 5 gases have a pres_need > 0, then only the first 4 will be shown!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4379 IFDEF _cave_mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4380 movff char_O_deco_info,WREG ; get deco info vector
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4381 btfss WREG,gas_needs_cave ; are the gas needs calculated for cave mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4382 bra TFT_gas_needs_ascent_1 ; NO - continue below...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4383 btfsc gas_needs_mode_last ; YES - were the last results calculated for cave mode?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4384 bra TFT_gas_needs_ascent_3 ; YES - mask still valid
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4385 bra TFT_gas_needs_ascent_2 ; NO - redraw mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4386 TFT_gas_needs_ascent_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4387 btfss gas_needs_mode_last ; NO - were the last results calculated for direct ascent?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4388 bra TFT_gas_needs_ascent_3 ; YES - mask still valid
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4389 ;bra TFT_gas_needs_ascent_2 ; NO - redraw mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4390 TFT_gas_needs_ascent_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4391 rcall TFT_gas_needs_ascent_mask ; redraw mask
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4392 TFT_gas_needs_ascent_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4393 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4394 clrf up ; initialize gas index (0-4)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4395 WIN_SMALL dm_custom_gas_column1+.5,dm_custom_gas_row1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4396 rcall TFT_gas_needs_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4397 WIN_SMALL dm_custom_gas_column1+.5,dm_custom_gas_row2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4398 rcall TFT_gas_needs_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4399 WIN_SMALL dm_custom_gas_column2+.5,dm_custom_gas_row1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4400 rcall TFT_gas_needs_helper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4401 WIN_SMALL dm_custom_gas_column2+.5,dm_custom_gas_row2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4402 rcall TFT_gas_needs_helper
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4403 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4404
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4405 TFT_gas_needs_helper:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4406 call TFT_memo_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4407 movlw .5 ; number of gases
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4408 cpfslt up ; check if all gases have been processed
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4409 bra TFT_gas_needs_helper_1 ; YES - clear display area
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4410 movf up,W ; NO - get gas number and check if need of that gas is > 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4411 rlncf WREG,W ; multiply by 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4412 incf WREG,W ; add 1 to address high byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4413 lfsr FSR1,int_O_gas_need_pres ; load base of gas needs in pressure
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4414 movff PLUSW1,hi ; read HIGH(int_O_gas_need_pres[up])
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4415 btfss hi,int_is_zero ; check flag for pres_need == 0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4416 bra TFT_gas_needs_helper_2 ; NO - print gas type and pressure needed
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4417 incf up,F ; YES - increment to next gas...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4418 bra TFT_gas_needs_helper ; ...and try the next gas
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4419 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
4420 STRCAT_PRINT " ---- " ; overwrite outdated stuff if screen position is not needed
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4421 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4422 TFT_gas_needs_helper_2: ; output gas type and pressure needed
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4423 movf up,W ; get gas number (0-4) to WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4424 lfsr FSR1,opt_gas_O2_ratio ; read opt_gas_O2_ratio[WREG]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4425 movff PLUSW1,lo ; copy result to lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4426 lfsr FSR1,opt_gas_He_ratio ; read opt_gas_He_ratio[WREG]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4427 movff PLUSW1,hi ; copy result to hi
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4428 call gaslist_show_mix ; print "Air", "O2", "21/35", etc.
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4429 PUTC ':' ; ":"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4430 movf up,W ; get gas number (0-4) to WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4431 rlncf WREG,W ; multiply by 2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4432 lfsr FSR1,int_O_gas_need_pres ; load base of gas needs in pressure
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4433 movff PLUSW1,lo ; read LOW(int_O_gas_need_pres[up])
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4434 incf WREG,W ; add 1 to address high byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4435 movff PLUSW1,hi ; read HIGH(int_O_gas_need_pres[up])
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4436 btfsc hi,int_attention_flag ; check if attention flag is set (pres_need > pres_fill * threshold)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4437 call TFT_attention_color ; YES - print gas need in attention color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4438 btfsc hi,int_warning_flag ; check if warning flag is set (pres_need > pres_fill)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4439 call TFT_warning_color ; YES - print gas need in warning color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4440 movff int_O_gas_need_pres+1,WREG ; get HIGH(int_O_gas_need_pres[0]) which holds flag for invalid data
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4441 btfsc WREG,int_invalid_flag ; check if invalid data flag is set
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4442 call TFT_disabled_color ; YES - print gas need in disabled color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4443 bcf hi,int_attention_flag ; clear flag for attention
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4444 bcf hi,int_warning_flag ; clear flag for warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4445 bcf hi,int_high_flag ; clear flag for > 999 bar
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4446 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
4447 output_16_3 ; limit to 999 and display only (0-999)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4448 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
4449 incf up,F ; increment to next gas
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4450 bra TFT_custview_exit2 ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4451
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4452
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4453 global TFT_show_ppo2_mask ; helper function for several custom views
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4454 TFT_show_ppo2_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4455 call TFT_divemask_color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4456 IFDEF _ccr_pscr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4457 btfss FLAG_ccr_mode ; in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4458 bra TFT_mask_ppo2a ; NO - continue checking for pSCR and OC
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4459 btfsc bailout_mode ; YES - in bailout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4460 bra TFT_mask_ppo2b ; YES
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4461 WIN_TINY dm_custom_ppo2_column-.2,dm_custom_ppo2_title_row ; tuned position for longer text (-8 = on leftmost edge of display)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4462 STRCPY_TEXT_PRINT tppO2Dil ; NO - print "ppO2(Dil)"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4463 bra TFT_custview_exit2 ; - and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4464 TFT_mask_ppo2a:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4465 btfss FLAG_pscr_mode ; in pSCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4466 bra TFT_mask_ppo2b ; NO - continue with OC mode (or bailout)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4467 btfsc bailout_mode ; YES - in bailout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4468 bra TFT_mask_ppo2b ; YES
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4469 WIN_TINY dm_custom_ppo2_column-.2,dm_custom_ppo2_title_row ; tuned position for longer text (-8 = on leftmost edge of display)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4470 STRCPY_TEXT_PRINT tppO2Mix ; NO - print "ppO2(Mix)"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4471 bra TFT_custview_exit2 ; - and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4472 ENDIF
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4473 TFT_mask_ppo2b: ; OC mode or bailout
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4474 WIN_TINY dm_custom_ppo2_column-.2, dm_custom_ppo2_title_row ; normal position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4475 STRCPY_TEXT_PRINT tppO2 ; in all other modes
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4476 bra TFT_custview_exit2 ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4477
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4478
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4479 global TFT_ppo2_ead_end_cns_mask ; mask for ppO2, END/EAD and CNS / gas density
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4480 TFT_ppo2_ead_end_cns_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4481 call TFT_divemask_color
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4482 WIN_TINY dm_custom_ppo2_column-.2, dm_custom_ppo2_title_row
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4483 STRCPY_TEXT_PRINT tppO2
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4484 WIN_TINY dm_custom_ead_column, dm_custom_eadend_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4485 STRCPY_TEXT_PRINT tDiveEAD_END
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4486 IFDEF _helium
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4487 WIN_TINY dm_custom_cns_column-.5, dm_custom_eadend_title_row
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4488 STRCPY_TEXT_PRINT tGasDensity
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4489 ELSE
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4490 WIN_TINY dm_custom_cns_column, dm_custom_cns_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4491 STRCPY_TEXT_PRINT tCNS2
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4492 ENDIF
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4493 bra TFT_custview_exit2 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4494
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4495
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4496 global TFT_ppo2_ead_end_cns ; data for ppO2, END/EAD and CNS / gas density
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
4497 TFT_ppo2_ead_end_cns:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4498 ; Show ppO2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4499 WIN_MEDIUM dm_custom_ppo2_column, dm_custom_ppo2_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4500 MOVII int_O_breathed_ppO2,mpr ; copy ppO2 of the currently breathed gas to hi:lo
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4501 call TFT_color_code_ppo2 ; color-code output
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4502 bsf leftbind
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4503 output_16dp .3 ; x.xx bar
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4504 bcf leftbind
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4505 STRCAT_PRINT ""
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 605
diff changeset
4506 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4507 ; Show END/EAD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4508 WIN_SMALL dm_custom_ead_column, dm_custom_ead_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4509 STRCPY_TEXT tEAD ; EAD:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4510 movff char_O_EAD,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4511 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
4512 WIN_SMALL dm_custom_end_column, dm_custom_end_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4513 STRCPY_TEXT tEND ; END:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4514 movff char_O_END,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4515 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4516 IFDEF _helium
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4517 ; Show Gas Density
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4518 WIN_MEDIUM dm_custom_cns_column-.5, dm_custom_cns_row
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4519 MOVII int_O_gas_density,mpr ; get current gas density
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4520 call TFT_color_code_cns_1 ; color-code output
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4521 bsf leftbind ; print left-aligned
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4522 movlw .2 ; suppress first and second digit
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4523 movwf ignore_digits ; ...
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4524 output_16dp .2 ; print as --x.yy
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4525 bcf leftbind ; back to normal alignment
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4526 STRCAT_PRINT "" ; finalize output
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4527 ELSE
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4528 ; Show CNS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4529 WIN_STD dm_custom_cns_column+.3, dm_custom_cns_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4530 MOVII int_O_CNS_current,mpr ; get current CNS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4531 call TFT_color_code_cns ; color-code CNS output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4532 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4533 output_16_3 ; displays only 0...999
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4534 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4535 STRCAT_PRINT "%"
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
4536 ENDIF
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4537 TFT_custview_exit2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4538 goto TFT_standard_color ; and return...
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4539
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4540 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
4541 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4542 TSTOSS opt_units ; 0=Meter, 1=Feet
0
heinrichsweikamp
parents:
diff changeset
4543 bra TFT_end_ead_common_metric
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4544 TFT_end_ead_common_imperial:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4545 movf lo,W ; with lo in m
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4546 mullw .100 ; PRODL:PRODH = mbar/min
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4547 MOVII PRODL,mpr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4548 call convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4549 output_16_3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4550 STRCAT_TEXT tFeets
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4551 clrf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4552 movff WREG,buffer+.8 ; limit string length to 8
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4553 bra TFT_end_ead_common_exit
0
heinrichsweikamp
parents:
diff changeset
4554 TFT_end_ead_common_metric:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4555 output_8
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4556 STRCAT_TEXT tMeters
0
heinrichsweikamp
parents:
diff changeset
4557 TFT_end_ead_common_exit:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4558 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4559 movlw .8
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4560 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4561 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4562 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4563
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4564 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4565
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4566 IFDEF _ccr_pscr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4567
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4568 global TFT_sensor_check_mask ; mask for sensor check
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4569 TFT_sensor_check_mask:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4570 call TFT_divemask_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4571 WIN_TINY dm_custom_s_check_title_column, dm_custom_s_check_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4572 STRCPY_TEXT_PRINT tSensorCheck
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4573 WIN_TINY dm_custom_ppO2_column, dm_custom_s_check_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4574 STRCPY_TEXT_PRINT tppO2O2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4575 WIN_TINY dm_custom_ppDil_column, dm_custom_s_check_title_row
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4576 STRCPY_TEXT_PRINT tppO2Dil
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4577 bra TFT_sensor_check_exit ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4578
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4579
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4580 global TFT_sensor_check ; data for sensor check
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4581 TFT_sensor_check:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4582 ; Show ppO2 of O2 in this depth
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4583 WIN_MEDIUM dm_custom_ppO2_column, dm_custom_s_check_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4584 MOVII int_O_O2_ppO2,mpr ; copy ppO2 of pure O2 to hi:lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4585 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4586 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4587 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4588 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4589 STRCAT_PRINT ""
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4590 ; Show ppO2 of the diluent in this depth
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4591 WIN_MEDIUM dm_custom_ppDil_column, dm_custom_s_check_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4592 MOVII int_O_pure_ppO2,mpr ; copy ppO2 of pure gas to hi:lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4593 call TFT_color_code_ppo2 ; color-code output
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4594 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4595 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4596 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4597 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4598 TFT_sensor_check_exit:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4599 bra TFT_custview_exit2 ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4600
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4601 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4602
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4603 ;=============================================================================
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4604
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4605 global TFT_surface_lastdive
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4606 TFT_surface_lastdive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4607 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4608 STRCAT_TEXT_PRINT tLastDive ; "Last Dive:"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4609 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4610 STRCAT_TEXT_PRINT tDivetime ; "Divetime:"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4611 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4612 STRCAT_TEXT_PRINT tMaxDepth ; "Max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4613 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)+.5
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4614 STRCAT_TEXT_PRINT tAvgDepth ; "Average"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4615
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4616 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4617 SMOVII int_O_desaturation_time,mpr ; ISR-safe copy of the desaturation time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4618 movf mpr+0,W ; get low byte into WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4619 iorwf mpr+1,W ; inclusive-or with high byte, check if desaturation time is zero
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4620 bz TFT_surface_lastdive_1 ; YES - show last dive time
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4621 ; NO - show surface interval
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4622 SMOVII surface_interval,mpr ; - ISR-safe copy of surface interval
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4623 call convert_time ; - convert hi:lo in minutes to hours (up:hi) and minutes (lo)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4624 movf hi,W ; - swap hi and lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4625 movff lo,hi ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4626 movwf lo ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4627 bsf leftbind ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4628 output_99x ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4629 PUTC 'h' ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4630 movff hi,lo ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4631 output_99x ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4632 STRCAT_PRINT "m " ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4633 bra TFT_surface_lastdive_2 ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4634 TFT_surface_lastdive_1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4635 SMOVFF lastdive_time,xC ; ISR-safe copy of lastdive_time:4 to xC:4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4636 call info_menu_uptime_com ; use part of info_menu_uptime to convert and display in days and hours
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4637 TFT_surface_lastdive_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4638 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.1)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4639 MOVII lastdive_duration,mpr ; get duration of last dive, minutes
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4640 bsf leftbind ; print without leading spaces
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4641 output_16 ; dive time minutes
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4642 PUTC ":" ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4643 movff lastdive_duration+2,lo ; get duration of last dive, seconds
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4644 output_99x ; print seconds
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4645 rcall TFT_surface_common ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4646 TFT_surface_lastdive_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4647 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.2)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4648 MOVII lastdive_maxdepth,mpr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4649 bsf leftbind ; print without leading spaces
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4650 TSTOSS opt_units ; 0=Meter, 1=Feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4651 bra TFT_surface_lastdive_metric ; 0 - metric
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4652 rcall TFT_surface_imperial ; 1 - imperial
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4653 bra TFT_surface_lastdive_4 ; - continue
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4654 TFT_surface_lastdive_metric:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4655 rcall TFT_surface_metric ; print depth in meters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4656 TFT_surface_lastdive_4:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4657 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.3)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4658 MOVII lastdive_avgdepth,mpr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4659 bsf leftbind ; print without leading spaces
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4660 TSTOSS opt_units ; 0=Meter, 1=Feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4661 bra TFT_surface_metric ; 0 - metric and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4662 ;bra TFT_surface_imperial ; 1 - imperial and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4663
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4664 TFT_surface_imperial:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4665 rcall convert_mbar_to_feet ; convert value in hi:lo from mbar to feet
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4666 output_16_3 ; limit to 999 and display only (0-999)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4667 STRCAT_TEXT tFeets1 ; "ft"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4668 bra TFT_surface_common ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4669 TFT_surface_metric:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4670 bsf ignore_digit5 ; no cm (flag will be cleared by output_16)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4671 movlw .1 ; no 1000 meters
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4672 movwf ignore_digits ; ...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4673 output_16dp .3 ; xxx.y
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4674 STRCAT_TEXT tMeters ; "m"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4675 TFT_surface_common:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4676 STRCAT_PRINT "" ; finalize output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4677 bcf leftbind ; clear left-alignment
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4678 return ; done
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4679
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4680 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4681
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4682 global TFT_surface_tissues
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4683 TFT_surface_tissues: ; show tissue diagram in surface mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4684
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4685 ; draw outer frame
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4686 WIN_FRAME_STD surf_tissue_diagram_top, surf_tissue_diagram_bottom, surf_tissue_diagram_left, surf_tissue_diagram_right
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4687
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4688 ;---- draw labels --------------------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4689
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4690 call TFT_standard_color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4691 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4692 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4693 TSTOSS opt_tissue_graphics ; shall show N2+He or pressure and saturation?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4694 bra TFT_surface_tissues_1 ; =0: show pressures and saturations
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4695 ; =1: show N2 and He pressures
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4696 STRCPY_TEXT_PRINT tN2 ; print "N2"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4697 WIN_SMALL surf_tissue_He_column,surf_tissue_He_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4698 STRCPY_TEXT_PRINT tHe ; print "He"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4699 bra TFT_surface_tissues_2 ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4700 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4701 TFT_surface_tissues_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4702 STRCPY_TEXT_PRINT tDiveTissues ; print "Tissues"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4703 TFT_surface_tissues_2:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4704 ;---- draw scale ---------------------------------- ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4705 movlw color_deepblue
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4706 call TFT_set_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4707
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4708 SCALELINE macro x
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4709 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,surf_tissue_diagram_left+.4+x,surf_tissue_diagram_left+.4+x
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4710 endm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4711
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4712 SCALELINE .0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4713 SCALELINE .8
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4714 SCALELINE .16
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4715 SCALELINE .24
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4716 SCALELINE .32
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4717 SCALELINE .40
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4718 SCALELINE .48
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4719 SCALELINE .56
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4720 SCALELINE .64
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4721 SCALELINE .72
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4722 SCALELINE .80
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4723
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4724 ;---- common initialization for Tissue Pressures and Saturation ----------
0
heinrichsweikamp
parents:
diff changeset
4725 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4726 movwf win_height ; hight of the bargraph (0-239)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4727 movlw surf_tissue_diagram_left+.4 ; left start position for N2 bars
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4728 movwf win_leftx2 ; column left (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4729 movlw surf_tissue_diagram_right-surf_tissue_diagram_left-.4 ; get max width for N2 bars (78 pixel)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4730 movwf win_width+0 ; set width of the bar box
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4731 clrf win_width+1 ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4732 movlw color_white ; color for tissues not exceeding surface max pressure
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4733 movwf ex ; store in ex
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4734 movlw color_red ; color for tissues exceeding surface max pressure
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4735 movwf ul ; store in ul
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4736 bcf aux_flag ; draw tissue pressures by default
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4737
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4738 ;---- Draw combined or N2 Tissue Pressures--------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4739 lfsr FSR2,char_O_tissue_pressure ; load base address of combined pressures by default
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4740 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4741 TSTOSC opt_tissue_graphics ; shall show N2+He or pressure and saturation?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4742 lfsr FSR2,char_O_tissue_pres_N2 ; =1: load base address of N2 pressures
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4743 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4744 movlw d'16'
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4745 movwf lo ; tissue counter, 16 tissues
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4746 clrf hi ; row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4747 TFT_surf_tissues_N2_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4748 movlw surf_tissue_diagram_top+.23 ; surface mode top start position N2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4749 rcall TFT_surf_tissues_bargraph ; show one tissue
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4750 movlw .2 ; bargraph spacing
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4751 addwf hi,F ; increment row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4752 decfsz lo,F ; decrement tissue counter, done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4753 bra TFT_surf_tissues_N2_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4754 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4755 TSTOSC opt_tissue_graphics ; shall show N2+He or pressure and saturation?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4756 bra TFT_surface_tissues_3 ; =1: show He tissue pressures
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4757 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4758
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4759 ;---- Draw Tissue Saturations --------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4760 lfsr FSR2,char_O_tissue_saturation ; load base address of tissue supersaturation
0
heinrichsweikamp
parents:
diff changeset
4761 movlw d'16'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4762 movwf lo ; tissue counter, 16 tissues
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4763 clrf hi ; row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4764 movlw color_grey ; color for tissue saturation
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4765 movwf ex ; store in ex
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4766 ; movlw color_yellow ; 2nd color is not used by tissue saturation
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4767 ; movwf ul ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4768 bsf aux_flag ; draw tissue saturation
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4769 TFT_surf_tissues_sat_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4770 movlw surf_tissue_diagram_top+.23+.57 ; surface mode top start position saturations
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4771 rcall TFT_surf_tissues_bargraph ; draw tissue bargraph
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4772 movlw .2 ; bargraph spacing
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4773 addwf hi,F ; increment row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4774 decfsz lo,F ; decrement tissue counter, done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4775 bra TFT_surf_tissues_sat_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4776
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4777 ;---- common Part for vertical lines--------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4778 movlw surf_tissue_diagram_top+.23+.57 ; get top position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4779 movwf win_top ; set top position (0-239)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4780 movlw .30 ; get hight
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4781 movwf win_height ; set height
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4782 movlw .1 ; get width
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4783 movwf win_width+0 ; set width, low byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4784 clrf win_width+1 ; set width, high byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4785
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4786 ;---- Print 100% Line ----------------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4787 movlw surf_tissue_diagram_left+.4+.64 ; get left position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4788 movwf win_leftx2 ; set left position (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4789 movlw color_red ; color for 100% line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4790 call TFT_set_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4791 call TFT_box ; draw line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4792
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4793 ; GF factors enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4794 TSTOSS char_I_deco_model ; GF factors enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4795 bra TFT_surface_tissues_4 ; NO - continue with CNS
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4796
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4797 ;---- Print GF low Line -------------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4798 movlw surf_tissue_diagram_left+.4 ; get left base position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4799 movwf win_leftx2 ; set left base position (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4800 movff opt_GF_low,WREG ; get GF low in 0.01 %
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4801 mullw .164 ; multiply with 164
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4802 movf PRODH,W ; divide by 256 -> resulting scale factor is 164/256 = 0.640625
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4803 addwf win_leftx2,F ; add to base position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4804 movlw color_green ; color for 100% line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4805 call TFT_set_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4806 call TFT_box ; draw line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4807
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4808 ;---- Print GF high Line -------------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4809 movlw surf_tissue_diagram_left+.4 ; get left base position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4810 movwf win_leftx2 ; set left base position (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4811 movff opt_GF_high,WREG ; get GF high in 0.01 %
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4812 mullw .164 ; multiply with 164
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4813 movf PRODH,W ; divide by 256 -> resulting scale factor is 164/256 = 0.640625
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4814 addwf win_leftx2,F ; add to base position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4815 movlw color_yellow ; color for 100% line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4816 call TFT_set_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4817 call TFT_box ; draw line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4818 bra TFT_surface_tissues_4 ; continue with CNS
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4819
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4820 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4821 TFT_surface_tissues_3:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4822 ;---- Draw He Tissue Pressures--------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4823 movlw surf_tissue_diagram_left+.4+.16 ; start position for He bars
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4824 movwf win_leftx2 ; column left (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4825 movlw surf_tissue_diagram_right-surf_tissue_diagram_left-.4-.16 ; max width for He bars
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4826 movwf win_width+0 ; set total width of the bar box
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4827 clrf win_width+1 ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4828 lfsr FSR2,char_O_tissue_pres_He ; load base address of He pressures
0
heinrichsweikamp
parents:
diff changeset
4829 movlw d'16'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4830 movwf lo ; tissue counter, 16 tissues
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4831 clrf hi ; row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4832 TFT_surf_tissues_He_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4833 movlw surf_tissue_diagram_top+.23+.57 ; surface mode top start position He
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4834 rcall TFT_surf_tissues_bargraph ; show one tissue
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4835 movlw .2 ; bargraph spacing
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4836 addwf hi,F ; increment row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4837 decfsz lo,F ; decrement tissue counter, done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4838 bra TFT_surf_tissues_He_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4839 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4840
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4841 TFT_surface_tissues_4:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4842 ; ---- Draw CNS% ---------------------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4843 WIN_SMALL surf_tissue_He_column+.22,surf_tissue_He_row ; position in-between tissue bars
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4844 MOVII int_O_CNS_current,mpr ; get current CNS
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4845 call TFT_color_code_cns ; color-code CNS value
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4846 STRCPY_TEXT tCNS2 ; "CNS:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4847 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4848 output_16_3 ; display only 0...999
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4849 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4850 STRCAT_PRINT "%"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4851 goto TFT_standard_color ; and return...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4852
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4853 TFT_surf_tissues_bargraph:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4854 addwf hi,W ; add row number to start position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4855 movwf win_top ; set as row top (0-239)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4856 movff POSTINC2,up ; get tissue value
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4857 movf ex,W ; default color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4858 btfsc up,7 ; check if flag in bit 7 is set
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4859 movf ul,W ; YES - switch to 2nd color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4860 call TFT_set_color ; set bargraph bar color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4861 bcf up,7 ; clear flag bit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4862 btfss aux_flag ; drawing saturations?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4863 rlncf up,F ; NO - multiply with 2 (previously cleared bit 7 will be rotated to bit 0)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4864 incf up,W ; add 1 for a minimum visible bar (He-bars could be invisible else-wise)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4865 movwf win_bargraph ; set length of the bargraph
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4866 goto TFT_box ; draw bargraph and return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4867
0
heinrichsweikamp
parents:
diff changeset
4868
heinrichsweikamp
parents:
diff changeset
4869 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4870 ; Draw saturation graph in dive mode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4871
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4872 TFT_dive_tissues:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4873 ;---- Draw Frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
4874 call TFT_standard_color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4875 WIN_FRAME_COLOR16 dm_custom_tissue_diagram_top, dm_custom_tissue_diagram_bottom, dm_custom_tissue_diagram_left, .159 ; outer frame
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4876
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4877 ;---- clear area showing leading tissue number as it may not be printed over
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4878 WIN_BOX_BLACK dm_custom_tissue_diagram_top+.16, dm_custom_tissue_diagram_top+.16+.10, dm_custom_tissue_diagram_left+.32, dm_custom_tissue_diagram_left+.32+.8 ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
4879
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4880 ;---- common initialization for Tissue Pressures and Saturation ----------
0
heinrichsweikamp
parents:
diff changeset
4881 movlw .1
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4882 movwf win_height ; hight of the bargraph (0-239)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4883 movlw dm_custom_tissue_diagram_left+.3 ; get dive mode left start position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4884 movwf win_leftx2 ; set column left (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4885 movlw .159-dm_custom_tissue_diagram_left-.4 ; get max width
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4886 movwf win_width+0 ; set width (low byte)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4887 clrf win_width+1 ; high byte of with is always zero
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4888 movlw color_cyan ; color for tissues with decreasing pressure
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4889 movwf ex ; store in ex
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4890 movlw color_orange ; color for tissues with increasing pressure
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4891 movwf ul ; store in ul
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4892
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4893 ;---- Draw combined or N2 Tissue Pressures -------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4894 lfsr FSR2,char_O_tissue_pressure ; load base address of combined pressures by default
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4895 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4896 TSTOSC opt_tissue_graphics ; shall show N2+He or pressure and saturation?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4897 lfsr FSR2,char_O_tissue_pres_N2 ; =1: load base address of N2 pressures
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4898 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4899 movlw d'16'
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4900 movwf lo ; tissue counter, 16 tissues
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4901 clrf hi ; row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4902 TFT_dive_tissues_N2_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4903 movlw dm_custom_tissue_diagram_top+.3 ; dive mode top start position N2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4904 rcall TFT_dive_tissues_bargraph ; draw tissue bargraph
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4905 incf hi,F ; increment row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4906 decfsz lo,F ; decrement tissue counter, done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4907 bra TFT_dive_tissues_N2_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4908 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4909 TSTOSC opt_tissue_graphics ; shall show N2+He or pressure and saturation?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4910 bra TFT_dive_tissues_3 ; =1: show He tissue pressures
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4911 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4912
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4913 ;---- Draw Tissue Saturations --------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4914 lfsr FSR2,char_O_tissue_saturation ; load base address of tissue supersaturation
0
heinrichsweikamp
parents:
diff changeset
4915 movlw d'16'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4916 movwf lo ; tissue counter, 16 tissues
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4917 clrf hi ; row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4918 movlw color_grey ; color for tissue saturation, alternative: color_lightblue
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4919 movwf ex ; store in ex
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4920 ; movlw color_yellow ; 2nd color is not used by tissue saturation
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4921 ; movwf ul ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4922 TFT_dive_tissues_sat_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4923 movlw dm_custom_tissue_diagram_top+.3+.22 ; dive mode top start position saturations
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4924 rcall TFT_dive_tissues_bargraph ; draw tissue bargraph
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4925 incf hi,F ; increment row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4926 decfsz lo,F ; decrement tissue counter, done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4927 bra TFT_dive_tissues_sat_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4928
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4929 ;---- common Part for vertical lines--------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4930 movlw dm_custom_tissue_diagram_top+.3+.22 ; get top position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4931 movwf win_top ; set top position (0-239)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4932 movlw .15 ; get hight
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4933 movwf win_height ; set height
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4934 movlw .1 ; get width
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4935 movwf win_width+0 ; set width, low byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4936 clrf win_width+1 ; set width, high byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4937
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4938 ;---- Print 100% Line ----------------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4939 movlw dm_custom_tissue_diagram_left+.3+.33 ; get left position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4940 movwf win_leftx2 ; set left position (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4941 movlw color_red ; color for 100% line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4942 call TFT_set_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4943 call TFT_box ; draw line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4944
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4945 ; GF factors enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4946 TSTOSS char_I_deco_model ; GF factors enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4947 bra TFT_dive_tissues_4 ; NO - continue with number of leading tissue
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4948
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4949 ;---- Print GF low Line -------------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4950 movlw dm_custom_tissue_diagram_left+.3 ; get left base position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4951 movwf win_leftx2 ; set left base position (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4952 movff char_I_GF_Low_percentage,WREG ; get GF low in 0.01 %
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4953 mullw .82 ; multiply with 82
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4954 movf PRODH,W ; divide by 256 -> resulting scale factor is 82/256 = 0.3203125
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4955 addwf win_leftx2,F ; add to base position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4956 movlw color_green ; color for 100% line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4957 call TFT_set_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4958 call TFT_box ; draw line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4959
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4960 ;---- Print GF high Line -------------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4961 movlw dm_custom_tissue_diagram_left+.3 ; get left base position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4962 movwf win_leftx2 ; set left base position (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4963 movff char_I_GF_High_percentage,WREG ; get GF high in 0.01 %
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4964 mullw .82 ; multiply with 82
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4965 movf PRODH,W ; divide by 256 -> resulting scale factor is 82/256 = 0.3203125
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4966 addwf win_leftx2,F ; add to base position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4967 movlw color_yellow ; color for 100% line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4968 call TFT_set_color ; set color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4969 call TFT_box ; draw line
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4970 bra TFT_dive_tissues_4 ; continue with number of leading tissue
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4971
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4972 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4973 TFT_dive_tissues_3:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4974 ;---- Draw He Tissues Pressures ------------------- ;
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4975 movlw dm_custom_tissue_diagram_left+.3+.4 ; get dive mode left start position for He bars
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4976 movwf win_leftx2 ; set column left (0-159)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4977 movlw .159-dm_custom_tissue_diagram_left-.4-.4 ; get max width for He bars
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4978 movwf win_width+0 ; set width (low byte)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4979 clrf win_width+1 ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4980 lfsr FSR2,char_O_tissue_pres_He ; load base address of He pressures
0
heinrichsweikamp
parents:
diff changeset
4981 movlw d'16'
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4982 movwf lo ; tissue counter, 16 tissues
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4983 clrf hi ; row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4984 TFT_dive_tissues_He_loop:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4985 movlw dm_custom_tissue_diagram_top+.3+.22 ; dive mode top start position H2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4986 rcall TFT_dive_tissues_bargraph ; draw tissue bargraph
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4987 incf hi,F ; increment row counter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4988 decfsz lo,F ; decrement tissue counter, done?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4989 bra TFT_dive_tissues_He_loop ; NO - loop
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4990 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4991
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4992 TFT_dive_tissues_4:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4993 ;---- Print Number of leading Tissue -------------- ; TODO: some flicker due to overwriting by tissue bars
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4994 movff int_O_lead_supersat+0,WREG ; get current leading tissue's supersaturation (only low byte used for value)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4995 tstfsz WREG ; current supersaturation = 0 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4996 bra TFT_dive_tissues_5 ; NO - print number of leading tissue
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4997 movff char_O_deco_info,WREG ; YES - get deco info vector
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4998 btfss WREG,deco_ceiling ; - do we have a ceiling obligation?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4999 goto TFT_standard_color ; NO - can ascent directly, don't print number, set standard color and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5000 ; YES - print number of leading tissue
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5001 TFT_dive_tissues_5:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5002 movff char_O_lead_tissue,lo ; get number of leading tissue as 0-15
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5003 incf lo,F ; adjust to 1-16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5004 movlw .10
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5005 cpfsgt lo ; is it > 10 ?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5006 bra TFT_dive_tissues_6 ; NO - will output a single digit number
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5007 ; start position for a 2 digit number
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5008 WIN_TINY dm_custom_tissue_diagram_left+.32,dm_custom_tissue_diagram_top+.10
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5009 bra TFT_dive_tissues_7
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5010 TFT_dive_tissues_6:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5011 ; start position for a 1 digit number
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5012 WIN_TINY dm_custom_tissue_diagram_left+.32+.4,dm_custom_tissue_diagram_top+.10
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5013 TFT_dive_tissues_7:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5014 call TFT_standard_color ; set output color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5015 bsf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5016 output_8 ; print number in left aligned, i.e. without leading zeros or spaces
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5017 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5018 STRCAT_PRINT "" ; finalize output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5019 return
0
heinrichsweikamp
parents:
diff changeset
5020
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5021 TFT_dive_tissues_bargraph:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5022 addwf hi,W ; add row number to start position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5023 movwf win_top ; set as row top (0-239)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5024 movff POSTINC2,up ; get tissue value
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5025 movf ex,W ; default color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5026 btfsc up,7 ; check if flag in bit 7 is set
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5027 movf ul,W ; YES - switch to 2nd color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5028 call TFT_set_color ; set bargraph bar color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5029 bcf up,7 ; clear flag bit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5030 bcf STATUS,C ; clear carry bit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5031 rrcf up,F ; divide by 2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5032 incf up,W ; add a bit for a minimum visible bar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5033 movwf win_bargraph ; set bargraph bar length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5034 goto TFT_box ; draw bargraph and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5035
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5036 ;=============================================================================
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
5037
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5038 global TFT_show_cns
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5039 TFT_show_cns:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5040 call TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5041 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5042 return ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5043 STRCPY_TEXT tCNS ; CNS:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5044 MOVII int_O_CNS_current,mpr ; get current CNS
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5045 call TFT_color_code_cns ; color-code CNS output
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5046 bsf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5047 output_16_3 ; displays only 0...999
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5048 bcf leftbind
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5049 PUTC "%"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5050 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5051 btfss divemode ; In dive mode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5052 movlw surf_warning_length ; NO - use surface string length
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5053 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in WREG)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5054 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5055 bcf win_invert
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5056 bra TFT_custview_exit3 ; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5057
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5058
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5059 global TFT_warning_eod_cns
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5060 TFT_warning_eod_cns:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5061 call TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5062 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5063 return ; NO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5064 call TFT_warning_color ; switch to warnings (red) text color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5065 STRCPY_TEXT tCNSeod ; end-of-dive CNS warning text
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5066 movlw dm_warning_length ; dive mode string length
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5067 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in WREG)
0
heinrichsweikamp
parents:
diff changeset
5068 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5069 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5070
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5071
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5072 global TFT_show_ppo2_warning
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5073 TFT_show_ppo2_warning: ; with ppO2 including attention/warning flags in hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5074 call TFT_set_message_window ; set the row and column for the current message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5075 tstfsz WREG ; is there room for the message?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5076 return ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5077 call TFT_color_code_ppo2 ; color-code output
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5078 btfsc bailout_mode ; in bailout?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5079 bra TFT_display_diluent_2 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5080 btfss FLAG_ccr_mode ; in CCR mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5081 bra TFT_display_diluent_1 ; NO - continue with pSCR or OC
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5082 STRCPY_TEXT tdil ; YES - print "Dil:"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5083 bra TFT_display_diluent_3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5084 TFT_display_diluent_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5085 btfss FLAG_pscr_mode ; in pSCR mode?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5086 bra TFT_display_diluent_2 ; NO - continue with OC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5087 STRCPY_TEXT tmix ; YES - print "Mix:"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5088 bra TFT_display_diluent_3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5089 TFT_display_diluent_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5090 STRCPY_TEXT tppO2 ; bailout or OC mode, print "ppO2:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5091 TFT_display_diluent_3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5092 bsf leftbind
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5093 output_16dp .3 ; x.xx bar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5094 bcf leftbind
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5095 movlw dm_warning_length ; dive mode string length
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5096 call TFT_fillup_with_spaces ; fill up FSR2 with spaces (total string length in #WREG)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5097 STRCAT_PRINT ""
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5098 TFT_custview_exit3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5099 goto TFT_standard_color ; and return...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5100
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5101
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5102 IFDEF _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5103
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5104 global TFT_surf_set_bearing
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5105 TFT_surf_set_bearing:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5106 btfsc compass_menu ; is the "set bearing" selection shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5107 return ; YES - return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5108 bsf compass_menu ; NO - set "set bearing" selection as shown
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5109 WIN_BOX_BLACK surf_compass_bear_row,surf_warning1_row-1, surf_compass_bear_column, surf_decotype_column-.1 ; top, bottom, left, right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5110 WIN_SMALL surf_compass_bear_column,surf_compass_bear_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5111 WIN_COLOR color_yellow
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5112 bsf win_invert
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5113 STRCPY_TEXT_PRINT tSetHeading ; 7 chars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5114 bcf win_invert
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5115 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5116
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5117 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5118
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5119 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5120
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5121 global TFT_LogOffset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5122 TFT_LogOffset:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5123 STRCPY_TEXT tLogOffsetValue ; print "Offset" in selected language
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5124 call do_logoffset_common_read ; read offset into lo:hi
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5125 ; bsf leftbind
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5126 output_16_4 ; print offset in 4 digits
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5127 ; bcf leftbind
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5128 return ; no "_PRINT" here...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5129
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5130 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5131 ; RX Functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5132
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5133 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5134
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5135 global TFT_pressures_SAC_mask ; mask for pressures and SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5136 TFT_pressures_SAC_mask:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5137 call TFT_divemask_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5138 ; pressure reading 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5139 WIN_TINY dm_custom_tankdata_pres1_col, dm_custom_tankdata_mask_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5140 movff char_I_pressure_gas+0,WREG ; =0: disabled, =1..10: gases/dils
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5141 bcf aux_flag ; selector for disabled / need set to disabled
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5142 call TFT_pressures_SAC_mask_helper ; print gas composition or " ---" if disabled
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5143 ; pressure reading 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5144 WIN_TINY dm_custom_tankdata_pres2_col, dm_custom_tankdata_mask_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5145 movff char_I_pressure_gas+1,WREG ; =0: need to reading 1, =1..10: gases/dils
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5146 bsf aux_flag ; selector for disabled / need set to need
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5147 call TFT_pressures_SAC_mask_helper ; print gas composition or "Need " if 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5148 ; SAC rate
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5149 WIN_TINY dm_custom_tankdata_SAC_col, dm_custom_tankdata_mask_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5150 STRCPY_TEXT tSAC ; "SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5151 STRCAT " (" ; (
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5152 STRCAT_TEXT tLitersMinute ; l/min
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5153 STRCAT_PRINT ")" ; )"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5154 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5155
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5156 TFT_pressures_SAC_mask_helper:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5157 tstfsz WREG ; pressure reading assigned?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5158 bra TFT_dive_tankdata_mask_helper_1 ; YES - print gas composition
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5159 btfsc aux_flag ; NO - check auxiliary flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5160 bra TFT_dive_tankdata_mask_helper_2 ; 1 - print "Need "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5161 STRCAT_PRINT " ---" ; 0 - print " ---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5162 return ; - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5163 TFT_dive_tankdata_mask_helper_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5164 decf WREG,W ; (1..10) -> (0..9)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5165 bsf short_gas_descriptions ; just "Air", "O2" or "xx/yy"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5166 call gaslist_strcat_gas_WREG ; print composition of gas/dil in WREG (0..9)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5167 bra TFT_dive_tankdata_mask_helper_3 ; finish with adding "(bar)"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5168 TFT_dive_tankdata_mask_helper_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5169 STRCPY_TEXT tNeed ; "Need"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5170 TFT_dive_tankdata_mask_helper_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5171 STRCAT_PRINT "(bar)"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5172 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5173
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5174
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5175 global TFT_pressures_SAC ; data for pressures and SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5176 TFT_pressures_SAC:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5177 ; check mode for second reading
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5178 bcf aux_flag ; clear auxiliary flag by default (reading 2 is pressure)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5179 movff char_I_pressure_gas+1,WREG ; =0: need to reading 1, =1..10: gases/dils
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5180 addlw .0 ; dummy operation to set status register flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5181 btfsc STATUS,Z ; gas selected = 0 (i.e. no 2nd pressure reading) ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5182 bsf aux_flag ; YES - set auxiliary flag (display position of reading 2 shall show need to reading 1)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5183 ; get data of reading 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5184 movff int_IO_pressure_value+0,lo ; copy pressure 1 to hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5185 movff int_IO_pressure_value+1,hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5186 movff char_I_pressure_stat+0,ex ; copy status data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5187 ; pressure of reading 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5188 WIN_STD dm_custom_tankdata_pres1_col+.4,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5189 rcall TFT_pressures_SAC_helper_1 ; print pressure if available, else " ---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5190 ; battery status of reading 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5191 WIN_SMALL dm_custom_hud_sensor1_column+.4+.36,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5192 rcall TFT_pressures_SAC_helper_2 ; print or clear down arrow as low bat indicator
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5193 ; get data for reading 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5194 btfsc aux_flag ; shall reading 2 show need to reading 1 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5195 bra TFT_pressures_SAC_1 ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5196 movff int_IO_pressure_value+2,lo ; NO - copy pressure 2 to hi:lo
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5197 movff int_IO_pressure_value+3,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5198 movff char_I_pressure_stat+1,ex ; - copy status data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5199 bra TFT_pressures_SAC_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5200 TFT_pressures_SAC_1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5201 MOVII int_O_pressure_need,mpr ; YES - copy need to pressure 1 to hi:lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5202 clrf ex ; - set status data to 0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5203 TFT_pressures_SAC_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5204 ; pressure of reading 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5205 WIN_STD dm_custom_tankdata_pres2_col+.2,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5206 rcall TFT_pressures_SAC_helper_1 ; print pressure if available, else " ---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5207 ; battery status of reading 2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5208 WIN_SMALL dm_custom_tankdata_pres2_col+.2+.36,dm_custom_tankdata_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5209 rcall TFT_pressures_SAC_helper_2 ; print or clear down arrow as low bat indicator
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5210 ; SAC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5211 WIN_STD dm_custom_tankdata_SAC_col+.6,dm_custom_tankdata_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5212 MOVII int_O_SAC_measured,mpr ; copy measured SAC rate to hi:lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5213 btfsc hi,int_not_avail_flag ; SAC rate available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5214 bra TFT_pressures_SAC_4 ; NO - print " --.-"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5215 call TFT_color_code_tank_pres_sac ; color-code the output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5216 output_16_3 ; print as xxx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5217 PUTC " " ; print a dummy char to have the string termination at the correct place
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5218 movff buffer+.2,buffer+.3 ; move the decimal digit one position to the right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5219 movlw "." ; load coding of a decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5220 movff WREG,buffer+.2 ; place it before decimal digit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5221 movlw " " ; load coding of a space character
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5222 movff buffer+.1,up ; get the character in front of the decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5223 cpfseq up ; is it a space?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5224 bra TFT_pressures_SAC_3 ; NO - continue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5225 movlw "0" ; YES - load coding of a zero
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5226 movff WREG,buffer+.1 ; - place a zero in front of the decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5227 TFT_pressures_SAC_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5228 STRCAT_PRINT "" ; dump buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5229 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5230 TFT_pressures_SAC_4:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5231 call TFT_disabled_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5232 STRCAT_PRINT "--.-" ; output for no SAC data available
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5233 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5234
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5235 TFT_pressures_SAC_helper_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5236 btfss hi,int_not_avail_flag ; pressure available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5237 bra TFT_pressures_SAC_helper_1a ; YES - print pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5238 call TFT_disabled_color ; NO - use disabled color as default
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
5239 ; btfsc ex,char_transmitter_lost ; - transmitter lost?
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
5240 ; call TFT_attention_color ; YES - use attention color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5241 STRCAT_PRINT " ---" ; - print " ---"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5242 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5243 TFT_pressures_SAC_helper_1a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5244 btfsc hi,int_warning_flag ; out of range (signaled by warning flag)?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5245 bra TFT_pressures_SAC_helper_1c ; YES - special treatment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5246 call TFT_color_code_tank_pres_sac ; NO - color-code the output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5247 bsf ignore_digit5 ; - no 0.1 bar (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5248 movf lo,W ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5249 iorwf hi,W ; - pressure value = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5250 bnz TFT_pressures_SAC_helper_1b ; NO - print value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5251 STRCPY_PRINT " 0" ; YES - print a zero manually
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5252 return ; - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5253 TFT_pressures_SAC_helper_1b:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5254 output_16 ; print hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5255 STRCAT_PRINT "" ; dump buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5256 return ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5257 TFT_pressures_SAC_helper_1c:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5258 call TFT_color_code_tank_pres_sac ; color-code the output (clears all flags)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5259 STRCPY_PRINT ">400" ; print ">400"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5260 return ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5261
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5262 TFT_pressures_SAC_helper_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5263 btfss ex,char_transmitter_low_bat ; low battery flag set?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5264 bra TFT_pressures_SAC_helper_2a ; NO - wipe out down arrow (low bat indicator)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5265 call TFT_attention_color ; YES - use attention color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5266 STRCPY_PRINT "\xb8" ; - print down arrow as bat low indication
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5267 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5268 TFT_pressures_SAC_helper_2a:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5269 STRCPY_PRINT " " ; wipe out down arrow (low bat indicator)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5270 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5271
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5272
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5273 global TFT_menu_tank_pres
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5274 TFT_menu_tank_pres: ; imprinting function for main menu / tank setup
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5275 call TFT_standard_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5276 ; get ID
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5277 lfsr FSR1,opt_transmitter_id_1 ; load base address of opt_transmitter_id
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5278 movf gaslist_gas,W ; get current gas
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5279 rlncf WREG,W ; multiply by 2 because IDs are 2 byte in size
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5280 movff PLUSW1,lo ; copy opt_transmitter_id+0[gaslist_gas] to lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5281 incf WREG,W ; increment index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5282 movff PLUSW1,hi ; copy opt_transmitter_id+1[gaslist_gas] to hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5283 ; show pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5284 WIN_SMALL .90, .61 ; column, row (+/- 27 per row)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5285 call get_pres_by_transmitter_id ; get pressure into hi:lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5286 tstfsz WREG ; do we have valid tank data (WREG=0) ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5287 bra TFT_menu_tank_pres_1 ; NO - transmitter not found
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5288 call TFT_color_code_tank_pres_sac ; set output color according to flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5289 bsf ignore_digit5 ; no 0.1 bar (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5290 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5291 bra TFT_menu_tank_pres_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5292 TFT_menu_tank_pres_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5293 call TFT_disabled_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5294 STRCAT " ---" ; output for no pressure data available
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5295 TFT_menu_tank_pres_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5296 STRCAT_TEXT_PRINT tbar ; " bar"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5297 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5298
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5299
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5300 global TFT_surface_tank_pres
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5301 TFT_surface_tank_pres: ; show pressure reading above surface pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5302 WIN_SMALL surf_decotype_column+.6,surf_decotype_row+.30+.47
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5303 movff int_IO_pressure_value+0,lo ; copy pressure from 1st reading to hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5304 movff int_IO_pressure_value+1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5305 btfss hi,int_not_avail_flag ; pressure reading 1 available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5306 bra TFT_surface_tank_pres_0 ; YES
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5307 movff int_IO_pressure_value+2,lo ; NO - copy pressure from 2nd reading to hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5308 movff int_IO_pressure_value+3,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5309 btfsc hi,int_not_avail_flag ; - pressure reading 2 available?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5310 bra TFT_surface_tank_pres_1 ; NO - show not avail message
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5311 TFT_surface_tank_pres_0: ; YES - show pressure
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5312 call TFT_color_code_tank_pres_sac ; set output color according to flags
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5313 bsf ignore_digit5 ; no 0.1 bar (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5314 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5315 STRCAT_PRINT ""
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5316 bra TFT_surface_tank_pres_2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5317 TFT_surface_tank_pres_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5318 call TFT_disabled_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5319 STRCAT_PRINT " ---" ; output for no pressure data available
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5320 TFT_surface_tank_pres_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5321 WIN_SMALL surf_decotype_column+.38,surf_decotype_row+.30+.47
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5322 call TFT_divemask_color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5323 STRCAT_PRINT "bar" ; can not use tbar because it has a leading space
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5324 bra TFT_custview_exit3 ; and return...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5325
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5326
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5327 global TFT_surface_tankdata
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5328 TFT_surface_tankdata:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5329 lfsr FSR1,rx_buffer ; load base address of RX buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5330 ; bra TFT_surface_tankdata_debug ; comment in for +++ debug version +++
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5331 WIN_SMALL surf_customtext_column,surf_customtext_row1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5332 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5333 WIN_SMALL surf_customtext_column,surf_customtext_row2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5334 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5335 WIN_SMALL surf_customtext_column,surf_customtext_row3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5336 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5337 WIN_SMALL surf_customtext_column,surf_customtext_row4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5338 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5339 WIN_SMALL surf_customtext_column,surf_customtext_row5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5340 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5341 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5342
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5343 TFT_surface_tankdata_print: ; max 12 char
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5344 call TFT_standard_color ; set color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5345 movff POSTINC1,hi ; ID high (+0)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5346 movff POSTINC1,lo ; ID low (+1)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5347 tstfsz hi ; ID high = 0 ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5348 bra TFT_surface_tankdata_print_1 ; NO - slot in use
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5349 tstfsz lo ; ID low = 0?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5350 bra TFT_surface_tankdata_print_1 ; NO - slot in use
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5351 STRCAT_PRINT "---- " ; YES - mark as unused and clear rest of line from previous remains
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5352 movf POSTINC1,W ; - dummy read (+2) to advance index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5353 movf POSTINC1,W ; - dummy read (+3) to advance index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5354 movf POSTINC1,W ; - dummy read (+4) to advance index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5355 bra TFT_surface_tankdata_print_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5356 TFT_surface_tankdata_print_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5357 movf hi,W ; copy ID high to WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5358 output_hex ; 2 chars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5359 movf lo,W ; copy ID low to WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5360 output_hex ; 2 chars (4 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5361 movff POSTINC1,hi ; pressure high (+2)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5362 movff POSTINC1,lo ; pressure low (+3)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5363 call TFT_color_code_tank_pres_sac ; needed to clear the status flags before output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5364 bsf ignore_digit5 ; no 0.1 bar (flag will be cleared by output_16)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5365 output_16 ; 4 chars (8 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5366 PUTC " " ; 1 char (9 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5367 movf POSTINC1,W ; status (+4)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5368 andlw .7 ; mask out battery voltage
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5369 bnz TFT_surface_tankdata_2 ; branch if battery is not completely drained
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5370 call TFT_warning_color ; output in red
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5371 STRCAT_PRINT "XXX" ; "XXX" for low
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5372 bra TFT_surface_tankdata_print_3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5373 TFT_surface_tankdata_2:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5374 addlw .28 ; add offset of 2.8 Volt
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5375 movff WREG,lo ;
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5376 output_99 ; 2 chars (11 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5377 PUTC " " ; dummy char 1 char (12 in total)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5378 movff buffer+.10,buffer+.11 ; move decimal digit of battery voltage one position to the right
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5379 movlw "." ; decimal point
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5380 movff WREG,buffer+.10 ; place it before decimal digit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5381 STRCAT_PRINT "" ; print buffer to screen
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5382 TFT_surface_tankdata_print_3:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5383 movf POSTINC1,W ; dummy read (+5) to advance index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5384 return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5385
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5386
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5387 ; TFT_surface_tankdata_debug: ; surface custom view debug output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5388 ; call TFT_standard_color
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5389 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5390 ; rcall TFT_surface_tankdata_debug_print
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5391 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5392 ; rcall TFT_surface_tankdata_debug_print
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5393 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5394 ; rcall TFT_surface_tankdata_debug_print
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5395 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5396 ; rcall TFT_surface_tankdata_debug_print
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5397 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5398 ; rcall TFT_surface_tankdata_debug_print
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5399 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*5
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5400 ; rcall TFT_surface_tankdata_debug_print
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5401 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*6
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5402 ; rcall TFT_surface_tankdata_debug_print
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5403 ; WIN_TINY surf_customtext_column,surf_customtext_row1+.14*7
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5404 ; rcall TFT_surface_tankdata_debug_print
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5405 ; return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5406
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5407 ; TFT_surface_tankdata_debug_print:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5408 ; movff POSTINC1,hi ; ID high (+0)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5409 ; movff POSTINC1,lo ; ID low (+1)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5410 ; output_16
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5411 ; PUTC ","
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5412 ; movff POSTINC1,hi ; pressure high (+2)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5413 ; movff POSTINC1,lo ; pressure low (+3)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5414 ; call TFT_color_code_tank_pres_sac; needed to clear the status flags before output
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5415 ; output_16
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5416 ; PUTC ","
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5417 ; movff POSTINC1,lo ; status (+4)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5418 ; output_8
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5419 ; PUTC ","
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5420 ; movff POSTINC1,lo ; date (+5)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5421 ; output_8
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5422 ; STRCAT_PRINT ""
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5423 ; return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5424
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5425 ENDIF ; _rx_functions
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5426
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5427 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5428
0
heinrichsweikamp
parents:
diff changeset
5429 global adjust_depth_with_salinity
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5430 global adjust_depth_with_salinity_log
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5431 adjust_depth_with_salinity: ; computes salinity setting into hi:lo [mbar]
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5432 btfsc sensor_override_active ; in pressure sensor override mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5433 return ; YES - do not apply salinity in override mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5434 movff opt_salinity,WREG ; 0-5%
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5435 adjust_depth_with_salinity_log: ; computes salinity setting (FROM WREG!) into hi:lo [mbar]
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5436 addlw d'100' ; 1.00kg/l
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5437 movwf up
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5438
0
heinrichsweikamp
parents:
diff changeset
5439 movlw d'105' ; 105% ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5440 cpfslt up ; salinity upper limit
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5441 return ; out of limit, do not adjust hi:lo
0
heinrichsweikamp
parents:
diff changeset
5442 movlw d'99' ; 99% ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5443 cpfsgt up ; salinity lower limit
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5444 return ; out of limit, do not adjust hi:lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5445
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5446 MOVII mpr, xA ; depth in mbar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5447 MOVLI .102,xB ; 0.98 bar / 10 meter
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5448 call mult16x16 ; xC:4 = xA:2 * xB:2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5449 movff up,xB+0 ; salinity
0
heinrichsweikamp
parents:
diff changeset
5450 clrf xB+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5451 call div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5452 MOVII xC,mpr ; copy corrected values back to hi:lo
0
heinrichsweikamp
parents:
diff changeset
5453 return
heinrichsweikamp
parents:
diff changeset
5454
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5455 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5456
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5457 global convert_mbar_to_feet
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5458 convert_mbar_to_feet: ; convert value in hi:lo from mbar to feet
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5459 MOVII mpr, xA ; depth in mbar (multiples of 0.01 meter)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5460 btfsc sensor_override_active ; in pressure sensor override mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5461 bra convert_mbar_to_feet_1 ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5462 MOVLI .328,xB ; NO - convert with 328feet/100m
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5463 bra convert_common_to_feet ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5464 convert_mbar_to_feet_1:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5465 MOVLI .334,xB ; YES - convert with 334feet/100m to be in sync with values shown in menu
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5466 bra convert_common_to_feet ; - continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5467
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5468
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5469 global convert_meter_to_feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5470 convert_meter_to_feet: ; convert value in lo from meters to feet
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5471 movf lo,W ; depth in meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5472 mullw .100 ; convert meter to mbar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5473 MOVII PRODL,xA ; depth in mbar (multiples of 0.01 meter)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5474 MOVLI .334,xB ; convert with 334feet/100m to have 10ft, 20ft, 30ft for stop depths
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5475
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5476 convert_common_to_feet:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5477 call mult16x16 ; xC = xA * xB = depth in 0.01 meter * xxx feet / 100 meter
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5478 movlw d'50' ; round up
0
heinrichsweikamp
parents:
diff changeset
5479 addwf xC+0,F
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5480 movlw .0
0
heinrichsweikamp
parents:
diff changeset
5481 addwfc xC+1,F
heinrichsweikamp
parents:
diff changeset
5482 addwfc xC+2,F
heinrichsweikamp
parents:
diff changeset
5483 addwfc xC+3,F
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5484 MOVLI .10000,xB ; 10000 = 100 for depth in 0.01 meter to full meter x 100 for feet factor is per 100 meter
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5485 call div32x16 ; xC = xC / xB with xA as remainder
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5486 MOVII xC,mpr ; store result
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5487
0
heinrichsweikamp
parents:
diff changeset
5488 return
heinrichsweikamp
parents:
diff changeset
5489
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5490 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5491
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5492 global convert_celsius_to_fahrenheit ; convert value in hi:lo from Celsius to Fahrenheit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
5493 convert_celsius_to_fahrenheit: ; convert value in lo:hi from Celsius to Fahrenheit
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5494 MOVII mpr,xA ; temperature in 1/10 of °C
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5495 ADDLI .1000,xA ; add offset of 1000 to get out of any negative numbers
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5496 ; adjust scaling: 1°C = 1.8°F:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5497 MOVLI .18,xB ; multiply with 18:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5498 call mult16x16 ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5499 MOVLI .10,xB ; divide by 10
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5500 call div32x16 ; ...
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5501 SUBLI .1480,xC ; remove offset: subtract above offset of 1000 * 1.8 = 1800 now and add 320 => subtract 1480
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
5502 MOVII xC,mpr ; store result in hi:lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
5503 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5504
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
5505 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5506
0
heinrichsweikamp
parents:
diff changeset
5507 END