annotate src/tft_outputs.asm @ 649:ef2ed7e3a895

Merge
author heinrichs weikamp
date Fri, 04 Mar 2022 08:30:23 +0100
parents 357341239438 070528a88715
children bc214815deb2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
3 ; File tft_outputs.asm * combined next generation V3.12.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 "ghostwriter.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
25 #include "customview.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
26 #include "i2c.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
27 #include "calibrate.inc"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
28 #include "gaslist.inc"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
29 #include "rx_ops.inc"
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
30 #include "logbook.inc"
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
31 #include "external_flash.inc"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
32 #include "colorschemes.inc"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
33
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
34
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
35 ;---- external Functions -----------------------------------------------------
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
36
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 ;---- external Texts ---------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
40
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
41 extern tFirmware
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
42 extern tFirmwareDate
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
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
47 extern tSensorC
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
48 extern tSensorD
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
49 extern tUptime
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
50 extern tPPO2MIN
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
51 extern tPPO2Max
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
52 extern tPPO2DECO
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
53 extern tbar
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
54
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
55 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
56 extern tPPO2MINCC
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
57 ENDIF
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
58
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
59 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
60 extern tFirmware_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
61 ENDIF
0
heinrichsweikamp
parents:
diff changeset
62
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
63 IFDEF _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
64 extern tCalX,tCalY,tCalZ
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
65 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
66
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
67
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
68 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
69 pallet_table CODE_PACK 0x09800 ; must be at 0x***00
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
70 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
71
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
72
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
73 pallet_table:
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
74 ; mask disabled memo advice attention warning ; pallet
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
75 ; --------------- ------------------- --------------- --------------- --------------- --------------- --------
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
76 DB color_green, color_lightblue, color_white, color_green, color_yellow, color_red ; standard
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
77 DB color_red, color_dark_red, color_orange, color_greenish, color_pink, color_red ; reddish
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
78 DB color_cyan, color_dark_green, color_green, color_green, color_cyan, color_red ; greenish
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
79 DB color_blue, color_deepblue, color_lightblue,color_greenish, color_orange, color_red ; blueish
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
80
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
81
0
heinrichsweikamp
parents:
diff changeset
82 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
83 tft_out1 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
84 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
85
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
86
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
87 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
88 ; load standard Color Pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
89 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
90 global TFT_load_std_color_pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
91 TFT_load_std_color_pallet:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
92 clrf WREG ; select standard pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
93 bra TFT_load_color_pallet ; load color pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
94
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
95
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
96 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
97 ; load Dive Mode Color Pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
98 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
99 global TFT_load_dive_color_pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
100 TFT_load_dive_color_pallet:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
101 movff opt_dive_color_scheme,WREG ; get color scheme selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
102 ;bra TFT_load_color_pallet ; load color pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
103
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
104
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
105 ; Helper Function - load color pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
106 TFT_load_color_pallet:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
107 mullw .6 ; 6 bytes per pallet, compute pallet offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
108
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
109 movf PRODL,W ; get pallet offset, low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
110 movwf TBLPTRL ; set table pointer, low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
111
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
112 movlw HIGH (pallet_table) ; get start of table, high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
113 movwf TBLPTRH ; set table pointer, high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
114
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
115 movlw UPPER (pallet_table) ; get start of table, upper
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
116 movwf TBLPTRU ; set table pointer, upper
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
117
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
118 lfsr FSR2,pallet_color_mask ; point to first color in pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
119 movlw .6 ; initialize loop counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
120 TFT_load_color_pallet_loop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
121 TBLRD*+ ; read color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
122 movff TABLAT,POSTINC2 ; copy color to pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
123 decfsz WREG ; decrement loop counter, reached zero?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
124 bra TFT_load_color_pallet_loop ; NO - loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
125 return ; YES - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
126
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
127
0
heinrichsweikamp
parents:
diff changeset
128 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
129 tft_out2 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
130 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
131
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
132
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
133 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
134 ; Color-Code a Tank Pressure or SAC Rate
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
135 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
136 ; Input hi:lo pressure / SAC rate
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
137 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
138 TFT_color_code_pres_sac:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
139 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
140 bra TFT_color_code_tank_pres_1 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
141 bcf hi,int_not_avail_flag ; YES - clear not-available flag
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
142 TFT_color_code_tank_pres_0: ; - entry point for outdated flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
143 bcf hi,int_outdated_flag ; - clear outdated flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
144 bcf hi,int_warning_flag ; - clear warning flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
145 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
146 FONT_COLOR_DISABLED ; - set to disabled color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
147 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
148
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
149 TFT_color_code_tank_pres_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
150 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
151 bra TFT_color_code_tank_pres_0 ; YES - handle alike with not-available flag
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
152 btfss hi,int_warning_flag ; NO - is the warning flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
153 bra TFT_color_code_tank_pres_2 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
154 bcf hi,int_attention_flag ; YES - clear attention flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
155 bcf hi,int_warning_flag ; - clear warning flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
156 FONT_COLOR_WARNING ; - select warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
157 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
158
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
159 TFT_color_code_tank_pres_2:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
160 btfss hi,int_attention_flag ; is the attention flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
161 bra TFT_color_code_tank_pres_3 ; NO - set memo color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
162 bcf hi,int_attention_flag ; YES - clear attention flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
163 FONT_COLOR_ATTENTION ; - set to attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
164 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
165
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
166 TFT_color_code_tank_pres_3:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
167 FONT_COLOR_MEMO ; set to memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
168 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
169
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
170
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
171 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
172 ; Color-Code a Gas by its ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
173 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
174 ; Input hi O2% of the gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
175 ; pressure_abs_10 current absolute pressure / 10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
176 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
177 global TFT_color_code_gaslist
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
178 TFT_color_code_gaslist:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
179 ; check for very high ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
180 MOVII pressure_abs_10,xA ; get absolute pressure / 10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
181 movff hi,xB+0 ; get O2%
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
182 clrf xB+1 ; ...
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
183 call mult16x16 ; hi * absolute pressure / 10
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
184 ; check if ppO2 > 6.55 bar
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
185 tstfsz xC+2 ; char_I_O2_ratio * absolute pressure / 10 > 65536, i.e. ppO2 > 6.55 bar ?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
186 bra TFT_color_code_gaslist_warn ; YES - set warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
187
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
188 ; check if ppO2 > 3.30 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
189 btfsc xC+1,7 ; ppO2 > 3.30 bar ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
190 bra TFT_color_code_gaslist_warn ; YES - set warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
191
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
192 ; check for low ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
193 MOVII xC,sub_a ; get ppO2 of the gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
194 movff char_I_ppO2_min,WREG ; get minimum ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
195 mullw d'100' ; compute (minimum ppO2) * 100
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
196 MOVII PRODL,sub_b ; copy result to sub_b
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
197 call cmpU16 ; compare (sub_a - sub_b)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
198 btfsc neg_flag ; lower than ppO2 min?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
199 bra TFT_color_code_gaslist_warn ; YES - set warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
200
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
201 ; check for high ppO2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
202 movff char_O_deco_info,WREG ; bank-safe copy of deco info vector
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
203 btfsc WREG,deco_mode ; are we in deco?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
204 bra TFT_color_code_gaslist_deco ; YES - check against ppO2 max deco only
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
205
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
206 ; check for ppO2 max travel/normal
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
207 movff char_I_ppO2_max_work,WREG ; ppo2 max during working phase
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
208 mullw d'100' ; char_I_ppO2_max_work*100
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
209 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
210 MOVII PRODL,sub_b ; copy result to sub_b
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
211 call cmpU16 ; compare (sub_a - sub_b)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
212 btfss neg_flag ; higher than ppO2 max travel/deco?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
213 FONT_COLOR_ATTENTION ; YES - set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
214 ;bra TFT_color_code_gaslist_deco ; continue checking against max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
215
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
216 ; check for ppO2 max deco
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
217 TFT_color_code_gaslist_deco:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
218 movff char_I_ppO2_max_deco,WREG ; ppo2 max for deco
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
219 mullw d'100' ; char_I_ppO2_max_deco * 100
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
220 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
221 MOVII PRODL,sub_b ; copy result to sub_b
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
222 call cmpU16 ; compare (sub_a - sub_b)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
223 btfsc neg_flag ; higher than ppO2 max deco?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
224 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
225 ;bra TFT_color_code_gaslist_warn ; YES - set warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
226
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
227
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
228 ; Helper Function - set waring color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
229 TFT_color_code_gaslist_warn:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
230 FONT_COLOR_WARNING ; select warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
231 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
232
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
233
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
234 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
235 ; Color-Code the Ceiling Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
236 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
237 ; Input mpr ceiling depth [mbar]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
238 ; pressure_rel_cur_cached current relative pressure [mbar]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
239 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
240 TFT_color_code_ceiling:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
241 ; check for invalid
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
242 btfsc hi,char_invalid_flag ; is the invalid flag set? (bit 7 here)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
243 bra TFT_color_code_ceiling_dis ; YES - set to disabled color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
244
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
245 ; check for ceiling
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
246 MOVII pressure_rel_cur_cached,sub_a;get current pressure to sub_a
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
247 MOVII mpr,sub_b ; get ceiling to sub_b
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
248 call cmpU16 ; sub_a - sub_b = relative pressure [mbar] - int_O_ceiling [mbar]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
249 btfss neg_flag ; is current depth < ceiling (too shallow) ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
250 bra TFT_color_code_ceiling_memo ; NO - set to memo color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
251
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
252 ; check for outside
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
253 movff char_O_deco_warnings,WREG ; bank-safe copy of deco warnings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
254 btfss WREG,outside_warning ; are we currently outside of the ZH-L16 model?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
255 bra TFT_color_code_ceiling_attn ; NO - set to attention color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
256 ;bra TFT_color_code_ceiling_warn ; YES - set to warnings color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
257
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
258
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
259 ; Helper Functions - select color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
260 TFT_color_code_ceiling_warn:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
261 FONT_COLOR_WARNING ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
262 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
263
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
264 TFT_color_code_ceiling_attn:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
265 FONT_COLOR_ATTENTION ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
266 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
267
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
268 TFT_color_code_ceiling_memo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
269 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
270 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
271
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
272 TFT_color_code_ceiling_dis:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
273 bcf hi,char_invalid_flag ; clear the invalid flag (bit 7 here)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
274 FONT_COLOR_DISABLED ; select disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
275 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
276
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
277
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
278 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
279 ; Color-Code the Stop Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
280 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
281 ; memo color if below stop depth,
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
282 ; attention color if above stop but below ceiling*,
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
283 ; warning color if above stop and ceiling*
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
284 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
285 ; Input: depth_meter current depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
286 ; lo stop depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
287 ; char_O_deco_gas deco data valid flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
288 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
289 ; * the ceiling depth is calculated using current (interpolated) GF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
290 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
291 TFT_color_code_stop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
292 ; check for invalid
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
293 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
294 btfsc WREG,char_invalid_flag ; is the invalid flag set?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
295 bra TFT_color_code_stop_dis ; YES - set to disabled color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
296
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
297 ; check for shallower than stop depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
298 movf lo,W ; get depth of first stop in meters into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
299 subwf depth_meter,W ; compute current depth - stop depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
300 btfsc STATUS,C ; result negative?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
301 bra TFT_color_code_stop_1 ; NO - not shallower than stop depth, check for ascent advice
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
302 MOVII int_O_ceiling,sub_b ; YES - get ceiling depth in mbar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
303 btfsc sub_b+1,char_invalid_flag ; - is the invalid flag set? (bit 7 here)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
304 bra TFT_color_code_stop_warn ; YES - select warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
305 MOVII pressure_rel_cur_cached,sub_a; NO - get current pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
306 call cmpU16 ; - sub_a - sub_b = relative pressure - int_O_ceiling
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
307 btfsc neg_flag ; - is ceiling > current depth?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
308 bra TFT_color_code_stop_warn ; YES - set to warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
309 bra TFT_color_code_stop_attn ; NO - set to attention color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
310
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
311 ; check for ascent advice
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
312 TFT_color_code_stop_1:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
313 movf lo,W ; get depth of first stop in meters into WREG
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
314 incf WREG,W ; compute stop depth + 1 meter
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
315 subwf depth_meter,W ; compute current depth - (first stop depth + 1 meter)
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
316 btfss STATUS,C ; result negative?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
317 bra TFT_color_code_stop_memo ; YES - within 1 meter of stop depth, use memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
318 btfsc deco_region ; NO - within deco stops region?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
319 bra TFT_color_code_stop_advc ; YES - use advice color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
320 ;bra TFT_color_code_stop_memo ; NO - use memo color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
321
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
322
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
323 ; Helper Functions - select color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
324 TFT_color_code_stop_memo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
325 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
326 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
327
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
328 TFT_color_code_stop_advc:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
329 FONT_COLOR_ADVICE ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
330 bsf win_invert ; print in inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
331 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
332
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
333 TFT_color_code_stop_attn:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
334 FONT_COLOR_ATTENTION ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
335 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
336
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
337 TFT_color_code_stop_warn:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
338 FONT_COLOR_WARNING ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
339 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
340
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
341 TFT_color_code_stop_dis:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
342 FONT_COLOR_DISABLED ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
343 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
344
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
345
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
346 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
347 ; Color-Code the current Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
348 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
349 TFT_color_code_depth:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
350 TSTOSS opt_depth_warn ; depth warning switched on?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
351 bra TFT_color_code_depth_no_mod ; NO
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
352 btfsc warn_det_depth_limit ; YES - depth limit warning active?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
353 bra TFT_color_code_depth_warn ; YES - set to warning color
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
354 bra TFT_color_code_depth_mod ; NO - check depth against MOD
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
355
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
356 TFT_color_code_depth_no_mod:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
357 btfsc warn_det_depth_limit ; depth limit warning active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
358 bra TFT_color_code_depth_warn ; YES - set to warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
359 bra TFT_color_code_depth_memo ; NO - set to memo color and return...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
360
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
361 TFT_color_code_depth_mod:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
362 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
363 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
364 decfsz WREG,F ; in CCR mode?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
365 bra TFT_color_code_depth_no_ccr ; NO - continue checking for ppO2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
366 btfss bailout_mode ; YES - check if in bailout
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
367 bra TFT_color_code_depth_outside; NO - continue checking for outside ZHL16 model
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
368 ;bra TFT_color_code_depth_no_ccr ; YES - continue checking for ppO2
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
369 ENDIF
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
370
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
371 TFT_color_code_depth_no_ccr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
372 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
373 btfsc WREG,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
374 bra TFT_color_code_depth_warn ; YES - animate in warning design
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
375 ;bra TFT_color_code_depth_outside; NO - continue checking for outside ZHL16 model
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
376
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
377 TFT_color_code_depth_outside:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
378 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
379 btfsc WREG,outside_warning ; are we currently outside of the ZH-L16 model?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
380 bra TFT_color_code_depth_warn ; YES - activate depth warning
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
381 btfsc WREG,outside_attention ; NO - are we near to outside of the ZH-L16 model?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
382 bra TFT_color_code_depth_att ; YES - activate depth attention
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
383 ;bra TFT_color_code_depth_memo ; NO - select memo color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
384
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
385
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
386 ; Helper Functions - set colors and attention/warning flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
387 TFT_color_code_depth_memo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
388 bcf depth_color_warning ; terminate depth warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
389 bcf depth_color_attention ; terminate depth attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
390 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
391 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
392
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
393 TFT_color_code_depth_warn:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
394 bsf depth_color_warning ; activate depth warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
395 bcf depth_color_attention ; terminate depth attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
396 FONT_COLOR_WARNING ; select warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
397 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
398
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
399 TFT_color_code_depth_att:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
400 bcf depth_color_warning ; terminate depth warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
401 bsf depth_color_attention ; activate depth attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
402 FONT_COLOR_ATTENTION ; select attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
403 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
404
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
405
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
406 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
407 ; Color-Code a CNS Value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
408 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
409 ; Input hi:lo CNS value [%]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
410 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
411 global TFT_color_code_cns
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
412 TFT_color_code_cns:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
413 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
414 bra TFT_color_code_cns_1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
415 bcf hi,int_invalid_flag ; YES - clear invalid flag
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
416 bcf hi,int_warning_flag ; - clear warning flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
417 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
418 FONT_COLOR_DISABLED ; - select disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
419 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
420
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
421 TFT_color_code_cns_1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
422 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
423 bra TFT_color_code_cns_2 ; NO
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
424 bcf hi,int_warning_flag ; YES - clear warning flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
425 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
426 FONT_COLOR_WARNING ; - select warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
427 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
428
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
429 TFT_color_code_cns_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
430 btfss hi,int_attention_flag ; is the attention flag set?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
431 bra TFT_color_code_cns_3 ; NO - select memo color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
432 bcf hi,int_attention_flag ; YES - clear attention flag
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
433 FONT_COLOR_ATTENTION ; - select attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
434 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
435
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
436 TFT_color_code_cns_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
437 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
438 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
439
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
440
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
441 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
442 ; Color-Code a Supersaturation Value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
443 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
444 ; Input hi:lo CNS value [%]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
445 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
446 ; with int_O_lead_supersat, the upper byte is solely used for the flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
447 ; and not for the value, thus there is no need to clear the flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
448 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
449 TFT_color_code_supersat:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
450 movf pallet_color_memo,W ; load memo color by default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
451 btfsc hi,int_attention_flag ; is the attention flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
452 movf pallet_color_attention,W ; YES - replace by attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
453 btfsc hi,int_warning_flag ; is the warning flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
454 movf pallet_color_warning,W ; YES - replace by warning color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
455 btfsc hi,int_invalid_flag ; is the invalid flag set?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
456 movf pallet_color_disabled,W ; YES - replace by disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
457 movwf font_color ; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
458 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
459
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
460
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
461 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
462 ; Color-Code a ppO2 Value by its warning flags (16 bit)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
463 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
464 ; Input hi:lo ppO2 value [cbar]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
465 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
466 TFT_color_code_ppo2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
467 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
468 bra TFT_color_code_ppo2_1 ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
469 bcf hi,int_warning_flag ; YES - clear warning flag
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
470 bcf hi,int_attention_flag ; - clear attention flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
471 bcf hi,int_high_flag ; - clear high warning flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
472 bcf hi,int_low_flag ; - clear low warning flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
473 FONT_COLOR_WARNING ; - select warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
474 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
475
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
476 TFT_color_code_ppo2_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
477 btfss hi,int_attention_flag ; is the attention flag set?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
478 bra TFT_color_code_ppo2_2 ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
479 bcf hi,int_attention_flag ; YES - clear attention flag (it may be set)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
480 bcf hi,int_high_flag ; - clear high warning flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
481 bcf hi,int_low_flag ; - clear low warning flag (it may be set)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
482 FONT_COLOR_ATTENTION ; - select to attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
483 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
484
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
485 TFT_color_code_ppo2_2:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
486 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
487 bcf hi,int_low_flag ; clear low warning flag (it may be set)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
488 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
489 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
490
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
491
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
492 IFDEF _ccr_pscr
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
493
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
494 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
495 ; Color-Code a ppO2 Value by its warning flags (8 bit)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
496 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
497 ; Input lo ppO2 value [cbar]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
498 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
499 TFT_color_code_ppo2_hud:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
500 movff char_O_deco_info,WREG ; get the deco info vector
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
501 btfss WREG,deco_mode ; in deco?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
502 bra TFT_color_code_ppo2_hud_a ; NO - load normal max value as threshold
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
503 movff char_I_ppO2_max_deco,WREG ; YES - load deco max value as threshold
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
504 bra TFT_color_code_ppo2_hud_b ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
505
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
506 TFT_color_code_ppo2_hud_a:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
507 movff char_I_ppO2_max_work,WREG ; ppO2 max while in working phase
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
508 ;bra TFT_color_code_ppo2_hud_b ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
509
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
510 TFT_color_code_ppo2_hud_b:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
511 cpfsgt lo ; lo > threshold?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
512 bra TFT_color_code_ppo2_hud1 ; NO - continue with checking for ppO2 low
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
513 FONT_COLOR_WARNING ; YES - set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
514 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
515
0
heinrichsweikamp
parents:
diff changeset
516 TFT_color_code_ppo2_hud1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
517 movff opt_dive_mode,WREG ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
518 decfsz WREG,F ; in CCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
519 bra TFT_color_code_ppo2_hud_nocc; NO - check with ppO2 min for OC mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
520 btfsc bailout_mode ; YES - in bailout mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
521 bra TFT_color_code_ppo2_hud_nocc; YES - check with ppO2 min for OC mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
522 movff char_I_ppO2_min_loop,WREG ; NO - check with ppO2 min for loop mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
523 bra TFT_color_code_ppo2_hud_com ; - continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
524
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
525 TFT_color_code_ppo2_hud_nocc:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
526 movff char_I_ppO2_min,WREG ; get ppO2 min for all other modes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
527 ;bra TFT_color_code_ppo2_hud_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
528
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
529 TFT_color_code_ppo2_hud_com:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
530 cpfslt lo ; lo < char_I_ppO2_min?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
531 bra TFT_color_code_ppo2_hud_com1; NO - set memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
532 FONT_COLOR_WARNING ; YES - set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
533 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
534
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
535 TFT_color_code_ppo2_hud_com1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
536 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
537 return ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
538
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
539 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
540
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
541
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
542 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
543 ; Color-Code the Battery Level
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
544 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
545 ; Input battery_low_condition battery status flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
546 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
547 TFT_color_code_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
548 movf pallet_color_memo,W ; get memo color by default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
549 btfsc battery_low_condition ; battery low condition detected?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
550 movf pallet_color_warning,W ; YES - switch to warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
551 movwf font_color ; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
552 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
553
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
554
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
555 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
556 ; Color-Code according to Gas Number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
557 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
558 ; Input WREG gas number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
559 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
560 global TFT_color_code_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
561 TFT_color_code_gas:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
562 movwf up ; copy gas number (1-6) to up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
563 movlw color_white ; default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
564 dcfsnz up,F ; gas 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
565 movlw color_white ; YES - color for gas 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
566 dcfsnz up,F ; gas 2 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
567 movlw color_green ; YES - color for gas 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
568 dcfsnz up,F ; gas 3 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
569 movlw color_red ; YSE - color for gas 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
570 dcfsnz up,F ; gas 4 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
571 movlw color_yellow ; YES - color for gas 4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
572 dcfsnz up,F ; gas 5 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
573 movlw color_cyan ; YES - color for gas 5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
574 dcfsnz up,F ; gas 6 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
575 movlw color_pink ; YES - color for gas 6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
576 movwf font_color ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
577 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
578
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
579
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
580 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
581 tft_out3 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
582 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
583
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
584
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
585 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
586 ; Surface Mode Screen - current Time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
587 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
588 global TFT_surfmode_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
589 TFT_surfmode_time:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
590 WIN_SMALL surf_clock_column+.7,surf_clock_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
591 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
592 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
593 movff rtc_latched_hour,lo ; get hours
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
594 output_99 ; print hours (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
595 movlw ':' ; load a ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
596 movff rtc_latched_secs,lo ; get seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
597 btfss lo,0 ; on even second?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
598 movlw ' ' ; NO - load a space char
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
599 movwf POSTINC2 ; print ":" or space char
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
600 movff rtc_latched_mins,lo ; get minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
601 output_99x ; print minutes (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
602 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
603 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
604
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
605
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
606 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
607 ; Surface Mode Screen - current Date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
608 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
609 global TFT_surfmode_date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
610 TFT_surfmode_date:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
611 WIN_SMALL surf_date_column,surf_date_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
612 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
613 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
614 movff rtc_latched_year, lo ; copy year to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
615 movff rtc_latched_month,hi ; copy month to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
616 movff rtc_latched_day, up ; copy day to up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
617 call output_date ; print date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
618 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
619 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
620
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
621
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
622 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
623 ; Surface Mode Screen - show Pressure, on condition deltaP > threshold
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
624 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
625 global TFT_surfmode_pres_fast
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
626 TFT_surfmode_pres_fast:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
627 SMOVII pressure_abs, sub_a ; ISR-safe 2 byte copy of current absolute pressure to sub_a
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
628 MOVII pressure_abs_ref,sub_b ; standard 2 byte copy 10 min ago absolute pressure to sub_b
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
629 call subU16 ; sub_c = | sub_a - sub_b | = deltaP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
630 tstfsz sub_c+1 ; deltaP > 255 mbar ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
631 bra TFT_pres_surfmode_fast_1 ; YES - show current pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
632 movlw pressure_noise_threshold+.1 ; NO - load noise suppression threshold
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
633 subwf sub_c+0,W ; - subtract threshold from deltaP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
634 bc TFT_pres_surfmode_fast_1 ; - result negative -> show current pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
635 tstfsz pressure_update_lag_counter ; - still in lag time?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
636 bra TFT_pres_surfmode_fast_0 ; YES - continue updating the display
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
637 return ; NO - no display updates any more, done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
638
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
639 TFT_pres_surfmode_fast_0:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
640 decf pressure_update_lag_counter,F ; clock down lag time counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
641 bra TFT_surfmode_pres ; update display
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
642
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
643 TFT_pres_surfmode_fast_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
644 movlw pressure_noise_lag_time ; get lag time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
645 movwf pressure_update_lag_counter ; re-set lag time counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
646 ;bra TFT_surfmode_pres ; update display
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
647
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
648
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
649 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
650 ; Surface Mode Screen - show Pressure (unconditional)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
651 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
652 global TFT_surfmode_pres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
653 TFT_surfmode_pres:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
654 ; value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
655 WIN_SMALL surf_press_column+.8,surf_press_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
656 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
657 SMOVII pressure_abs,mpr ; get current pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
658 FONT_COLOR_MEMO ; print in standard color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
659 output_9999 ; print (0-9999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
660 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
661 ; unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
662 WIN_SMALL surf_press_column+(4+1)*8,surf_press_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
663 FONT_COLOR_MASK ; switch to mask color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
664 STRCPY_TEXT_PRINT tMBAR ; print unit (hPa)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
665 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
666
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
667
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
668 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
669 ; Surface Mode Screen - Temperature
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
670 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
671 global TFT_surfmode_temp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
672 TFT_surfmode_temp:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
673 ; unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
674 WIN_SMALL surf_temp_column+3*8,surf_temp_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
675 FONT_COLOR_MASK ; select mask color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
676 TSTOSS opt_units ; 0=°C, 1=°F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
677 bra TFT_temp_surfmode_metric ; 0: metric
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
678 ;bra TFT_temp_surfmode_imperial ; 1: imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
679
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
680 TFT_temp_surfmode_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
681 STRCAT_TEXT tLogTunitF ; print "°F"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
682 bra TFT_temp_surfmode_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
683
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
684 TFT_temp_surfmode_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
685 STRCAT_TEXT tLogTunitC ; print "°C"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
686 ;bra TFT_temp_surfmode_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
687
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
688 TFT_temp_surfmode_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
689 PRINT ; dump the unit to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
690
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
691 ; value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
692 WIN_SMALL surf_temp_column,surf_temp_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
693 bra TFT_temp_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
694
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
695
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
696 ; Helper Function - common output for surface and dive mode temperature
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
697 TFT_temp_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
698 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
699 SMOVII temperature_cur,mpr ; ISR-safe 2 byte copy of current temperature to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
700
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
701 ; DEBUG CODE - manual override temp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
702 ; -----------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
703 ; MOVLI 0xFFF6,mpr ; - 1.0 °C
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
704 ; MOVLI 0xFF9C,mpr ; -10.0 °C
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
705
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
706 TSTOSC opt_units ; 0=°C, 1=°F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
707 call convert_celsius_to_fahrenheit;1 - convert value in lo:hi from Celsius to Fahrenheit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
708 call convert_signed_16bit ; convert lo:hi into signed-short and print '-' if negative
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
709 btfsc neg_flag ; is the temperature negative?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
710 bsf hide_digit4 ; YES - do not print digit 4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
711 bsf omit_digit_1 ; do not print digit 1 (0.1°)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
712 output_9999 ; print temperature (0x-999x / 0x-99x if negative)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
713
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
714 btfss divemode ; in dive mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
715 bra TFT_temp_common_no_unit ; NO - no unit to append
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
716 TSTOSS opt_units ; YES - check unit type: 0=°C, 1=°F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
717 bra TFT_temp_common_metric ; 0 - metric
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
718 ;bra TFT_temp_common_imperial ; 1 - imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
719
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
720 TFT_temp_common_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
721 STRCAT_TEXT_PRINT tLogTunitF ; append "°F" and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
722 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
723
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
724 TFT_temp_common_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
725 STRCAT_TEXT_PRINT tLogTunitC ; append "°C" and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
726 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
727
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
728 TFT_temp_common_no_unit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
729 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
730 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
731
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
732
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
733 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
734 ; Surface Mode Screen - Battery Status
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
735 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
736 global TFT_surfmode_batt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
737 TFT_surfmode_batt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
738 FONT_COLOR_MEMO ; set default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
739
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
740 ; apply charging indicator and warnings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
741 clrf WREG ; default to no indication/warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
742 btfsc cc_active ; charging in CC mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
743 movlw color_yellow ; YES - set output color to yellow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
744 btfsc cv_active ; charging in CV mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
745 movlw color_green ; YES - set output color to green
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
746 btfsc battery_low_condition ; battery low condition detected?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
747 movf pallet_color_warning,W ; YES - set output to warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
748 btfsc battery_overtemp ; battery over-temperature detector tripped?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
749 movf pallet_color_warning,W ; YES - set output to warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
750 tstfsz WREG ; any indicator or warning active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
751 bsf win_invert ; YES - set output to inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
752 tstfsz WREG ; any indicator or warning active (asked again)?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
753 movwf font_color ; YES - change color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
754
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
755 WIN_SMALL batt_percent_column+.2,batt_percent_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
756 movff batt_percent,lo ; get battery %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
757 output_256 ; print battery % (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
758 STRCAT_PRINT "% " ; append unit with trailing space and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
759
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
760 WIN_TINY batt_voltage_column+.15,batt_voltage_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
761 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
762 movff battery_type,lo ; get battery type
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
763 PUTC "T" ; print "T"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
764 output_9 ; print battery type code (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
765 PUTC ":" ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
766 MOVII batt_voltage,mpr ; get battery voltage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
767 bsf omit_digit_2 ; do not print 2nd and 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
768 bsf decimal_digit3 ; place a decimal point in front of digit 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
769 output_9999 ; print x.x--
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
770 PUTC_PRINT 'V' ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
771 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
772
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
773 ;update_battery_debug:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
774 ; FONT_COLOR_MEMO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
775 ; WIN_TINY .70,.0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
776 ; movff battery_gauge+5,xC+3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
777 ; movff battery_gauge+4,xC+2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
778 ; movff battery_gauge+3,xC+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
779 ; movff battery_gauge+2,xC+0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
780 ; ; battery_gauge:6 is nAs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
781 ; ; devide through 65536
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
782 ; ; devide through 152
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
783 ; ; Result is 0.01Ah in xC+1:xC+0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
784 ; MOVLI .152,xB
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
785 ; call div32x16 ; xC:4 = xC:4 / xB:2 with xA as remainder
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
786 ; MOVII xC,mpr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
787 ; bsf leftbind
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
788 ; output_65535
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
789 ; STRCAT_PRINT "x.01Ah"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
790 ; return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
791
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
792
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
793 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
794 ; Surface Mode Screen - Deco Mode (0=OC, 1=CCR, 2=Gauge, 3=Apnoe, 4=pSCR)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
795 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
796 global TFT_surfmode_decotype
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
797 TFT_surfmode_decotype:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
798 WIN_STD surf_decotype_column,surf_decotype_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
799 FONT_COLOR color_lightblue ; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
800 movff opt_dive_mode,lo ; get deco mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
801 tstfsz lo ; in OC mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
802 bra TFT_decotype_surface_2 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
803 STRCAT_TEXT_PRINT tDvOC ; YES - print OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
804 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
805
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
806 TFT_decotype_surface_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
807 decfsz lo,F ; in CCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
808 bra TFT_decotype_surface_3 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
809 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
810 STRCAT_TEXT_PRINT tDvCC ; YES - print CCR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
811
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
812 WIN_TINY surf_decotype_column+.18,surf_decotype_row+.12
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
813 FONT_COLOR_MEMO ; - set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
814 movff opt_ccr_mode,WREG ; - ccr mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
815 tstfsz WREG ; - ccr_mode = 0 (FixedSP) ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
816 bra TFT_surfmode_decotype_cc_var; NO - not fixed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
817 ;bra TFT_surfmode_decotype_cc_fix; YES - fixed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
818
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
819 TFT_surfmode_decotype_cc_fix:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
820 STRCPY_TEXT tCCRModeFixedSP ; print "fixed SP"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
821 bra TFT_decotype_surface_cc_com ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
822
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
823 TFT_surfmode_decotype_cc_var:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
824 ; Sensor or Auto SP mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
825 sublw .2 ; ccr_mode = 2 (Auto SP) ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
826 bz TFT_decotype_surface_cc_auto; YES - AutoSP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
827 IFDEF _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
828 STRCPY_TEXT tCCRModeSensor ; NO - print "Sensor"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
829 bra TFT_decotype_surface_cc_com ; - continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
830 ENDIF ; _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
831
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
832 TFT_decotype_surface_cc_auto:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
833 STRCPY_TEXT tCCRModeAutoSP ; print "Auto SP"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
834 ;bra TFT_decotype_surface_cc_com ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
835
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
836 TFT_decotype_surface_cc_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
837 clrf WREG ; load string terminator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
838 movff WREG,buffer+.8 ; limit string length to 8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
839 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
840 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
841 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
842
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
843 TFT_decotype_surface_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
844 decfsz lo,F ; in gauge mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
845 bra TFT_decotype_surface_4 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
846 STRCAT_TEXT_PRINT tDvGauge ; YES - print "Gauge"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
847 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
848
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
849 TFT_decotype_surface_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
850 decfsz lo,F ; in apnea mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
851 bra TFT_decotype_surface_5 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
852 STRCAT_TEXT_PRINT tDvApnea ; YES - print "Apnoe"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
853 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
854
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
855 TFT_decotype_surface_5:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
856 STRCAT_TEXT_PRINT tDvPSCR ; print "pSCR"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
857 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
858
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
859
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
860 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
861 ; Surface Mode Screen - small Gas List
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
862 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
863 global TFT_surfmode_startgas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
864 TFT_surfmode_startgas:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
865 ; FIRST gas
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
866 WIN_SMALL surf_decotype_column+.1,surf_decotype_row+.30
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
867 FONT_COLOR_MEMO ; set font color
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
868 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
869 decf WREG,W ; 1-5 -> 0-4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
870 movwf PRODL ; copy to PRODL
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
871 call gaslist_strcat_mix_PRODL ; print gas description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
872 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
873
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
874 ; show gases
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
875 WIN_TOP surf_decotype_row+.30+.25 ; set row position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
876
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
877 ; 1st gas
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
878 WIN_LEFT surf_decotype_boxes_left1+.1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
879 movff opt_gas_type+0,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
880 rcall TFT_surfmode_startgas_helper; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
881 STRCPY_PRINT "1" ; print "1"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
882 decfsz hi,F ; Type = 1 (First)?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
883 bra TFT_surfmode_startgas_2 ; NO - skip box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
884 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left1, surf_decotype_boxes_left1+.8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
885
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
886 ; 2nd gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
887 TFT_surfmode_startgas_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
888 WIN_LEFT surf_decotype_boxes_left2+.1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
889 movff opt_gas_type+1,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
890 rcall TFT_surfmode_startgas_helper; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
891 STRCPY_PRINT "2" ; print "2"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
892 decfsz hi,F ; Type = 1 (First)?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
893 bra TFT_surfmode_startgas_3 ; NO - skip box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
894 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left2, surf_decotype_boxes_left2+.8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
895
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
896 ; 3rd gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
897 TFT_surfmode_startgas_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
898 WIN_LEFT surf_decotype_boxes_left3+.1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
899 movff opt_gas_type+2,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
900 rcall TFT_surfmode_startgas_helper; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
901 STRCPY_PRINT "3" ; print "3"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
902 decfsz hi,F ; Type = 1 (First)?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
903 bra TFT_surfmode_startgas_4 ; NO - skip box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
904 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left3, surf_decotype_boxes_left3+.8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
905
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
906 ; 4th gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
907 TFT_surfmode_startgas_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
908 WIN_LEFT surf_decotype_boxes_left4+.1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
909 movff opt_gas_type+3,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
910 rcall TFT_surfmode_startgas_helper; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
911 STRCPY_PRINT "4" ; print "4"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
912 decfsz hi,F ; Type = 1 (First)?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
913 bra TFT_surfmode_startgas_5 ; NO - skip box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
914 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left4, surf_decotype_boxes_left4+.8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
915
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
916 ; 5th gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
917 TFT_surfmode_startgas_5:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
918 WIN_LEFT surf_decotype_boxes_left5+.1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
919 movff opt_gas_type+4,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
920 rcall TFT_surfmode_startgas_helper; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
921 STRCPY_PRINT "5" ; print "5"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
922 decfsz hi,F ; type = 1 (First)?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
923 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
924 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left5, surf_decotype_boxes_left5+.8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
925 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
926
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
927
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
928 ; Helper Function - set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
929 TFT_surfmode_startgas_helper:
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
930 movf pallet_color_disabled,W ; set default color
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
931 tstfsz hi ; gas not disabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
932 movf pallet_color_memo,W ; YES - change to memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
933 movwf font_color ; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
934 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
935
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
936 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
937
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
938 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
939 ; Surface Mode Screen - Tank Pressure Reading above Surface Pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
940 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
941 global TFT_surfmode_tankpres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
942 TFT_surfmode_tankpres:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
943 WIN_SMALL surf_decotype_column+.6,surf_decotype_row+.30+.47
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
944 movff int_IO_pressure_value+0,lo ; copy pressure from 1st reading to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
945 movff int_IO_pressure_value+1,hi ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
946 btfss hi,int_not_avail_flag ; pressure reading 1 available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
947 bra TFT_surface_tank_pres_0 ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
948 movff int_IO_pressure_value+2,lo ; NO - copy pressure from 2nd reading to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
949 movff int_IO_pressure_value+3,hi ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
950 btfsc hi,int_not_avail_flag ; - pressure reading 2 available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
951 bra TFT_surface_tank_pres_1 ; NO - show not avail message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
952
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
953 TFT_surface_tank_pres_0:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
954 call TFT_color_code_pres_sac ; set output color according to flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
955 bsf omit_digit_1 ; do not print 1st digit (0.1 bar)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
956 output_9999 ; print (0x-999x)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
957 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
958 bra TFT_surface_tank_pres_2 ; print unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
959
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
960 TFT_surface_tank_pres_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
961 FONT_COLOR_DISABLED ; select disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
962 STRCAT_PRINT " ---" ; output for no pressure data available
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
963
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
964 TFT_surface_tank_pres_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
965 WIN_SMALL surf_decotype_column+.38,surf_decotype_row+.30+.47
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
966 FONT_COLOR_MASK ; select mask color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
967 STRCAT_PRINT "bar" ; can not use tbar because it has a leading space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
968 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
969
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
970 ENDIF ; _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
971
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
972
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
973 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
974 tft_out4 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
975 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
976
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
977
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
978 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
979 ; Imprint the Color Schemes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
980 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
981 global TFT_imprint_color_schemes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
982 TFT_imprint_color_schemes:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
983 call TFT_load_dive_color_pallet ; load dive mode color pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
984
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
985 FONT_COLOR_MASK ; select mask color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
986 WIN_TINY .12,.40 ; print labels
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
987 STRCAT_TEXT_PRINT tDepth ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
988 WIN_TINY .62,.40 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
989 STRCAT_TEXT_PRINT tMaxDepth ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
990 WIN_TINY .122,.40 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
991 STRCAT_TEXT_PRINT tDivetime ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
992
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
993 FONT_COLOR_DISABLED ; select disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
994
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
995 ; max. depth demo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
996 WIN_MEDIUM .64,.54 ; set font and position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
997 movlw .63 ; load demo depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
998 movwf lo ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
999 output_99 ; print full meters (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1000 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1001
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1002 WIN_SMALL .87,.66 ; set font and position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1003 PUTC "." ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1004 movlw .4 ; load demo depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1005 movwf lo ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1006 output_9 ; print decimeters (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1007 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1008
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1009 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1010
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1011 ; depth demo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1012 WIN_MEDIUM .3,.54 ; set font and position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1013 movlw .17 ; load a demo depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1014 movwf lo ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1015 output_99 ; print full meters (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1016 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1017
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1018 WIN_SMALL .25,.66 ; set font and position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1019 PUTC "." ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1020 movlw .5 ; load demo depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1021 movwf lo ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1022 output_9 ; print decimeters (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1023 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1024
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1025 ; dive time demo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1026 WIN_MEDIUM .103, .54 ; set font and position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1027 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1028 movff rtc_latched_mins,lo ; get minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1029 output_256 ; print minutes (in 3 digits, 1st digit used as spacer)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1030 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1031
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1032 WIN_SMALL .139, .66 ; set font and position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1033 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1034 movff rtc_latched_secs,lo ; get seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1035 output_99x ; print seconds (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1036 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1037
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1038 ; messages demo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1039 WIN_SMALL dm_warning1_column-.78, dm_warning1_row+.39+.12
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1040 FONT_COLOR_ADVICE ; select advice color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1041 STRCPY_TEXT_PRINT tgaschange ; sample text "Change?"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1042
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1043 WIN_SMALL dm_warning1_column, dm_warning1_row+.39
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1044 FONT_COLOR_ATTENTION ; select attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1045 STRCPY_TEXT_PRINT tCNSeod ; sample text "CNS final"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1046
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1047 WIN_SMALL dm_warning2_column, dm_warning2_row+.38
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1048 FONT_COLOR_WARNING ; select warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1049 STRCPY_TEXT_PRINT tGasNeedsWarn ; sample text "Gas Needs"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1050
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1051 call TFT_load_std_color_pallet ; re-load standard color pallet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1052
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1053 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1054
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1055
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1056 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1057 ; Surface Menu - Imprint Time & Date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1058 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1059 global TFT_imprint_time_date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1060 TFT_imprint_time_date:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1061 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of current date & time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1062 ;bra TFT_imprint_time_date_fast ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1063
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1064
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1065 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1066 ; Surface Menu - Imprint Time & Date - fast Updating
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1067 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1068 global TFT_imprint_time_date_fast
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1069 TFT_imprint_time_date_fast:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1070 WIN_SMALL .20,.40 ; column, row - keep clear of the cursor area on the left!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1071 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1072 movff rtc_latched_hour,lo ; get hours
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1073 output_99 ; print hours (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1074 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1075 movff rtc_latched_mins,lo ; get minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1076 output_99x ; print minutes (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1077 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1078 movff rtc_latched_secs,lo ; get seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1079 output_99x ; print seconds (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1080 STRCAT " " ; append two spaces
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1081 movff rtc_latched_year, lo ; get date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1082 movff rtc_latched_month,hi ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1083 movff rtc_latched_day, up ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1084 call output_date ; print date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1085 PUTC_PRINT " " ; append a space and dump to screen
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1086 return ; done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1087
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1088
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1089 IFDEF _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1090
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1091 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1092 ; Surface Mode - Imprint ppO2 from Sensors
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1093 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1094 global TFT_imprint_surf_ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1095 TFT_imprint_surf_ppO2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1096
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1097 TFT_imprint_surf_ppO2_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1098 WIN_SMALL surf_hud_sensor1_column,surf_hud_sensor1_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1099 btfsc sensor1_calibrated_ok ; sensor calibrated?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1100 bra TFT_imprint_surf_ppO2_1a ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1101 btfsc sensor1_active ; NO - valid HUD data for this sensor?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1102 bra TFT_imprint_surf_ppO2_1a ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1103 rcall TFT_imprint_surf_ppO2_h2 ; NO - print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1104 bra TFT_imprint_surf_ppO2_2 ; - continue with sensor 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1105 TFT_imprint_surf_ppO2_1a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1106 movff sensor1_ppO2,lo ; get ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1107 rcall TFT_imprint_surf_ppO2_h1 ; print ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1108
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1109 TFT_imprint_surf_ppO2_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1110 WIN_SMALL surf_hud_sensor2_column,surf_hud_sensor2_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1111 btfsc sensor2_calibrated_ok ; sensor calibrated?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1112 bra TFT_imprint_surf_ppO2_2a ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1113 btfsc sensor2_active ; NO - valid HUD data for this sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1114 bra TFT_imprint_surf_ppO2_2a ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1115 rcall TFT_imprint_surf_ppO2_h2 ; NO - print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1116 bra TFT_imprint_surf_ppO2_3 ; - continue with sensor 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1117 TFT_imprint_surf_ppO2_2a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1118 movff sensor2_ppO2,lo ; get ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1119 rcall TFT_imprint_surf_ppO2_h1 ; print ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1120
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1121 TFT_imprint_surf_ppO2_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1122 WIN_SMALL surf_hud_sensor3_column,surf_hud_sensor3_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1123 btfsc sensor3_calibrated_ok ; sensor calibrated?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1124 bra TFT_imprint_surf_ppO2_3a ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1125 btfsc sensor3_active ; NO - valid HUD data for this sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1126 bra TFT_imprint_surf_ppO2_3a ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1127 bra TFT_imprint_surf_ppO2_h2 ; NO - print dashes and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1128 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1129 TFT_imprint_surf_ppO2_3a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1130 movff sensor3_ppO2,lo ; get ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1131 ;bra TFT_imprint_surf_ppO2_h1 ; print ppO2 and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1132
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1133 TFT_imprint_surf_ppO2_h1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1134 call TFT_color_code_ppo2_hud ; color-code with ppO2 [cbar] in lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1135 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1136 output_256 ; print (0.00-2.55)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1137 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1138 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1139
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1140 TFT_imprint_surf_ppO2_h2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1141 FONT_COLOR_MEMO ; select standard color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1142 STRCPY_PRINT "--- " ; print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1143 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1144
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1145
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1146 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1147 ; Surface Mode - Imprint mV from Sensors
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1148 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1149 global TFT_imprint_surf_mV
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1150 TFT_imprint_surf_mV:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1151 FONT_COLOR_MEMO ; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1152
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1153 ; sensor 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1154 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor1_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1155 SMOVII sensor1_mv,mpr ; in 0.1mV steps
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1156 STRCAT "1: " ; print number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1157 rcall TFT_sensor_mV_helper ; print mV
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1158
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1159 ; sensor 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1160 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor2_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1161 SMOVII sensor2_mv,mpr ; in 0.1mV steps
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1162 STRCAT "2: " ; print number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1163 rcall TFT_sensor_mV_helper
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1164
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1165 ; sensor 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1166 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1167 SMOVII sensor3_mv,mpr ; in 0.1mV steps
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1168 STRCAT "3: " ; print number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1169 rcall TFT_sensor_mV_helper ; print mV
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1170
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1171 ; print sensor connection type
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1172 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row+.24
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1173 btfsc ext_input_optical ; optical input?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1174 bra TFT_sensor_mV_optical ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1175 TSTOSS opt_s8_mode ; NO - S8 input selected?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1176 bra TFT_sensor_mV_analog ; NO - analog input
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1177 ;bra TFT_sensor_mV_s8 ; YES - S8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1178
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1179 TFT_sensor_mV_s8:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1180 STRCAT_PRINT "Digital" ; print "Digital"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1181 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1182
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1183 TFT_sensor_mV_optical:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1184 STRCAT_PRINT "Optical" ; print "Optical"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1185 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1186
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1187 TFT_sensor_mV_analog:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1188 STRCAT_PRINT "Analog" ; print "analog"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1189 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1190
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1191
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1192 ; Helper Function - print mV value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1193 TFT_sensor_mV_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1194 bsf decimal_digit1 ; place a decimal point in front of digit 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1195 output_9999 ; print (0.0-999.9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1196 STRCAT_PRINT "mV " ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1197 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1198
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1199
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1200 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1201 ; Surface Mode - Imprint End-of-Life from Sensors
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1202 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1203 ; when opt_x_sx > 255 the sensor will just give 8 mV at a ppO2 of 0.21
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1204 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1205 global TFT_imprint_surf_sensor_eol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1206 TFT_imprint_surf_sensor_eol:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1207 FONT_COLOR_WARNING ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1208
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1209 TFT_imprint_surf_eol_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1210 ; sensor 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1211 btfss sensor1_calibrated_ok ; valid calibration?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1212 bra TFT_imprint_surf_eol_2 ; NO - skip
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1213 movff opt_x_s1+1,WREG ; YES - get high(opt_x_s1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1214 movf WREG,W ; - excite flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1215 bz TFT_imprint_surf_eol_2 ; - opt_x_s1 > 255 -> the sensor is not too bad yet for a warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1216 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor1_row-.5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1217 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1218
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1219 TFT_imprint_surf_eol_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1220 ; sensor 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1221 btfss sensor2_calibrated_ok ; valid calibration?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1222 bra TFT_imprint_surf_eol_3 ; NO - skip
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1223 movff opt_x_s2+1,WREG ; YES - get high(opt_x_s2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1224 movf WREG,W ; - excite flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1225 bz TFT_imprint_surf_eol_3 ; - opt_x_s2 > 255 -> the sensor is not too bad yet for a warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1226 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor2_row-.5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1227 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1228
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1229 TFT_imprint_surf_eol_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1230 ; sensor 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1231 btfss sensor3_calibrated_ok ; valid calibration?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1232 bra TFT_imprint_surf_eol_4 ; NO - skip
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1233 movff opt_x_s3+1,WREG ; YES - get high(opt_x_s3)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1234 movf WREG,W ; - excite flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1235 bz TFT_imprint_surf_eol_4 ; - opt_x_s3 > 255 -> the sensor is not too bad yet for a warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1236 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor3_row-.5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1237 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1238
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1239 TFT_imprint_surf_eol_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1240 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1241
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1242
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1243 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1244 ; Imprint Function for the Calibration Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1245 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1246 global TFT_imprint_menu_mV
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1247 TFT_imprint_menu_mV:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1248 FONT_COLOR color_yellow ; show in yellow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1249 rcall TFT_sensor_mv_get ; get sensor mV values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1250
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1251 ; sensor 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1252 WIN_SMALL surf_menu_sensor1_column,surf_menu2_sensor1_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1253 SMOVII sensor1_mv,mpr ; in 0.1mV steps
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1254 rcall TFT_imprint_menu_mV_helper ; print mV value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1255
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1256 ; sensor 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1257 WIN_SMALL surf_menu_sensor2_column,surf_menu2_sensor2_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1258 SMOVII sensor2_mv,mpr ; in 0.1mV steps
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1259 rcall TFT_imprint_menu_mV_helper ; print mV value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1260
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1261 ; sensor 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1262 WIN_SMALL surf_menu_sensor3_column,surf_menu2_sensor3_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1263 SMOVII sensor3_mv,mpr ; in 0.1mV steps
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1264 rcall TFT_imprint_menu_mV_helper ; print mV value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1265
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1266 TSTOSS opt_s8_mode ; =0: analog, =1: digital
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1267 return ; analog - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1268
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1269 ; imprint HUD battery voltage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1270 WIN_TINY .20,.209 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1271 STRCPY "HUD Batt: " ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1272 SMOVII hud_battery_mv,mpr ; get HUD battery voltage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1273 bsf decimal_digit3 ; place a decimal point in front of digit 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1274 output_9999 ; print (0.000-9.999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1275 PUTC_PRINT "V" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1276 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1277
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1278 ; Helper Function - get sensor mV values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1279 TFT_sensor_mv_get:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1280 ; btfsc ext_input_optical ; do we have an optical interface?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1281 ; return ; YES - optical interface delivers ready-to-use mV data, done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1282 TSTOSS opt_s8_mode ; NO - S8 input selected?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1283 bra TFT_sensor_mv_get_ana ; NO - read analog inputs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1284 ;bra TFT_sensor_mv_get_dig ; YES - convert digitally received ppO2 into mV
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1285
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1286 TFT_sensor_mv_get_dig:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1287 btfss trigger_S8_data_update ; new data frame received?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1288 return ; NO - use old values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1289 bcf trigger_S8_data_update ; YES - clear update flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1290 call compute_mvolts_from_rawdata ; - compute mV values from received raw data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1291 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1292
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1293 TFT_sensor_mv_get_ana:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1294 call get_analog_inputs ; read mV values from analog inputs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1295 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1296
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1297
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1298 ; Helper Function - print mV value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1299 TFT_imprint_menu_mV_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1300 bsf decimal_digit1 ; place a decimal point in front of digit 1 (no 0.1 mV)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1301 output_9999 ; print (0.0-999.9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1302 STRCAT_PRINT "mV" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1303 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1304
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1305 ENDIF ; _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1306
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1307
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1308 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1309 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1310 ; Imprint Function for the Tank Setup Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1311 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1312 global TFT_imprint_tank_pres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1313 TFT_imprint_tank_pres:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1314 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1315 ; get ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1316 lfsr FSR1,opt_transmitter_id_1 ; load base address of opt_transmitter_id
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1317 movf gaslist_gas,W ; get current gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1318 rlncf WREG,W ; multiply by 2 because IDs are 2 byte in size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1319 movff PLUSW1,lo ; copy opt_transmitter_id+0[gaslist_gas] to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1320 incf WREG,W ; increment index
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1321 movff PLUSW1,hi ; copy opt_transmitter_id+1[gaslist_gas] to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1322 ; show pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1323 WIN_SMALL .90, .61 ; column, row (+/- 27 per row)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1324 call get_pres_by_transmitter_id ; get pressure into hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1325 tstfsz WREG ; do we have valid tank data (WREG=0) ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1326 bra TFT_menu_tank_pres_1 ; NO - transmitter not found
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1327 call TFT_color_code_pres_sac ; set output color according to flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1328 bsf omit_digit_1 ; do not print 1st digit (0.1 bar)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1329 output_9999 ; print (0x-999x)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1330 bra TFT_menu_tank_pres_2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1331 TFT_menu_tank_pres_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1332 FONT_COLOR_DISABLED ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1333 STRCAT " ---" ; print dashes for no pressure data available
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1334 TFT_menu_tank_pres_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1335 STRCAT_TEXT_PRINT tbar ; print " bar"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1336 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1337
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1338 ENDIF ; _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1339
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1340
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1341 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1342 tft_out5 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1343 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1344
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1345
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1346 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1347 ; Dive Mode - static Layout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1348 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1349 global TFT_show_divemode_mask
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1350 TFT_show_divemode_mask: ; display mask in dive mode
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1351 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1352
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1353 ; current depth
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1354 WIN_TINY dm_mask_depth_column,dm_mask_depth_row ; position for "Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1355 btfss alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1356 bra TFT_divemode_mask_depth_text ; NO
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1357 btfsc cur_depth_greater_100m ; YES - current depth >= 100 m?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1358 bra TFT_divemode_mask_max_avg ; YES - skip depth label as it collides with depth number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1359 WIN_TINY dm_mask_depth_column_alt,dm_mask_depth_row ; NO - set alternative position for "Depth"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1360 TFT_divemode_mask_depth_text:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1361 STRCAT_TEXT_PRINT tDepth ; print "Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1362
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1363 TFT_divemode_mask_max_avg:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1364 ; avg or max depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1365 btfsc alt_layout_active ; alternative layout active?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1366 bra TFT_divemode_mask_avg_max_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1367
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1368 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
1369 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1370 bra TFT_divemode_mask_max_avg_pos ; NO - keep position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1371 WIN_TINY dm_mask_maxdepth_col,dm_mask_maxdepth_row ; YES - adopt position
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1372 TFT_divemode_mask_max_avg_pos:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1373 btfsc FLAG_apnoe_mode ; in apnea mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1374 bra TFT_divemode_mask_max_text ; YES - always draw max depth
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1375 TSTOSS opt_2ndDepthDisp ; NO - shall draw avg depth instead of max depth?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1376 bra TFT_divemode_mask_max_text ; NO - print "max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1377 STRCAT_TEXT_PRINT tAvgDepth ; YES - print "avg.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1378 bra TFT_divemode_mask_time_pos ; - continue with dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1379 TFT_divemode_mask_max_text:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1380 STRCAT_TEXT_PRINT tMaxDepth ; print "max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1381 bra TFT_divemode_mask_time_pos ; continue with dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1382 TFT_divemode_mask_avg_max_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1383 btfss FLAG_gauge_mode ; in gauge mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1384 bra TFT_divemode_mask_time_pos ; NO - continue with dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1385 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
1386 STRCAT_TEXT_PRINT tMaxDepth ; - print "max.Depth"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1387 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
1388 STRCAT_TEXT_PRINT tDiveTotalAvg ; - print "Total Avg"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1389 ;bra TFT_divemode_mask_time_pos ; - continue with dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1390
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1391 ; dive time
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1392 TFT_divemode_mask_time_pos:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1393 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row ; position for "Divetime"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1394 TFT_divemode_mask_time_text:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1395 STRCAT_TEXT_PRINT tDivetime ; print "Divetime"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1396 btfss FLAG_apnoe_mode ; in apnea mode?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1397 return ; NO - done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1398 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
1399 STRCPY_TEXT_PRINT tApnoeTotal ; - print "Total"
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1400 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1401
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1402
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1403 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1404 ; Dive Mode - NDL Layout Add-on
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1405 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1406 global TFT_show_ndl_mask
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1407 TFT_show_ndl_mask:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1408 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1409 return ; YES - abort
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1410 FONT_COLOR_MASK ; NO - set color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1411 ; - set position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1412 WIN_STD dm_ndl_text_column, dm_ndl_text_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1413 STRCPY_TEXT_PRINT tNDL ; - print "NDL"
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1414 btfss deco_region ; - was the dive within deco stops region?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1415 return ; NO - done
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1416 btfsc safety_stop_active ; YES - safety stop shown?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1417 return ; YES - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1418 goto TFT_show_slow_reminder ; NO - show "slow" reminder
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1419
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1420
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1421 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1422 ; Dive Mode - Deco Layout Add-on
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1423 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1424 global TFT_show_deco_mask
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1425 TFT_show_deco_mask:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1426 bcf safety_stop_active ; flag safety stop is not shown any more TODO: needed?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1427 btfsc dive_main_menu ; is the dive mode menu shown?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1428 return ; YES - abort
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1429 btfsc alt_layout_active ; NO - in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1430 bra TFT_show_deco_mask_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1431 ;bra TFT_show_deco_mask_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1432
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1433 TFT_show_deco_mask_norm:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1434 WIN_STD dm_tts_text_col_norm, dm_tts_text_row_norm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1435 bra TFT_show_deco_mask_common ; continue with common part
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1436
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1437 TFT_show_deco_mask_alt:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1438 WIN_TINY dm_tts_text_col_alt, dm_tts_text_row_alt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1439 STRCPY "Stop/" ; print "Stop/"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1440 ;bra TFT_show_deco_mask_common ; continue with common part
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1441
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1442 TFT_show_deco_mask_common:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1443 FONT_COLOR_MASK ; set color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1444 STRCAT_TEXT_PRINT tTTS ; print "TTS"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1445 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1446
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1447
0
heinrichsweikamp
parents:
diff changeset
1448 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1449 tft_out6 CODE
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1450 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1451
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1452
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1453 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1454 ; Dive Mode - show Dive Time
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1455 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1456 global TFT_show_divetime
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1457 TFT_show_divetime:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1458 FONT_COLOR_MEMO ; set color
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1459 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
1460 btfsc show_only_divemins ; shall suppress display of seconds?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1461 bra TFT_show_divetime_min_only ; YES - show minutes only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1462 movlw .99 ; NO - load 99
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1463 cpfsgt mpr+0 ; - dive time > 99 minutes ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1464 bra TFT_show_divetime_min_sec ; NO - show min:sec
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1465 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
1466 btfsc alt_layout_active ; - in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1467 bra TFT_show_divetime_clear_alt ; YES - clear min:sec area of alternative layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1468 ;bra TFT_show_divetime_clear_norm ; NO - clear min:sec area of normal layout
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1469
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1470 TFT_show_divetime_clear_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1471 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
1472 bra TFT_show_divetime_min_only_norm ; show minutes only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1473
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1474 TFT_show_divetime_clear_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1475 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
1476 bra TFT_show_divetime_min_only_alt ; show minutes only
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1477
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1478 TFT_show_divetime_min_sec:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1479 ; show the minutes
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1480 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1481 bra TFT_show_divetime_min_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1482 ;bra TFT_show_divetime_min_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1483
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1484 TFT_show_divetime_min_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1485 WIN_MEDIUM dm_divetime_col_medium, dm_divetime_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1486 bra TFT_show_divetime_min_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1487
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1488 TFT_show_divetime_min_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1489 WIN_LARGE dm_divetime_col_large, dm_divetime_row
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1490 ;bra TFT_show_divetime_min_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1491
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1492 TFT_show_divetime_min_com:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1493 output_99 ; print minutes (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1494 PRINT ; dump buffer to screen
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1495
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1496 ; show the seconds
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1497 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1498 bra TFT_show_divetime_sec_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1499 ;bra TFT_show_divetime_sec_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1500
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1501 TFT_show_divetime_sec_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1502 WIN_SMALL dm_divetime_sec_col_small, dm_divetime_sec_row_small
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1503 bra TFT_show_divetime_sec_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1504
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1505 TFT_show_divetime_sec_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1506 WIN_MEDIUM dm_divetime_sec_col_medium, dm_divetime_sec_row_medium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1507 ;bra TFT_show_divetime_sec_com ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1508
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1509 TFT_show_divetime_sec_com:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1510 PUTC ':' ; print separator char
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1511 movff mpr+2,lo ; copy seconds to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1512 output_99x ; print seconds (00-99)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1513 bra TFT_divemins_exit ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1514
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1515 TFT_show_divetime_min_only:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1516 btfsc alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1517 bra TFT_show_divetime_min_only_alt ; YES
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1518 ;bra TFT_show_divetime_min_only_norm ; NO
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1519
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1520 TFT_show_divetime_min_only_norm:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1521 WIN_MEDIUM dm_divetime_minonly_col_medium, dm_divetime_row
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1522 output_9999 ; print minutes (0-9999)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1523 bra TFT_divemins_exit ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1524
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1525 TFT_show_divetime_min_only_alt:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1526 WIN_LARGE dm_divetime_minonly_col_large, dm_divetime_row
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1527 output_999 ; print minutes (0-999)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1528 ;bra TFT_divemins_exit ; continue with common part
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1529
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1530 TFT_divemins_exit:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1531 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1532 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1533
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1534
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1535 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1536 ; Dive Mode - show current Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1537 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1538 global TFT_show_depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1539 TFT_show_depth:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1540 MOVII pressure_rel_cur_cached,mpr ; copy relative pressure to MPR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1541 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1542 call TFT_color_code_depth ; set warning / attention flags and color-code the output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1543 rcall TFT_depth_blink ; control animation (blinking)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1544
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1545 rcall TFT_depth_position_m_ft ; set output position for full meters/feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1546 TSTOSS opt_units ; 0=m, 1=ft ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1547 bra TFT_depth_metric ; 0 - metric
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1548 ;bra TFT_depth_imperial ; 1 - imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1549
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1550 TFT_depth_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1551 MOVLI .30,sub_a ; load depth threshold of 30 cm (for showing 0 if shallower)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1552 MOVII mpr,sub_b ; get current depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1553 call cmpU16 ; compute sub_a - sub_b = threshold - current depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1554 btfss neg_flag ; shallower than 30 cm ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1555 bra depth_0_feet ; YES - print a zero directly
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1556 call convert_cm_to_feet ; NO - convert value in hi:lo from [cm] to [feet]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1557 output_999 ; - feet in large or huge font
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1558 PRINT ; - dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1559 bra TFT_depth_exit ; - do some cleanup and show target depth if in simulator mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1560
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1561 depth_0_feet:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1562 STRCAT_PRINT " 0" ; print a zero directly
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1563 bra TFT_depth_exit ; do some cleanup and show target depth if in simulator mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1564
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1565 TFT_depth_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1566 bsf omit_digit_2 ; print depth in full meters, i.e. do not print 2nd and 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1567 output_9999 ; test-print depth for range up to 99.9 meter (0xx-99xx)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1568 btfsc output_overflow ; did the printing clip, i.e. deeper than 99.9 meter?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1569 bra TFT_depth_metric_100m ; YES - print depth in full meters only
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1570
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1571 ; depth in meters and decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1572 btfsc cur_depth_greater_100m ; was the depth >= 100 meter during last call?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1573 rcall TFT_depth_box_black ; YES - clear depth area
643
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
1574
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
1575 btfsc cur_depth_greater_100m ; was the depth >= 100 meter during last call?
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
1576 rcall TFT_depth_position_m_ft ; re-set output position for full meters/feet
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
1577
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1578 bcf cur_depth_greater_100m ; current depth is now < 100 meter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1579 PRINT ; dump full meters to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1580
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1581 btfsc depth_inverse_last ; in inverse printing cycle?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1582 bsf win_invert ; YES - print inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1583 rcall TFT_depth_position_dm ; set output position for decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1584 MOVLI .30,sub_a ; 30 mbar = 0.3 meter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1585 MOVII mpr,sub_b ; current depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1586 call cmpU16 ; compare (sub_a - sub_b)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1587 btfss neg_flag ; current depth < 0.3 meter ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1588 bra depth_0_decimeter ; YES - print a zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1589 output_65535 ; NO - print full depth to buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1590 REINIT_BUFFER ; - re-initialize the output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1591 PUTC "." ; - print a decimal point
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1592 movff buffer+3,POSTINC2 ; - get and print the decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1593 PRINT ; - dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1594 bra TFT_depth_exit ; - do some cleanup and show target depth if in simulator mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1595 depth_0_decimeter:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1596 STRCAT_PRINT ".0" ; print a zero directly and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1597 bra TFT_depth_exit ; do some cleanup and show target depth if in simulator mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1598
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1599 TFT_depth_metric_100m:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1600 ; full meters only
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1601 btfss cur_depth_greater_100m ; was the depth >= 100 meter during last call?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1602 rcall TFT_depth_box_black ; NO - clear depth area
643
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
1603
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
1604 btfss cur_depth_greater_100m ; was the depth >= 100 meter during last call?
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
1605 rcall TFT_depth_position_m_ft ; re-set output position for full meters/feet
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
1606
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1607 bsf cur_depth_greater_100m ; depth is >= 100 meter now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1608 REINIT_BUFFER ; re-initialize the output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1609 bsf omit_digit_2 ; print depth in full meters, i.e. do not print 1st and 2nd digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1610 output_65535 ; print depth for range >= 100 meter (0xx-655xx)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1611 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1612 ;bra TFT_depth_exit ; do some cleanup and show target depth if in simulator mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1613
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1614 TFT_depth_exit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1615 btfss alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1616 bra TFT_depth_exit_2 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1617 btfsc depth_inverse_last ; YES - was last output in inverse mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1618 bra TFT_depth_exit_2 ; YES - do not restore "Depth" as it collides with depth number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1619 btfsc cur_depth_greater_100m ; NO - current depth >= 100 m?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1620 bra TFT_depth_exit_2 ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1621 ;bra TFT_depth_exit_1 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1622
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1623 TFT_depth_exit_1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1624 WIN_TINY dm_mask_depth_column_alt,dm_mask_depth_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1625 FONT_COLOR_MASK ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1626 STRCAT_TEXT_PRINT tDepth ; restore "Depth" title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1627
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1628 TFT_depth_exit_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1629 btfss sensor_override_active ; pressure sensor override active (simulator mode)?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1630 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1631 bra TFT_depth_target ; YES - show simulator target depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1632
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1633
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1634 ; Helper Function - control animation (blinking)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1635 TFT_depth_blink:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1636 TSTOSS opt_depth_warn ; 0=standard, 1=blink
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1637 return ; standard, done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1638 btfsc depth_color_last ; was there a warning or attention on the depth in the previous cycle?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1639 bra TFT_depth_blink_prev ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1640 btfsc depth_color_warning ; NO - do we have a depth warning now?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1641 bra TFT_depth_blink_new ; YES - so we have a warning now but not previously
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1642 btfsc depth_color_attention ; NO - do we have a depth attention now?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1643 bra TFT_depth_blink_new ; YES - so we have attention now but not previously
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1644 bra TFT_depth_blink_none ; NO - no warning in previous cycle, no warning now, reset all flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1645
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1646 TFT_depth_blink_prev:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1647 ; we had a warning or attention in previous cycle, check if we still have a warning or attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1648 btfsc depth_color_warning ; do we still have a warning?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1649 bra TFT_depth_blink_prev_1 ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1650 btfsc depth_color_attention ; NO - do we still have an attention?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1651 bra TFT_depth_blink_prev_1 ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1652 ; we had a warning or attention before, but not now any more - clear depth area from previous color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1653 rcall TFT_depth_box_black ; NO - clear depth area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1654 ;bra TFT_depth_blink_none ; - reset all flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1655
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1656 TFT_depth_blink_none:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1657 bcf depth_inverse_last ; memorize depth was printed in normal
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1658 bcf depth_color_last ; memorize there was no warning or attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1659 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1660 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1661
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1662 TFT_depth_blink_prev_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1663 ; we had a warning or attention in previous cycle, and we still have a warning or attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1664 btfss depth_inverse_last ; was the depth printed in inverse last time?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1665 bra TFT_depth_blink_set ; NO - print in inverse now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1666 bra TFT_depth_blink_reset ; YES - print in normal now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1667
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1668 TFT_depth_blink_new:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1669 ; we had no warning or attention in previous cycle, but now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1670 bsf depth_color_last ; memorize that the depth had a warning or attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1671 ;bra TFT_depth_blink_set ; start with inverse display
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1672
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1673 TFT_depth_blink_set:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1674 ; fill the area with respective color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1675 movf pallet_color_attention,W ; select attention color as default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1676 btfsc depth_color_warning ; do we have a warning?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1677 movf pallet_color_warning,W ; YES - replace with warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1678 rcall TFT_depth_box_color ; color depth area with color in WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1679 bsf win_invert ; print in inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1680 bsf depth_inverse_last ; memorize depth was printed in inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1681 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1682
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1683 TFT_depth_blink_reset:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1684 ; fill the area with black color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1685 rcall TFT_depth_box_black ; clear depth area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1686 bcf depth_inverse_last ; memorize depth was printed in normal
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1687 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1688
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1689
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1690 ; Helper Function - set output position for full meters/feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1691 TFT_depth_position_m_ft: ; output position meters / feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1692 btfsc alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1693 bra TFT_depth_position_m_ft_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1694 ;bra TFT_depth_position_m_ft_norm; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1695
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1696 TFT_depth_position_m_ft_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1697 WIN_LARGE dm_depth_col_large,dm_depth_row_large
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1698 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1699
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1700 TFT_depth_position_m_ft_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1701 WIN_HUGE dm_depth_col_huge, dm_depth_row_huge
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1702 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1703
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1704
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1705 ; Helper Function - set output position for decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1706 TFT_depth_position_dm: ; output position decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1707 btfsc alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1708 bra TFT_depth_position_dm_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1709 bra TFT_depth_position_dm_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1710
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1711 TFT_depth_position_dm_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1712 WIN_MEDIUM dm_depth_dm_col_medium, dm_depth_dm_row_medium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1713 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1714 TFT_depth_position_dm_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1715 WIN_LARGE dm_depth_dm_col_large, dm_depth_dm_row_large
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1716 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1717
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1718
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1719 ; Helper Function - clear depth area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1720 TFT_depth_box_black:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1721 clrf WREG ; select black color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1722 ;bra TFT_depth_box_color ; continue with colored box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1723
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1724
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1725 ; Helper Function - color depth area with color in WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1726 TFT_depth_box_color:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1727 btfsc alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1728 bra TFT_depth_box_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1729 ;bra TFT_depth_box_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1730
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1731 TFT_depth_box_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1732 WIN_BOX_COLOR dm_depth_row_large,dm_depth_bot_large,dm_depth_col_large,dm_depth_rgt_large
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1733 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1734
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1735 TFT_depth_box_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1736 WIN_BOX_COLOR dm_mask_depth_row, dm_depth_bot_huge, dm_depth_col_huge, dm_depth_rgt_huge
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1737 TFT_depth_box_exit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1738 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1739
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1740
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1741 ; Helper Function - show simulated target depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1742 TFT_depth_target:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1743 FONT_COLOR_ATTENTION ; select attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1744 movff simulatormode_depth,lo ; copy target depth to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1745 TSTOSS opt_units ; check unit selection (0=m or 1=ft)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1746 bra TFT_depth_target_metric ; 0 - metric
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1747 ;bra TFT_depth_target_imperial ; 1 - imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1748
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1749 TFT_depth_target_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1750 btfsc alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1751 bra TFT_depth_target_imperial_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1752 ;bra TFT_depth_target_imperial_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1753
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1754 TFT_depth_target_imperial_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1755 WIN_TINY dm_mask_depth_column+.40,dm_mask_depth_row ; position right of depth label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1756 bra TFT_depth_target_imperial_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1757
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1758 TFT_depth_target_imperial_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1759 WIN_TINY dm_mask_depth_column+.62,dm_mask_depth_row+.20 ; position within last digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1760 ;bra TFT_depth_target_imperial_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1761
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1762 TFT_depth_target_imperial_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1763 call convert_meter_to_feet ; convert value in lo from meters to feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1764 output_999 ; display only last three digits from a 16 bit value (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1765 STRCAT_PRINT "ft" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1766 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1767
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1768 TFT_depth_target_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1769 btfsc alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1770 bra TFT_depth_target_metric_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1771 ;bra TFT_depth_target_metric_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1772
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1773 TFT_depth_target_metric_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1774 WIN_TINY dm_mask_depth_column+.38,dm_mask_depth_row+.22 ; position right of full meters, above decimal
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1775 bra TFT_depth_target_metric_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1776
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1777 TFT_depth_target_metric_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1778 WIN_TINY dm_mask_depth_column+.65,dm_mask_depth_row+.20 ; position right of full meters, above decimal
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1779 ;bra TFT_depth_target_metric_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1780
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1781 TFT_depth_target_metric_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1782 output_256 ; display target depth (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1783 PUTC_PRINT "m" ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1784 return ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1785
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1786
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1787 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1788 ; Dive Mode - show maximum Depth
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1789 ;
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1790 global TFT_show_max_depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1791 TFT_show_max_depth:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1792 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1793 btfsc alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1794 bra TFT_show_max_depth_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1795 ;bra TFT_show_max_depth_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1796
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1797 TFT_show_max_depth_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1798 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1799 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1800 bra TFT_show_max_depth_norm_1 ; NO - keep position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1801 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row ; YES - adopt output position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1802
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1803 TFT_show_max_depth_norm_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1804 btfsc FLAG_apnoe_mode ; in apnoe mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1805 bra TFT_max_depth_apnoe ; YES - different handling in apnoe mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1806 TSTOSS opt_2ndDepthDisp ; NO - show average depth instead of max depth?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1807 bra TFT_max_depth_current ; NO - show max depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1808 bra TFT_avg_depth_current ; YES - show avg depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1809
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1810 TFT_max_depth_apnoe:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1811 btfss apnoe_at_surface ; apnoe mode, at the surface?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1812 bra TFT_max_depth_current ; NO - show max depth of current dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1813 MOVII apnoe_max_pressure,mpr ; YES - get max pressure of all dives so far
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1814 bra TFT_max_depth_common ; - continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1815
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1816 TFT_max_depth_current:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1817 MOVII pressure_rel_max_cached,mpr ; get the "normal" max pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1818 bra TFT_max_depth_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1819
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1820 TFT_avg_depth_current:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1821 MOVII pressure_rel_avg_total,mpr ; get total dive average pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1822 ;bra TFT_max_depth_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1823
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1824 TFT_max_depth_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1825 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1826 TSTOSS opt_units ; 0=m or 1=ft ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1827 bra TFT_max_depth_metric ; 0 - use metric version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1828 ;bra TFT_max_depth_imperial ; 1 - use imperial version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1829
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1830 TFT_max_depth_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1831 bra TFT_show_depth_helper_imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1832
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1833 TFT_max_depth_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1834 bsf omit_digit_2 ; print depth in full meters, i.e. do not print 2nd and 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1835 output_9999 ; test-print depth for range up to 99.9 meter (0xx-99xx)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1836 btfsc output_overflow ; did the printing clip, i.e. deeper than 99.9 meter?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1837 bra TFT_max_depth_metric_100m ; YES - print depth in full meters only
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1838 ;bra TFT_max_depth_metric_99m ; NO - print depth in meters and decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1839
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1840 TFT_max_depth_metric_99m:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1841 ; full meters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1842 btfsc max_depth_greater_100m ; was the depth >= 100 meter during last call?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1843 rcall TFT_max_depth_box_black ; NO - clear max depth area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1844 bcf max_depth_greater_100m ; current depth is now < 100 meter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1845 PRINT ; dump full meters to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1846 ; decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1847 rcall TFT_max_depth_metric_dm ; set output position for decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1848 output_65535 ; print full depth to buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1849 REINIT_BUFFER ; re-initialize the output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1850 PUTC "." ; print a decimal point
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1851 movff buffer+3,POSTINC2 ; get and print the decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1852 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1853 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1854
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1855 TFT_max_depth_metric_100m:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1856 ; full meters only
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1857 btfss max_depth_greater_100m ; was the depth >= 100 meter during last call?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1858 rcall TFT_max_depth_box_black ; NO - clear max depth area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1859 bsf max_depth_greater_100m ; depth is >= 100 meter now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1860 REINIT_BUFFER ; re-initialize the output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1861 bsf omit_digit_2 ; print depth in full meters, i.e. do not print 1st and 2nd digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1862 output_65535 ; print depth for range >= 100 meter (0xx-655xx)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1863 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1864 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1865
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1866 TFT_show_max_depth_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1867 btfsc FLAG_apnoe_mode ; in apnoe mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1868 bra TFT_show_apnoe_max_depth ; YES - use apnoe surface output also in alternative dive mode screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1869 btfss FLAG_gauge_mode ; NO - in gauge mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1870 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1871 ;bra TFT_show_gauge_max_avg_depth; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1872
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1873 TFT_show_gauge_max_avg_depth:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1874 WIN_MEDIUM dm_gauge_max_depth_col, dm_gauge_max_depth_row ; set position for max depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1875 MOVII pressure_rel_max_cached,mpr ; get max pressure into hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1876 rcall TFT_show_depth_helper ; print max depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1877 WIN_MEDIUM dm_gauge_avg_depth_col, dm_gauge_avg_depth_row ; set position for avg depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1878 MOVII pressure_rel_avg_total,mpr ; get average pressure into hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1879 bra TFT_show_depth_helper ; print avg depth and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1880
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1881
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1882 ; Helper Function - clear max depth area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1883 TFT_max_depth_box_black:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1884 WIN_BOX_BLACK dm_max_depth_row, dm_max_depth_bot, dm_max_depth_column, dm_max_depth_rgt
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1885 return ; done
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1886
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1887
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1888 ; Helper Function - set output position for decimeters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1889 TFT_max_depth_metric_dm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1890 WIN_SMALL dm_max_depth_dm_column_nvsi, dm_max_depth_dm_row ; default position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1891 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1892 return ; NO - keep position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1893 WIN_SMALL dm_max_depth_dm_column, dm_max_depth_dm_row ; YES - adopt position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1894 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1895
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1896
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1897 ; Helper Function - print depth in mpr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1898 TFT_show_depth_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1899 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1900 TSTOSS opt_units ; 0=m, 1=ft
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1901 bra TFT_show_depth_helper_metric ; 0 - metric
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1902 ;bra TFT_show_depth_helper_imperial ; 1 - imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1903
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1904 TFT_show_depth_helper_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1905 call convert_cm_to_feet ; convert value in hi:lo from [cm] to [feet]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1906 output_999 ; print depth (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1907 PRINT ; dump to screen
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1908 return ; done
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
1909
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1910 TFT_show_depth_helper_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1911 bsf omit_digit_1 ; do not print 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1912 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1913 output_65535 ; print depth (0.0x-655.3x)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1914 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1915 return ; done
0
heinrichsweikamp
parents:
diff changeset
1916
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
1917
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
1918 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1919 ; Dive Mode - show maximum Depth - Apnoe Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1920 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1921 global TFT_show_apnoe_max_depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1922 TFT_show_apnoe_max_depth:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1923 ; title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1924 WIN_TINY dm_apnoe_last_max_depth_text_col, dm_apnoe_last_max_depth_text_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1925 FONT_COLOR_MASK ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1926 btfsc alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1927 bra TFT_show_apnoe_max_depth_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1928 ;bra TFT_show_apnoe_max_depth_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1929
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1930 TFT_show_apnoe_max_depth_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1931 STRCPY_TEXT_PRINT tApnoeMax ; print "Last Descent"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1932 bra TFT_show_apnoe_max_depth_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1933
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1934 TFT_show_apnoe_max_depth_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1935 STRCPY_TEXT_PRINT tMaxDepth ; print "Max.Depth"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1936 ;bra TFT_show_apnoe_max_depth_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1937
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1938 TFT_show_apnoe_max_depth_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1939 ; value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1940 WIN_MEDIUM dm_apnoe_last_max_depth_column, dm_apnoe_last_max_depth_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1941 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1942 MOVII pressure_rel_max_cached,mpr ; get max pressure into hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1943 bra TFT_show_depth_helper ; print max depth and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1944
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1945
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1946 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1947 ; Dive Mode - show Temperature
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1948 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1949 global TFT_show_temp_divemode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1950 TFT_show_temp_divemode:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1951 btfsc dive_pre_menu ; is the pre-menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1952 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1953 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1954 return ; YES - abort, no update of temperature now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1955 btfsc better_gas_blinking ; blinking better gas?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1956 return ; YES - abort, no update of temperature now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1957 btfsc better_dil_blinking ; blinking better diluent?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1958 return ; YES - abort, no update of temperature now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1959
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1960 WIN_SMALL dm_temp_column,dm_temp_row; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1961 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1962 movlw index_compass_dm ; index of compass custom view
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1963 cpfseq active_customview ; compass shown in custom view?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1964 goto TFT_temp_common ; NO - continue with common part for temperature
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1965 goto TFT_update_stopwatch ; YES - show resettable dive time instead of temperature
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
1966
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1967
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1968 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1969 ; Dive Mode - active Gas and Setpoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1970 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1971 global TFT_show_active_gas_divemode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1972 TFT_show_active_gas_divemode:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1973 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1974 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1975 btfsc FLAG_apnoe_mode ; in apnoe mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1976 return ; YES - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1977 btfsc FLAG_gauge_mode ; in gauge mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1978 return ; YES - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1979
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1980 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1981
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1982 btfsc FLAG_oc_mode ; in OC mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1983 bra TFT_active_gas ; YES - show OC gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1984 btfss bailout_mode ; NO - in bailout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1985 bra TFT_active_sp_loop ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1986 ;bra TFT_active_sp_bailout ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1987
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1988 TFT_active_sp_bailout:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1989 WIN_SMALL dm_active_dil_column, dm_active_dil_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1990 FONT_COLOR_ATTENTION ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1991 STRCPY_TEXT_PRINT tDiveBailout ; print "Bailout"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1992 bra TFT_active_gas ; continue showing OC bailout gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1993
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1994 TFT_active_sp_loop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1995 MOVII int_O_breathed_ppO2,mpr ; copy ppO2 [cbar] to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1996 call TFT_color_code_ppo2 ; color-code the output by the ppO2 of the loop gas mixture
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1997 btfss timebase_1sec ; on even second?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1998 bra TFT_active_sp_print ; YES - print ppO2 with normal rendering
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
1999 btfsc warn_det_sensors_lost ; NO - all sensors lost?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2000 bra TFT_active_sp_fallback ; YES - process fallback case
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2001 movff int_O_breathed_ppO2+1,WREG ; NO - get flags again (have been cleared in hi:lo by TFT_color_code_ppo2 meanwhile)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2002 btfss WREG,int_warning_flag ; warning flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2003 bra TFT_active_sp_print ; NO - ppO2 is ok, print ppO2 with normal rendering
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2004 bra TFT_active_sp_invers ; YES - print with inverse rendering
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2005 TFT_active_sp_fallback: ; set up fallback case
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2006 FONT_COLOR_ATTENTION ; set color to attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2007 TFT_active_sp_invers:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2008 bsf win_invert ; print in inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2009 TFT_active_sp_print:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2010 WIN_MEDIUM dm_active_gas_sp_value_col, dm_active_gas_sp_value_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2011 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2012 output_999 ; print ppO2 (0.00-9.99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2013 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2014
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2015 btfsc sign_shown ; advice/attention/warning sign shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2016 bra TFT_active_diluent ; YES - do not overwrite in case of alternative layout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2017
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2018 btfsc velocity_active_vsi ; graphical vertical speed indicator shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2019 bra TFT_active_diluent ; YES - do not overwrite in case of alternative layout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2020
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2021 TFT_active_sp_label_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2022 WIN_STD dm_active_sp_label_col, dm_active_sp_label_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2023 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2024 STRCAT "bar" ; print "bar"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2025
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2026 IFDEF _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2027
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
2028 movf dive_ccr_mode,W ; get setpoint mode =0: Fixed SP, =1: Sensor, =2: Auto SP
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
2029 sublw .1 ; dive_ccr_mode = 1 (Sensor) ?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2030 bnz TFT_active_sp_label_2 ; NO - skip
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2031 btfsc alt_layout_active ; YES - in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2032 bra TFT_active_sp_label_2 ; YES - no space available for the "*"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2033 PUTC "*" ; NO - append "*"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2034
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2035 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2036
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2037 TFT_active_sp_label_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2038 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2039
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2040 TFT_active_loop_mode:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2041 WIN_TINY dm_active_sp_label_col, dm_active_dil_row+.3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2042 FONT_COLOR_MEMO ; set memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2043 btfsc FLAG_ccr_mode ; in CCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2044 bra TFT_active_loop_mode_ccr ; YES - print CCR label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2045 btfsc FLAG_pscr_mode ; in pSCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2046 bra TFT_active_loop_mode_pscr ; YES - print pSCR label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2047 bra TFT_active_diluent ; NO to both - should not happen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2048
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2049 TFT_active_loop_mode_ccr:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2050 STRCPY_TEXT_PRINT tDvCCR ; print "CCR"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2051 bra TFT_active_diluent ; continue with diluent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2052
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2053 TFT_active_loop_mode_pscr:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2054 STRCPY_TEXT_PRINT tDvPSCR ; print "pSCR"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2055 ;bra TFT_active_diluent ; continue with diluent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2056
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2057 TFT_active_diluent:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2058 MOVII int_O_pure_ppO2,mpr ; get ppO2 [cbar] into hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2059 call TFT_color_code_ppo2 ; color-code the output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2060 btfss better_dil_available ; better diluent available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2061 bra TFT_active_diluent_show ; NO - print in normal rendering
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2062 btg better_dil_blinking ; YES - toggle blink bit...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2063 btfss better_dil_blinking ; - blink now?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2064 bra TFT_active_diluent_show ; NO - print in normal rendering
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2065 FONT_COLOR_ATTENTION ; YES - print in attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2066 bsf win_invert ; - print in inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2067
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2068 TFT_active_diluent_show:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2069 WIN_SMALL dm_active_dil_column, dm_active_dil_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2070 bra TFT_active_dil_gas_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2071
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2072 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2073
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2074 TFT_active_gas:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2075 MOVII int_O_breathed_ppO2,mpr ; copy ppO2 [cbar] into hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2076 call TFT_color_code_ppo2 ; color-code the output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2077 btfss better_gas_available ; better gas available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2078 bra TFT_active_gas_print ; NO - print in normal rendering
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2079 btg better_gas_blinking ; YES - toggle blink bit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2080 btfss better_gas_blinking ; blink now?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2081 bra TFT_active_gas_print ; NO - print in normal rendering
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2082 FONT_COLOR_ATTENTION ; YES - blink in attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2083 bsf win_invert ; print in inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2084
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2085 TFT_active_gas_print:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2086 WIN_STD dm_active_gas_sp_value_col, dm_active_sp_label_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2087
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2088 TFT_active_dil_gas_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2089 movff char_I_O2_ratio,lo ; lo now stores O2 in %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2090 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2091 movff char_I_He_ratio,hi ; hi now stores He in %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2092 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2093 clrf hi ; set hi to zero (no He)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2094 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2095 call gaslist_strcat_mix ; print "Nxlo", "Txlo/hi", "Air" or "O2"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2096 PRINT ; dump to screen
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2097 return ; done
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2098
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2099
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2100 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2101 ; Dive Mode - NDL Time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2102 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2103 global TFT_show_ndl
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2104 TFT_show_ndl:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2105 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2106 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2107 MOVII int_O_NDL_norm,mpr ; NO - get NDL time in normal plan
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2108 rcall TFT_show_ndl_tts_set_color ; - set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2109 btfsc deco_locked ; - was the dive in deco?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2110 bra TFT_show_ndl_norm ; YES - use normal layout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2111 btfsc alt_layout_active ; NO - alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2112 bra TFT_show_ndl_alt ; YES - use alternative layout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2113 ;bra TFT_show_ndl_norm ; NO - use normal layout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2114
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2115 TFT_show_ndl_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2116 WIN_MEDIUM dm_ndl_value_col_norm,dm_ndl_value_row_norm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2117 output_256 ; print NDL (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2118 PUTC_PRINT "'" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2119 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2120
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2121 TFT_show_ndl_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2122 btfsc safety_stop_active ; is the safety stop active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2123 bra TFT_show_ndl_alt_safety ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2124 ;bra TFT_show_ndl_alt_no_safety ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2125
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2126 TFT_show_ndl_alt_no_safety: ; clear potential remains from NDL normal
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2127 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2128 WIN_LARGE dm_ndl_value_col_alt, dm_ndl_value_row_alt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2129 output_99 ; print NDL (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2130 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2131 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2132
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2133 TFT_show_ndl_alt_safety:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2134 WIN_MEDIUM dm_ndl_value_col_norm,dm_ndl_value_row_norm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2135 output_256 ; print NDL (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2136 PUTC_PRINT "'" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2137 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2138
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2139
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2140 ; Helper Function - set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2141 TFT_show_ndl_tts_set_color:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2142 movf pallet_color_memo,W ; load memo color as default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2143 btfsc mpr+1,int_invalid_flag ; is the invalid flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2144 movf pallet_color_disabled,W ; YES - replace by disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2145 movwf font_color ; set font color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2146 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2147
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2148
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2149 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2150 ; Dive Mode - TTS Time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2151 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2152 global TFT_show_tts
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2153 TFT_show_tts:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2154 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2155 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2156 MOVII int_O_TTS_norm,mpr ; NO - get the TTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2157 rcall TFT_show_ndl_tts_set_color ; - color-code
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2158 bcf hi,int_invalid_flag ; - clear the invalid flag if applicable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2159 btfsc alt_layout_active ; - in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2160 bra TFT_display_tts_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2161 ;bra TFT_display_tts_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2162
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2163 TFT_display_tts_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2164 WIN_MEDIUM dm_tts_value_col_999x, dm_tts_value_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2165 output_999 ; print (0...999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2166 PUTC_PRINT "'" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2167 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2168
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2169 TFT_display_tts_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2170 output_99 ; print TTS for range 0-99
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2171 btfsc output_overflow ; does TTS fit into 0-99 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2172 bra TFT_display_tts_alt_999 ; NO - print in 999 format
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2173 ;bra TFT_display_tts_alt_99 ; YES - print in 99 format
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2174
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2175 TFT_display_tts_alt_99:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2176 btfsc tts_over_99_last ; was TTS > 99 last time?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2177 rcall TFT_display_tts_clear ; YES - clear remains from TTS > 99
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2178 WIN_MEDIUM dm_tts_value_col_99, dm_tts_value_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2179 output_99 ; print TTS (0...99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2180 PUTC_PRINT "'" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2181 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2182
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2183 TFT_display_tts_alt_999:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2184 WIN_MEDIUM dm_tts_value_col_999, dm_tts_value_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2185 REINIT_BUFFER ; clear the buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2186 output_999 ; print (0...999), no space for unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2187 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2188 bsf tts_over_99_last ; remember last TTS was > 99 mins
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2189 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2190
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2191
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2192 ; Helper Function - clear remains from TTS > 99
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2193 TFT_display_tts_clear: ; clear remains from TTS > 99
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2194 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2195 bcf tts_over_99_last ; remember last TTS was NOT > 99 mins
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2196 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2197
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2198
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2199 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2200 ; Dive Mode - Deco Stop Time & Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2201 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2202 global TFT_show_deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2203 TFT_show_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2204 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2205 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2206
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2207 movff char_O_deco_depth,lo ; get depth of first stop in meters
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2208 call TFT_color_code_stop ; color-code output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2209 TSTOSC opt_units ; get unit (0=m, 1=ft)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2210 bra TFT_show_deco_norm ; 1 - ft can only be displayed in normal layout due to space required for 3 digit depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2211 btfsc alt_layout_active ; 0 - in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2212 bra TFT_show_deco_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2213 ;bra TFT_show_deco_norm ; NO - combined depth and time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2214
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2215 TFT_show_deco_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2216 WIN_MEDIUM dm_decostop_col_norm, dm_decostop_row_norm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2217 call TFT_display_stop_depth ; print stop (depth in lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2218 PUTC ' ' ; put a space char between depth and time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2219 bra TFT_display_deco_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2220
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2221 TFT_show_deco_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2222 WIN_LARGE dm_decostop_col_alt_depth, dm_decostop_row_alt_depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2223 output_99 ; print stop depth (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2224 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2225 WIN_MEDIUM dm_decostop_col_alt_time, dm_decostop_row_alt_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2226 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2227 ;bra TFT_display_deco_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2228
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2229 TFT_display_deco_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2230 movff char_O_deco_time,lo ; get stop time of the first stop in minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2231 output_99DD ; print minutes or double dots if null
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2232 PUTC_PRINT "'" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2233 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2234
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2235
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2236 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2237 tft_out7 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2238 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2239
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2240 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2241 ; Dive Mode - Apnoe current and overall Dive Time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2242 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2243 global TFT_show_apnoe_times
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2244 TFT_show_apnoe_times:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2245 ; current dive time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2246 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2247 WIN_MEDIUM dm_divetime_apnoe_col, dm_divetime_apnoe_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2248 SMOVII apnoe_dive_mins,mpr ; ISR-safe copy of minutes to lo and seconds to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2249 output_99 ; print minutes (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2250 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2251 WIN_SMALL dm_divetime_apnoe_secs_col, dm_divetime_apnoe_secs_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2252 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2253 movff hi,lo ; copy seconds to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2254 output_99x ; print seconds (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2255 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2256 ; overall dive time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2257 WIN_MEDIUM dm_apnoe_total_divetime_col, dm_apnoe_total_divetime_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2258 SMOVTT counted_divetime_mins,mpr ; ISR-safe 3 byte copy of minutes:2 and seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2259 output_256 ; minutes (0-256)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2260 PRINT ; show minutes in large font
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2261 WIN_SMALL dm_apnoe_total_divetime_secs_col, dm_apnoe_total_divetime_secs_row ; left position for two sec figures
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2262 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2263 movff up,lo ; copy seconds from up to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2264 output_99x ; print seconds (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2265 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2266 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2267
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2268
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2269 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2270 ; Dive Mode - show Apnoe Surface Time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2271 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2272 global TFT_show_apnoe_surface
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2273 TFT_show_apnoe_surface:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2274 FONT_COLOR_MASK ; select mask color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2275 WIN_TINY dm_apnoe_surface_time_text_col, dm_apnoe_surface_time_text_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2276 STRCPY_TEXT_PRINT tApnoeSurface ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2277 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2278 WIN_MEDIUM dm_apnoe_surface_time_column, dm_apnoe_surface_time_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2279 SMOVII apnoe_surface_mins,mpr ; ISR-safe copy of minutes to lo and seconds to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2280 output_256 ; print minutes (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2281 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2282 movff hi,lo ; copy seconds to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2283 output_99x ; print seconds (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2284 PRINT ; dump to screen
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2285 return ; done
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2286
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2287
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2288 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2289 ; Dive Mode - clear Apnoe Surface Time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2290 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2291 global TFT_clear_apnoe_surface
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2292 TFT_clear_apnoe_surface:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2293 WIN_BOX_BLACK dm_apnoe_last_max_depth_text_row, .239, dm_apnoe_last_max_depth_column, .159
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2294 return ; done
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2295
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2296
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2297 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2298 tft_out8 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2299 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2300
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2301
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2302 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2303 ; Dive Mode - clear Deco Data (NDL / Stop & TTS )
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2304 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2305 global TFT_clear_deco_data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2306 TFT_clear_deco_data:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2307 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2308 return ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2309
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2310 WIN_BOX_BLACK dm_decostop_row_alt_depth, dm_3rdrow_bot, dm_decostop_col_alt_depth, dm_3rdrow_rgt ; top, bottom, left, right
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2311 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2312
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2313
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
2314 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2315 ; Dive Mode - clear Dive Mode Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2316 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2317 ; starts 2 pixel higher to completely wipe away the temperature display
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2318 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2319 global TFT_clear_divemode_menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2320 TFT_clear_divemode_menu:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2321 WIN_BOX_BLACK dm_menu_row-.2, dm_menu_lower, dm_menu_left, dm_menu_right
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2322 return
544
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
2323
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2324
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2325 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2326 VSI_table CODE_PACK
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2327 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2328
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2329 VSI_table:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2330
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2331 ; use a depth-dependent ascent rate warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2332 ; depth(ft): <20 >20 >40 >60 >75 >88 >101 >115 >128 >144 >164
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2333 ; speed(ft/min): 23 26 29 33 36 43 49 56 59 62 66
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2334 ; depth(m): <=6 >6 >12 >18 >23 >27 >31 >35 >39 >44 >50
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2335 ; speed(m/min): 7 8 9 10 11 13 15 17 18 19 20 (warning)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2336 ; speed(m/min): 5 6 7 8 8 10 12 13 14 15 15 (attention)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2337
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2338 ; < depth (m), warning speed, attention speed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2339 DB .6, .7, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2340 DB .12, .8, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2341 DB .18, .9, .7
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2342 DB .23,.10, .8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2343 DB .27,.11, .8
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2344 DB .31,.13,.10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2345 DB .35,.15,.12
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2346 DB .39,.17,.13
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2347 DB .44,.18,.14
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2348 DB .50,.19,.15
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2349 DB .255,.20,.15
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2350
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2351
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2352 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2353 tft_out9 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2354 ;=============================================================================
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2355
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
2356
0
heinrichsweikamp
parents:
diff changeset
2357 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2358 ; Dive Mode - show vertical Velocity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2359 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2360 global TFT_velocity_show
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2361 TFT_velocity_show:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2362 FONT_COLOR_MEMO ; set default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2363 btfsc neg_flag_velocity ; descending?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2364 rcall TFT_velocity_set_color ; NO - set color for text dependent on speed and set threshold for VSI graph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2365 rcall TFT_velocity_num ; show the numerical VSI
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2366 TSTOSS opt_vsigraph ; graphical VSI bar enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2367 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2368 btfss neg_flag_velocity ; YES - in ascent?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2369 bra TFT_velocity_clear_graph ; NO - clear the graph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2370 ;bra TFT_velocity_graph_show ; YES - show the graph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2371
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2372 TFT_velocity_graph_show:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2373 btfsc alt_layout_active ; in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2374 return ; YES - done (not implemented)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2375
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2376 btfsc velocity_active_vsi ; was the graphical VSI shown before?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2377 bra TFT_velocity_graph_1 ; YES - no need to redraw the framework box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2378 bsf velocity_active_vsi ; NO - remember it is shown as of now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2379 ; - draw the framework box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2380 movf pallet_color_mask,W ; - color -> WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2381 WIN_FRAME_COLOR dm_velocity_graph_top+.00, dm_velocity_graph_bot-.00, dm_velocity_graph_lft, dm_velocity_graph_rgt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2382 movf pallet_color_mask,W ; - color -> WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2383 WIN_FRAME_COLOR dm_velocity_graph_top+.10, dm_velocity_graph_bot-.10, dm_velocity_graph_lft, dm_velocity_graph_rgt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2384 movf pallet_color_mask,W ; - color -> WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2385 WIN_FRAME_COLOR dm_velocity_graph_top+.20, dm_velocity_graph_bot-.20, dm_velocity_graph_lft, dm_velocity_graph_rgt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2386 movf pallet_color_mask,W ; - color -> WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2387 WIN_FRAME_COLOR dm_velocity_graph_top+.30, dm_velocity_graph_bot-.30, dm_velocity_graph_lft, dm_velocity_graph_rgt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2388
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2389 TFT_velocity_graph_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2390 movff divA+0,hi ; copy ascend speed (in m/min) to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2391 movff divA+1,xA+0 ; m/min for warning level (upper two blocks)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2392 clrf xA+1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2393 MOVLI .5,xB ; threshold for color warning (5 color normal + 2 color warning)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2394 call div16x16 ; xC = xA / xB with xA as remainder
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2395 ; xC+0 holds step size in m/min (e.g. =3 for 15m/min warning threshold)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2396 movff hi,xA+0 ; velocity in m/min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2397 clrf xA+1 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2398 movff xC+0,xB+0 ; step size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2399 clrf xB+1 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2400 call div16x16 ; xC = xA / xB with xA as remainder
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2401 movff xC+0,lo ; copy amount of segments to show to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2402 incf lo,F ; lo +=1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2403 dcfsnz lo,F ; lo = 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2404 bra DISP_graph_vel_0_fill ; YES - fill lowest segment
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2405 dcfsnz lo,F ; lo = 2 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2406 bra DISP_graph_vel_1_fill ; YES - fill lower 2 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2407 dcfsnz lo,F ; lo = 3 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2408 bra DISP_graph_vel_2_fill ; YES - fill lower 3 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2409 dcfsnz lo,F ; lo = 4 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2410 bra DISP_graph_vel_3_fill ; YES - fill lower 4 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2411 dcfsnz lo,F ; lo = 5 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2412 bra DISP_graph_vel_4_fill ; YES - fill lower 5 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2413 dcfsnz lo,F ; lo = 6 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2414 bra DISP_graph_vel_5_fill ; YES - fill lower 6 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2415 dcfsnz lo,F ; lo = 7 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2416 bra DISP_graph_vel_6_fill ; YES - fill lower 7 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2417 ;bra DISP_graph_vel_7_fill ; YES - fill all segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2418
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2419 DISP_graph_vel_7_fill:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2420 movf pallet_color_warning,W
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2421 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2422 DISP_graph_vel_6_fill:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2423 movf pallet_color_warning,W
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2424 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2425 DISP_graph_vel_5_fill:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2426 movf pallet_color_attention,W
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2427 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2428 DISP_graph_vel_4_fill:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2429 movf pallet_color_memo,W
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2430 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2431 DISP_graph_vel_3_fill:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2432 movf pallet_color_memo,W
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2433 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2434 DISP_graph_vel_2_fill:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2435 movf pallet_color_memo,W
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2436 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2437 DISP_graph_vel_1_fill:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2438 movf pallet_color_memo,W
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2439 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2440 DISP_graph_vel_0_fill:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2441
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2442 movff xC+0,lo ; copy amount of segments to show to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2443 incf lo,F ; lo += 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2444 dcfsnz lo,F ; lo = 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2445 bra DISP_graph_vel_0_clear ; YES - clear upper 7 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2446 dcfsnz lo,F ; lo = 2 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2447 bra DISP_graph_vel_1_clear ; YES - clear upper 6 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2448 dcfsnz lo,F ; lo = 3 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2449 bra DISP_graph_vel_2_clear ; YES - clear upper 5 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2450 dcfsnz lo,F ; lo = 4 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2451 bra DISP_graph_vel_3_clear ; YES - clear upper 4 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2452 dcfsnz lo,F ; lo = 5 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2453 bra DISP_graph_vel_4_clear ; YES - clear upper 3 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2454 dcfsnz lo,F ; lo = 6 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2455 bra DISP_graph_vel_5_clear ; YES - clear upper 2 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2456 dcfsnz lo,F ; lo = 7 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2457 bra DISP_graph_vel_6_clear ; YES - clear upper 1 segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2458 bra DISP_graph_vel_7_clear ; YES - clear no segments
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2459
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2460 DISP_graph_vel_0_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2461 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2462 DISP_graph_vel_1_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2463 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2464 DISP_graph_vel_2_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2465 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2466 DISP_graph_vel_3_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2467 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2468 DISP_graph_vel_4_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2469 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2470 DISP_graph_vel_5_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2471 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2472 DISP_graph_vel_6_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2473 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2474 DISP_graph_vel_7_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2475 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2476
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2477
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2478 ; Helper Function - set color based on speed table or use static thresholds, with divA+0 = m/min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2479 TFT_velocity_set_color:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2480 bsf aux_flag ; for alternative layout: default is to show numerical VSI
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2481 ; check if old/new ascend logic is used
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2482 TSTOSS opt_vsitext ; 0=standard, 1=dynamic
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2483 bra TFT_velocity_set_color_static ; 0 - static ascend rate limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2484 ;bra TFT_velocity_set_color_dynamic ; 1 - dynamic ascend rate limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2485
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2486 TFT_velocity_set_color_dynamic:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2487 movlw LOW (VSI_table-.2) ; point to 2 entries ahead of the speed table
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2488 movwf TBLPTRL ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2489 movlw HIGH (VSI_table-.2) ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2490 movwf TBLPTRH ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2491 movlw UPPER (VSI_table-.2) ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2492 movwf TBLPTRU ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2493 TFT_velocity_set_color_loop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2494 TBLRD*+ ; consume waring speed form last round
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2495 TBLRD*+ ; consume attention speed form last round
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2496 TBLRD*+ ; get table depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2497 movf depth_meter,W ; get current depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2498 cpfsgt TABLAT ; table depth > current depth ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2499 bra TFT_velocity_set_color_loop ; NO - try next
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2500 TBLRD*+ ; YES - read warning speed threshold
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2501 movf TABLAT,W ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2502 movwf divA+1 ; - copy to graph routine
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2503 cpfslt divA+0 ; - actual vertical speed smaller than warning threshold?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2504 bra TFT_velocity_set_color_warn ; NO - set warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2505 TBLRD*+ ; YES - read attention speed threshold
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2506 movf TABLAT,W ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2507 cpfslt divA+0 ; - actual vertical speed smaller than attention threshold?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2508 bra TFT_velocity_set_color_attn ; NO - set attention color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2509 bcf aux_flag ; YES - don't show in alternative layout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2510 bra TFT_velocity_set_color_memo ; - set memo color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2511
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2512 TFT_velocity_set_color_static:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2513 movlw color_code_velocity_warn_high ; get static threshold for warning in m/min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2514 movwf divA+1 ; copy for graph routine
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2515 cpfslt divA+0 ; actual vertical speed smaller than warning threshold?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2516 bra TFT_velocity_set_color_warn ; NO - set warning color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2517 movlw color_code_velocity_attn_high ; YES - get static threshold for attention in m/min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2518 cpfslt divA+0 ; - actual vertical speed smaller than attention threshold?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2519 bra TFT_velocity_set_color_attn ; NO - set attention color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2520 bcf aux_flag ; YES - don't show in alternative layout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2521 ;bra TFT_velocity_set_color_memo ; - set memo color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2522
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2523
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2524 ; Helper Function - select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2525 TFT_velocity_set_color_memo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2526 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2527 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2528
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2529 TFT_velocity_set_color_attn:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2530 FONT_COLOR_ATTENTION ; select attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2531 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2532
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2533 TFT_velocity_set_color_warn:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2534 FONT_COLOR_WARNING ; select warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2535 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2536
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2537
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2538 ; Helper Function - show the numerical VSI
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2539 TFT_velocity_num:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2540 btfsc alt_layout_active ; in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2541 bra TFT_velocity_num_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2542 ;bra TFT_velocity_num_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2543
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2544 TFT_velocity_num_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2545 WIN_SMALL dm_velocity_text_col_norm, dm_velocity_text_row_norm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2546 bra TFT_velocity_num_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2547
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2548 TFT_velocity_num_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2549 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2550 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2551 btfss neg_flag_velocity ; NO - in ascent?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2552 bcf aux_flag ; NO - clear aux flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2553 btfsc aux_flag ; - above attention or warning threshold?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2554 bsf win_invert ; YES - print inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2555 WIN_SMALL dm_velocity_text_col_alt, dm_velocity_text_row_alt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2556 ;bra TFT_velocity_num_com ; - continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2557
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2558 TFT_velocity_num_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2559 bsf velocity_active_num ; set numerical velocity as shown
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2560 TSTOSS opt_units ; 0=meter, 1=feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2561 bra TFT_velocity_num_metric ; 0 - meter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2562 ;bra TFT_velocity_num_imperial ; 1 - feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2563
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2564 TFT_velocity_num_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2565 movff divA+0,WREG ; divA+0 = m/min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2566 mullw .100 ; PROD = mbar/min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2567 MOVII PRODL,mpr ; copy to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2568 call convert_cm_to_feet ; convert value in hi:lo from [cm] to [feet]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2569 tstfsz hi ; > 255 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2570 setf lo ; YES - set lo to 255
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2571 rcall TFT_velocity_num_helper ; print vertical speed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2572 STRCAT_TEXT tVelImperial ; print unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2573 bra TFT_velocity_num_finish ; do finishing tasks
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2574
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2575 TFT_velocity_num_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2576 movff divA+0,lo ; divA+0 = m/min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2577 rcall TFT_velocity_num_helper ; print vertical speed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2578 STRCAT_TEXT tVelMetric ; print unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2579 ;bra TFT_velocity_num_finish ; do finishing tasks
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2580
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2581 TFT_velocity_num_finish:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2582 btfss alt_layout_active ; in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2583 bra TFT_velocity_num_finish_1 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2584 movlw "'" ; load encoding of minute sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2585 movff WREG,buffer+4 ; put it after m (meter) / f (feet)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2586 clrf WREG ; load string terminator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2587 movff WREG,buffer+5 ; terminate string after minute sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2588 TFT_velocity_num_finish_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2589 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2590 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2591
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2592
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2593 ; Helper Function - print vertical speed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2594 TFT_velocity_num_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2595 movlw '-' ; load coding for minus sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2596 btfsc neg_flag_velocity ; ascending?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2597 movlw '+' ; YES - replace with coding for plus sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2598 movwf POSTINC2 ; put sign into output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2599 output_99 ; print rate (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2600 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2601
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2602
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2603 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2604 ; Dive Mode - clear vertical Velocity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2605 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2606 global TFT_velocity_clear
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2607 TFT_velocity_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2608 btfss velocity_active_num ; was the numerical VSI shown in last cycle?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2609 bra TFT_velocity_check_graph ; NO - no need to clear it, continue with graphical VSI
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2610 ;bra TFT_velocity_clear_num ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2611
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2612 TFT_velocity_clear_num:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2613 bcf velocity_active_num ; clear flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2614 btfsc alt_layout_active ; in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2615 bra TFT_velocity_clear_num_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2616 ;bra TFT_velocity_clear_num_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2617
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2618 TFT_velocity_clear_num_norm: ; clear normal numerical area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2619 WIN_BOX_BLACK dm_velocity_text_row_norm, dm_velocity_text_bot_norm, dm_velocity_text_col_norm, dm_velocity_text_rgt_norm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2620 bra TFT_velocity_check_graph ; continue with graphical VSI
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2621
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2622 TFT_velocity_clear_num_alt: ; clear alternative numerical area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2623 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2624 bra TFT_velocity_check_graph ; YES - skip
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2625 WIN_BOX_BLACK dm_velocity_text_row_alt, dm_velocity_text_bot_alt, dm_velocity_text_col_alt, dm_velocity_text_rgt_alt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2626 ;bra TFT_velocity_check_graph ; continue with graphical VSI
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2627
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2628 TFT_velocity_check_graph:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2629 btfss velocity_active_vsi ; was the graphical VSI shown in last cycle?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2630 return ; NO - no need to clear it, done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2631 ;bra TFT_velocity_clear_graph ; YES - clear it
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2632
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2633 TFT_velocity_clear_graph:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2634 bcf velocity_active_vsi ; clear flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2635 btfsc alt_layout_active ; in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2636 return ; YES - done (not implemented)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2637 WIN_BOX_BLACK dm_velocity_graph_top, dm_velocity_graph_bot, dm_velocity_graph_lft, dm_velocity_graph_rgt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2638 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2639
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2640
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2641 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2642 tft_out10 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2643 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2644
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2645
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2646 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2647 ; Dive Mode - show Sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2648 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2649 global TFT_divemode_sign_show
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2650 TFT_divemode_sign_show:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2651 btfsc alt_layout_active ; alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2652 bra TFT_divemode_sign_show_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2653 ;bra TFT_divemode_sign_show_norm ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2654
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2655 TFT_divemode_sign_show_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2656 WIN_TOP dm_sign_row_norm ; set row position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2657 WIN_LEFT dm_sign_col_norm ; set column position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2658 bra TFT_divemode_sign_show_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2659
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2660 TFT_divemode_sign_show_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2661 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2662 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2663 btfsc sign_shown ; NO - sign already shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2664 bra TFT_divemode_sign_show_alt_1; YES - no need to clear area again
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2665 btfsc bailout_mode ; NO - in bailout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2666 bra TFT_divemode_sign_show_alt_1; YES - no need to clear the area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2667 ; NO - clear area from "bar" label and loop mode if applicable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2668 WIN_BOX_BLACK dm_active_dil_row, dm_3rdrow_bot, dm_active_sp_label_col, dm_sign_rgt_alt ; top, bottom, left, right
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2669
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2670 TFT_divemode_sign_show_alt_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2671 WIN_TOP dm_sign_row_alt ; - set row position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2672 WIN_LEFT dm_sign_col_alt ; - set column position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2673 ;bra TFT_divemode_sign_show_com ; - continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2674
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2675 TFT_divemode_sign_show_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2676 bsf sign_shown ; flag sign is shown
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2677 btfsc sign_warning ; shall show warning sign?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2678 bra TFT_divemode_sign_show_warn ; YES - show warning sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2679 btfsc sign_attention ; NO - shall show attention sign?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2680 bra TFT_divemode_sign_show_att ; YES - show attention sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2681 btfsc sign_advice ; NO - shall show advice sign?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2682 bra TFT_divemode_sign_show_adv ; YES - show advice sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2683 return ; NO - false alarm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2684
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2685 TFT_divemode_sign_color_warn: ; custom colors table for dive_warning2 icon - warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2686 db .4, 0 ; #colors, spare
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2687 dw 0x0000 ; color 0x00: outside black
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2688 dw 0xff80 ; color 0x01: triangle yellow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2689 dw 0xff80 ; color 0x02: exclamation mark yellow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2690 dw 0xf800 ; color 0x03: inside red
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2691
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2692 TFT_divemode_sign_color_adv: ; custom colors table for dive_warning2 icon - advice
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2693 db .4, 0 ; #colors, spare
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2694 dw 0x0000 ; color 0x00: outside black
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2695 dw 0xffff ; color 0x01: triangle white
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2696 dw 0xffff ; color 0x02: exclamation mark white
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2697 dw 0x0780 ; color 0x03: inside green
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2698
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2699 TFT_divemode_sign_show_warn:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2700 TFT_WRITE_PROM_IMAGE_CUST_COLOR TFT_divemode_sign_color_warn; set custom colors for warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2701 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2702 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2703
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2704 TFT_divemode_sign_show_att:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2705 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show sign (with default colors)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2706 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2707
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2708 TFT_divemode_sign_show_adv:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2709 TFT_WRITE_PROM_IMAGE_CUST_COLOR TFT_divemode_sign_color_adv ; set custom colors for advice
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2710 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2711 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2712
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2713
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2714 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2715 ; Dive Mode - show Sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2716 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2717 global TFT_divemode_sign_clear
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2718 TFT_divemode_sign_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2719 btfss sign_shown ; is the advice/attention/warning sign shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2720 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2721 bcf sign_shown ; YES - clear flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2722 btfsc alt_layout_active ; - alternative layout active?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2723 bra TFT_divemode_sign_clear_alt ; - YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2724 ;bra TFT_divemode_sign_clear_norm; - NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2725
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2726 TFT_divemode_sign_clear_norm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2727 WIN_BOX_BLACK dm_sign_row_norm, dm_sign_bot_norm, dm_sign_col_norm, dm_sign_rgt_norm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2728 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2729
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2730 TFT_divemode_sign_clear_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2731 WIN_BOX_BLACK dm_sign_row_alt, dm_sign_bot_alt, dm_sign_col_alt, dm_sign_rgt_alt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2732 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2733
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2734
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2735 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2736 tft_out11 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2737 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2738
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2739
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2740 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2741 ; Dive Mode - show Safety Stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2742 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2743 global TFT_safety_stop_show
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2744 TFT_safety_stop_show:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2745 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2746 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2747 btfsc safety_stop_active ; NO - is the safety stop shown already?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2748 bra TFT_safety_stop_show_time ; YES - just update the time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2749 ; NO - clear area that may be polluted by alternative NDL
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2750 WIN_BOX_BLACK dm_safetystop_row, dm_tts_value_row, dm_ndl_value_col_alt, dm_safetystop_rgt ; top, bottom, left, right
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2751 bsf safety_stop_active ; - flag safety stop is shown now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2752 WIN_STD dm_safetystop_text_column, dm_safetystop_text_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2753 FONT_COLOR_MASK ; - set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2754 STRCPY_PRINT "Stop " ; - print "Stop" with a trailing space to wipe away potential other remains
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2755
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2756 TFT_safety_stop_show_time:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2757 WIN_MEDIUM dm_safetystop_column, dm_safetystop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2758 FONT_COLOR_ATTENTION ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2759 movff safety_stop_countdown,lo ; get remaining time in seconds, low byte, from safety stop timer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2760 clrf hi ; set remaining time in seconds, high byte, to zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2761 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2762 movff lo,up ; save seconds in up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2763 movff hi,lo ; move minutes to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2764 output_9 ; print minutes (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2765 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2766 movff up,lo ; move seconds to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2767 output_99x ; print seconds (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2768 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2769 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2770
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2771
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2772 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2773 ; Dive Mode - clear Safety Stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2774 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2775 global TFT_safety_stop_clear
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2776 TFT_safety_stop_clear:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2777 btfsc dive_main_menu ; is the dive mode menu shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2778 return ; YES - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2779 btfss safety_stop_active ; NO - is the safety stop shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2780 return ; NO - done, nothing to do
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2781 ; YES - clear safety stop area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2782 WIN_BOX_BLACK dm_safetystop_row, dm_safetystop_bot, dm_safetystop_text_column, dm_safetystop_rgt ; top, bottom, left, right
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2783 bcf safety_stop_active ; - safety stop not shown any more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2784 btfss deco_region ; - was the dive within deco stops region?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2785 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2786 ;bra TFT_show_slow_reminder ; YES - show "SLOW" reminder
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2787
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2788
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2789 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2790 ; Dive Mode - show "slow" Reminder
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2791 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2792 TFT_show_slow_reminder:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2793 WIN_STD dm_safetystop_text_column+.5,dm_safetystop_text_row+.5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2794 FONT_COLOR_ATTENTION ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2795 STRCPY_TEXT tSlow ; print "SLOW" reminder
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2796 STRCAT_PRINT 0x94 ; append an up-arrow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2797 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2798
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2799
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2800 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2801 tft_out12 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2802 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2803
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2804
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2805 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2806 ; clear complete Message Window
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2807 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2808 global TFT_clear_message_window
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2809 TFT_clear_message_window:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2810 btfss divemode ; in dive mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2811 bra TFT_clear_message_window_surf ; NO - clear surface mode area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2812 ;bra TFT_clear_message_window_dive ; YES - clear dive mode area
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2813
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2814 TFT_clear_message_window_dive:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2815 btfsc alt_layout_active ; in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2816 bra TFT_clear_message_window_dive_2 ; YES - clear dive mode area, 2nd row only
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2817
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2818 WIN_BOX_BLACK dm_warning_row, dm_warning_bot, dm_warning_column, dm_warning_rgt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2819 return ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2820
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2821 TFT_clear_message_window_surf:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2822 WIN_BOX_BLACK surf_warning1_row, surf_warning2_row+.24, surf_warning1_column, surf_warning1_column+.76 ; top, bottom, left, right
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2823 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2824
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2825
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2826 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2827 ; clear 2nd Line of Message Window
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2828 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2829 global TFT_clear_message_window_row2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2830 TFT_clear_message_window_row2:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2831 bcf message_2nd_row_used ; 2nd row is cleared
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2832 btfss divemode ; in dive mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2833 bra TFT_clear_message_window_surf_2 ; NO - clear surface mode area, 2nd row only
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2834 ;bra TFT_clear_message_window_dive_2 ; YES - clear dive mode area, 2nd row only
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2835
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2836 TFT_clear_message_window_dive_2:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2837 WIN_BOX_BLACK dm_warning2_row, dm_warning2_bot, dm_warning2_column, dm_warning2_rgt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2838 return ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2839
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2840 TFT_clear_message_window_surf_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
2841 WIN_BOX_BLACK surf_warning2_row, surf_warning2_row+.24, surf_warning2_column, surf_warning2_column+.76 ; top, bottom, left, right
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2842 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2843
643
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2844 ;-----------------------------------------------------------------------------
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2845 ; Surface Mode - Message - when "I2CFail" was triggered
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2846 ;
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2847 global TFT_message_i2c_error
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2848 TFT_message_i2c_error:
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2849 rcall TFT_message_open ; set row and column for the message
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2850 tstfsz WREG ; is there room for the message?
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2851 return ; NO - skip message in this cycle
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2852 STRCPY "I2C " ; print "I2C Error:"
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2853 movff i2c_error_vault+0,WREG ; last device adress
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2854 output_hex
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2855 PUTC " "
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2856 movff i2c_error_vault+1,WREG ; last data byte
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2857 output_hex
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
2858 bra TFT_message_close ; finalize message output
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2859
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2860 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2861 ; Surface Mode - Message - Desaturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2862 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2863 global TFT_surf_mesg_desat
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2864 TFT_surf_mesg_desat:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2865 rcall TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2866 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2867 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2868
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2869 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2870 STRCPY "Desat:" ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2871 MOVII int_O_desaturation_time,mpr ; get desaturation time in minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2872 bra TFT_dsat_nofly_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2873
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2874
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2875 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2876 ; Surface Mode - Message - No-Fly / NO-Altitude
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2877 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2878 global TFT_surf_mesg_nofly
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2879 TFT_surf_mesg_nofly:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2880 rcall TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2881 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2882 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2883
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2884 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2885 movff char_I_altitude_wait,WREG ; get mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2886 tstfsz WREG ; mode = altitude?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2887 bra TFT_nofly_time_alt ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2888 ;bra TFT_nofly_time_fly ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2889
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2890 TFT_nofly_time_fly:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2891 STRCPY "NoFly:" ; print no-fly label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2892 bra TFT_nofly_time_com ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2893
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2894 TFT_nofly_time_alt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2895 STRCPY "NoAlt:" ; print no-altitude label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2896 ;bra TFT_nofly_time_com ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2897
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2898 TFT_nofly_time_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2899 MOVII int_O_nofly_time,mpr ; get no-fly time in minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2900 ;bra TFT_dsat_nofly_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2901
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2902
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2903 ; Helper Function - common part for TFT_surf_mesg_desat and TFT_surf_mesg_nofly
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2904 TFT_dsat_nofly_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2905 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2906 movff lo,up ; backup lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2907 movff hi,lo ; get hours into lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2908 output_99 ; print hours (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2909 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2910 movff up,lo ; get minutes into lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2911 output_99x ; print minutes (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2912 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2913
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2914
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2915 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2916 ; Dive Mode - Message - fTTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2917 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2918 global TFT_message_ftts
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2919 TFT_message_ftts:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2920 call TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2921 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2922 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2923
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2924 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2925 btfss cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2926 bra TFT_display_ftts_2 ; NO - classic open water TTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2927 btfss dive_turned ; YES - dive turned?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2928 bra TFT_display_ftts_1 ; NO - cTTS from current position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2929 STRCPY "WP" ; YES - print waypoint mark
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2930 movf backtrack_waypoint_num,W ; - copy current waypoint number to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2931 cpfseq backtrack_waypoint_turn ; - current waypoint = turn point ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2932 bra TFT_display_ftts_0 ; NO - print waypoint number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2933 STRCAT "-| " ; YES - print turn point symbol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2934 bra TFT_display_ftts_5 ; - continue with TTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2935 TFT_display_ftts_0:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2936 movwf lo ; copy current waypoint number to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2937 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2938 output_99 ; print waypoint number (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2939 PUTC " " ; append a space char
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2940 bra TFT_display_ftts_5 ; continue with TTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2941 TFT_display_ftts_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2942 STRCPY "cTTS " ; print cave TTS label followed by a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2943 bra TFT_display_ftts_5 ; continue with TTS
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
2944 ENDIF ; _cave_mode
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2945 TFT_display_ftts_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2946 btfsc FLAG_oc_mode ; in OC mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2947 bra TFT_display_ftts_3 ; YES - print fTTS label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2948 TSTOSS opt_calc_gasvolume ; NO - bailout volume calculation requested?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2949 bra TFT_display_ftts_3 ; NO - print fTTS label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2950 STRCPY "B/O" ; YES - print bailout label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2951 bra TFT_display_ftts_4 ; - continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2952 TFT_display_ftts_3: ; OC or CCR/pSCR but no bailout volume calculation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2953 STRCPY "@+" ; print fTTS label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2954 TFT_display_ftts_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2955 movff char_I_extra_time,lo ; get fTTS delay time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2956 output_9 ; print fTTS delay time (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2957 PUTC ":" ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2958 TFT_display_ftts_5:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2959 MOVII int_O_TTS_alt,mpr ; get alternative TTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2960 FONT_COLOR_MEMO ; set memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2961 btfss hi,int_invalid_flag ; is the invalid flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2962 bra TFT_display_ftts_6 ; NO - keep memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2963 bcf hi,int_invalid_flag ; YES - clear flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2964 FONT_COLOR_DISABLED ; - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2965 TFT_display_ftts_6:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2966 btfsc hi,int_not_yet_computed ; is the not-yet-computed flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2967 bra TFT_display_ftts_8 ; YES - show dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2968 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2969 btfsc cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2970 bra TFT_display_ftts_7 ; YES - take shortcut
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2971 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2972 movff int_O_TST_alt+1,WREG ; get high byte of the alternative total stops time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2973 btfsc WREG,int_is_zero ; total stops time = zero ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2974 bra TFT_display_ftts_9 ; YES - show "NDL"
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
2975 movff char_O_deco_info,WREG ; NO - get deco info vector
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
2976 btfsc WREG,deco_zone ; - fTTS <= TTS ?
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
2977 FONT_COLOR_ADVICE ; YES - set to advice color (green)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2978 TFT_display_ftts_7:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2979 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2980 output_999 ; print ascent time (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2981 PUTC "'" ; print minutes symbol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2982 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2983 TFT_display_ftts_8:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2984 STRCAT "---" ; print "---" for not computed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2985 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2986 TFT_display_ftts_9:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2987 STRCAT_TEXT tNDL ; print "NDL"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2988 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2989
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2990
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2991 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2992 ; Dive Mode - Message - ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2993 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2994 global TFT_message_ppo2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2995 TFT_message_ppo2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2996 call TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
2997 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2998 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
2999
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3000 call TFT_color_code_ppo2 ; color-code output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3001
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3002 btfsc bailout_mode ; in bailout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3003 bra TFT_display_diluent_oc ; YES - bailout (OC)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3004 btfsc FLAG_ccr_mode ; NO - in CCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3005 bra TFT_display_diluent_ccr ; YES - CCR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3006 btfsc FLAG_pscr_mode ; NO - in pSCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3007 bra TFT_display_diluent_pscr ; YES - pSCR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3008 ;bra TFT_display_diluent_oc ; NO - OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3009
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3010 TFT_display_diluent_oc:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3011 STRCPY_TEXT tppO2 ; bailout or OC mode, print "ppO2:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3012 bra TFT_display_diluent_comm ; continue with ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3013
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3014 TFT_display_diluent_ccr:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3015 STRCPY_TEXT tdil ; print "Dil:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3016 bra TFT_display_diluent_comm ; continue with ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3017
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3018 TFT_display_diluent_pscr:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3019 STRCPY_TEXT tmix ; YES - print "Mix:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3020 ;bra TFT_display_diluent_comm ; - continue with ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3021
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3022 TFT_display_diluent_comm:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3023 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3024 output_999 ; print ppO2 (0.00-9.99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3025 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3026
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3027
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3028 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3029 ; Dive Mode - Message - Battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3030 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3031 global TFT_message_battery_percent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3032 TFT_message_battery_percent:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3033 rcall TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3034 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3035 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3036
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3037 call TFT_color_code_battery ; color-code according to battery_low_condition flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3038 STRCPY "Batt:" ; print "Batt:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3039 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3040 movff batt_percent,lo ; get battery %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3041 output_256 ; print battery % (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3042 PUTC "%" ; print "%"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3043 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3044
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3045
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3046 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3047 ; Dive Mode - Message - current CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3048 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3049 global TFT_message_cns
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3050 TFT_message_cns:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3051 call TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3052 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3053 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3054
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3055 MOVII int_O_CNS_current,mpr ; get current CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3056 call TFT_color_code_cns ; color-code CNS output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3057 STRCPY_TEXT tCNS ; CNS:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3058 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3059 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3060 PUTC "%" ; append unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3061 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3062
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3063
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3064 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3065 ; Dive Mode - Message - End-of-Dive CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3066 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3067 global TFT_message_cns_eod
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3068 TFT_message_cns_eod:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3069 call TFT_message_open ; set row and column for the message
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3070 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3071 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3072
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3073 FONT_COLOR_WARNING ; switch to warnings (red) text color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3074 STRCPY_TEXT tCNSeod ; end-of-dive CNS warning text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3075 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3076
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3077
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3078 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3079 ; Dive Mode - Message - Saturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3080 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3081 global TFT_message_saturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3082 TFT_message_saturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3083 rcall TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3084 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3085 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3086
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3087 MOVII int_O_lead_supersat,mpr ; get leading tissue's supersaturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3088 call TFT_color_code_supersat ; color-code output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3089 STRCPY_TEXT tSAT ; print "Sat:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3090 PUTC " " ; add a space to align the output with other warnings' outputs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3091 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3092 output_256 ; print value of lo only, int_O_lead_supersat is limited to 255
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3093 PUTC "%" ; print "%"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3094 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3095
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3096
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3097 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3098 ; Dive Mode - Message - alternative GF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3099 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3100 global TFT_message_agf
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3101 TFT_message_agf:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3102 rcall TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3103 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3104 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3105
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3106 FONT_COLOR_ATTENTION ; set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3107 STRCPY_TEXT tDiveaGF_active ; print "aGF!"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3108 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3109
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3110
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3111 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3112 ; Dive Mode - Message - Dive Timeout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3113 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3114 global TFT_message_divetimeout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3115 TFT_message_divetimeout:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3116 call TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3117 tstfsz WREG ; is there room for the message?
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3118 return ; NO - skip message in this cycle
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3119
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3120 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3121 STRCPY 0x94 ; "End of dive" symbol (up-arrow)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3122 movff opt_diveTimeout,WREG ; get timeout in minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3123 mullw .60 ; get timeout in seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3124 MOVII PRODL, sub_a ; calculate timeout - elapsed time = countdown
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3125 MOVII dive_timeout_timer,sub_b ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3126 call subU16 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3127 MOVII sub_c,mpr ; transfer to mpr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3128 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3129 movff lo,up ; back-up lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3130 movff hi,lo ; get minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3131 output_99 ; print minutes (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3132 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3133 movff up,lo ; get seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3134 output_99x ; print seconds (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3135 movlw dm_warning_length ; get dive mode string length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3136 rcall TFT_buffer_trim_length ; fill / cut buffer to target length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3137 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3138 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3139
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3140
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3141 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3142 ; Dive Mode - Message - Gas Needs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3143 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3144 global TFT_message_gas_needs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3145 TFT_message_gas_needs:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3146 rcall TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3147 tstfsz WREG ; is there room for the message?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3148 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3149
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3150 btfsc attn_det_gas_needs ; attention?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3151 FONT_COLOR_ATTENTION ; YES - set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3152 btfsc warn_det_gas_needs ; warning?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3153 FONT_COLOR_WARNING ; YES - set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3154 STRCPY_TEXT tGasNeedsWarn ; print "Gas Needs"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3155 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3156
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3157
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3158 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3159 ; Dive Mode - Message - Gas Change
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3160 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3161 global TFT_message_gas_change
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3162 TFT_message_gas_change:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3163 rcall TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3164 tstfsz WREG ; is there room for the message?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3165 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3166
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3167 FONT_COLOR_ADVICE ; set advice color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3168 STRCPY_TEXT tgaschange ; print "Change?"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3169 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3170
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3171
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3172 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3173 ; Dive Mode - Message - no Bailout Gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3174 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3175 global TFT_message_no_BO_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3176 TFT_message_no_BO_gas:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3177 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3178 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3179 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3180
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3181 FONT_COLOR_WARNING ; set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3182 STRCPY_TEXT tnoBOgas ; print "-B/O-Gas-"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3183 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3184
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3185
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3186 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3187 ; Message - open Message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3188 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3189 ; sets the row and column for the current message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3190 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3191 TFT_message_open:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3192 ; ignore warning (now)?
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3193 decf message_counter,W ; load (message counter - 1) into WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3194 bcf STATUS,C ; clear carry bit
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3195 btfss alt_layout_active ; in alternative layout?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3196 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
3197 cpfseq message_page ; page of the message = current page ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3198 retlw .255 ; NO - do not show in this cycle (message window is not defined)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3199 btfss divemode ; YES - in dive mode?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3200 bra TFT_set_message_window_sf ; NO - setup for surface mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3201 ;bra TFT_set_message_window_dm ; YES - setup for dive mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3202
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3203 ; Dive Mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3204 TFT_set_message_window_dm:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3205 btfsc alt_layout_active ; in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3206 bra TFT_set_message_window_dm_row2 ; YES - alternative layout only uses 2nd row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3207 btfss message_counter,0 ; NO - is the message number uneven?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3208 bra TFT_set_message_window_dm_row2 ; NO - use 2nd row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3209 ;bra TFT_set_message_window_dm_row1 ; YES - use 1st row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3210
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3211 TFT_set_message_window_dm_row1:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3212 WIN_SMALL dm_warning1_column, dm_warning1_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3213 bcf message_2nd_row_used ; flag that the 2nd does not contain a message yet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3214 retlw .0 ; show in this cycle (message window is defined)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3215
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3216 TFT_set_message_window_dm_row2:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3217 WIN_SMALL dm_warning2_column, dm_warning2_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3218 bsf message_2nd_row_used ; flag that the 2nd row contains a message now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3219 retlw .0 ; show in this cycle (message window is defined)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3220
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3221 ; Surface Mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3222 TFT_set_message_window_sf:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3223 btfss message_counter,0 ; is the message counter uneven?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3224 bra TFT_set_message_window_sf_row2 ; NO - use 2nd row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3225 ;bra TFT_set_message_window_sf_row1 ; YES - use 1st row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3226
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3227 TFT_set_message_window_sf_row1:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3228 WIN_SMALL surf_warning1_column,surf_warning1_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3229 bcf message_2nd_row_used ; flag that the 2nd row does not contain a message yet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3230 retlw .0 ; show in this cycle (message window is defined)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3231
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3232 TFT_set_message_window_sf_row2:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3233 WIN_SMALL surf_warning2_column,surf_warning2_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3234 bsf message_2nd_row_used ; flag that the 2nd row contains a message now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3235 retlw .0 ; show in this cycle (message window is defined)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3236
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3237
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3238 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3239 ; Message - fill to a given Length, or cut if too long
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3240 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3241 ; Input: buffer message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3242 ; WREG max length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3243 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3244 global TFT_buffer_trim_length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3245 TFT_buffer_trim_length:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3246 movwf lo ; copy max. string length to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3247 movf FSR2L,W ; get current string length to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3248 subwf lo,F ; lo = max length - current length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3249 bn TFT_fillup_with_spaces_cut ; string too long -> cut string at max length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3250 bnz TFT_fillup_with_spaces_apnd ; string too short -> append spaces and string terminator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3251 bra TFT_fillup_with_spaces_term ; string at exact length -> append string terminator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3252
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3253 TFT_fillup_with_spaces_apnd:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3254 PUTC " " ; add one space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3255 decfsz lo,F ; all spaces done?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3256 bra TFT_fillup_with_spaces_apnd ; NO - loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3257 bra TFT_fillup_with_spaces_term ; YES - append string terminator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3258
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3259 TFT_fillup_with_spaces_cut:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3260 movf lo,W ; get over-length (as negative number) into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3261 addwf FSR2L,F ; set back buffer pointer to end of max length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3262 ;bra TFT_fillup_with_spaces_term ; append string terminator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3263
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3264 TFT_fillup_with_spaces_term:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3265 clrf INDF2 ; append string terminator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3266 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3267
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3268
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3269 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3270 ; Message - close Message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3271 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3272 TFT_message_close:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3273 movlw surf_warning_length ; get surface string length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3274 btfsc divemode ; in dive mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3275 movlw dm_warning_length ; YES - replace by dive mode string length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3276 rcall TFT_buffer_trim_length ; fill / cut buffer to target length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3277 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3278 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3279
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3280
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3281 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3282 ; Dive Mode - Message - Micro-Bubbles
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3283 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3284 global TFT_message_mbubbles
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3285 TFT_message_mbubbles:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3286 rcall TFT_message_open ; set row and column for the message
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3287 tstfsz WREG ; is there room for the message?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3288 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3289
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3290 FONT_COLOR_ATTENTION ; set attention color as default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3291 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3292 btfsc WREG,mbubble_warning ; currently in the micro bubbles zone?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3293 FONT_COLOR_WARNING ; YES - reconfigure to warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3294 STRCPY_TEXT tMicroBubbles ; print message text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3295 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3296
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3297
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3298 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3299 ; Dive Mode - Message - Outside Buhlmann Model
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3300 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3301 global TFT_message_outside
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3302 TFT_message_outside:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3303 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3304 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3305 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3306
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3307 FONT_COLOR_ATTENTION ; set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3308 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3309 btfsc WREG,outside_warning ; currently outside the ZH-L16 model?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3310 FONT_COLOR_WARNING ; YES - reconfigure to warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3311 STRCPY "X-ZHL16-X" ; print message text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3312 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3313
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3314
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3315 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3316 ; Dive Mode - Message - Depth Limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3317 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3318 global TFT_message_depth_limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3319 TFT_message_depth_limit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3320 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3321 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3322 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3323
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3324 FONT_COLOR_WARNING ; set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3325 STRCPY_TEXT tMaxDepth ; print "max.Depth"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3326 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3327
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3328
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3329 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3330 ; Dive Mode - Message - Deco Info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3331 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3332 global TFT_message_deco_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3333 TFT_message_deco_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3334 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3335 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3336 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3337
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3338 FONT_COLOR_ADVICE ; actually it is a memo, but we break the rules here and display in advice color (green)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3339 STRCPY_TEXT tDecoInfo ; write "Deco Zone"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3340 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3341
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3342
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3343 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3344
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3345 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3346 ; Dive Mode - Message - IBCD
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3347 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3348 global TFT_message_IBCD
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3349 TFT_message_IBCD:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3350 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3351 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3352 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3353
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3354 FONT_COLOR_ATTENTION ; set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3355 STRCPY_TEXT tIBCD ; Print "IBCD N2He"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3356 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3357
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3358 ENDIF ; _helium
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3359
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3360 IFDEF _ccr_pscr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3361
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3362 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3363 ; Dive Mode - Message - Gas Density
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3364 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3365 global TFT_message_gas_density
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3366 TFT_message_gas_density:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3367 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3368 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3369 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3370
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3371 btfsc attn_det_gas_density ; on attention level?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3372 FONT_COLOR_ATTENTION ; YES - set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3373 btfsc warn_det_gas_density ; on warning level?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3374 FONT_COLOR_WARNING ; YES set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3375 STRCPY_TEXT tGasDensity ; print "G.Density"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3376 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3377
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3378 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3379
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3380 IFDEF _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3381
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3382 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3383 ; Dive Mode - Message - Sensor ppO2 Divergence
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3384 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3385 global TFT_message_divergence
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3386 TFT_message_divergence:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3387 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3388 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3389 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3390
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3391 FONT_COLOR_WARNING ; set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3392 STRCPY_TEXT tSensorDisagree ; print "Sensors<>"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3393 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3394
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3395
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3396 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3397 ; Dive Mode - Message - Fallback
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3398 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3399 global TFT_message_fallback
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3400 TFT_message_fallback:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3401 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3402 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3403 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3404
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3405 FONT_COLOR_WARNING ; set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3406 STRCPY_TEXT tDiveFallback ; print "Fallback!"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3407 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3408
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3409 ENDIF ; _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3410
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3411 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3412
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3413 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3414 ; Dive Mode - Message - TR - Transmitter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3415 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3416 global TFT_message_transmitter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3417 TFT_message_transmitter:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3418 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3419 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3420 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3421
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3422 FONT_COLOR_ATTENTION ; set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3423 STRCPY_TEXT tTransmitter ; print "P.Transm."
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3424 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3425
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3426
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3427 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3428 ; Dive Mode - Message - TR - Pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3429 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3430 global TFT_message_pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3431 TFT_message_pressure:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3432 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3433 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3434 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3435
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3436 btfsc attn_det_pressure1 ; on attention level - pressure 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3437 FONT_COLOR_ATTENTION ; YES - set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3438 btfsc attn_det_pressure2 ; on attention level - pressure 2 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3439 FONT_COLOR_ATTENTION ; YES - set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3440 btfsc warn_det_pressure1 ; on warning level - pressure 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3441 FONT_COLOR_WARNING ; YES - set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3442 btfsc warn_det_pressure2 ; on warning level - pressure 2 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3443 FONT_COLOR_WARNING ; YES - set warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3444 STRCPY_TEXT tPressure ; print "Tank Pres"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3445 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3446
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3447
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3448 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3449 ; Dive Mode - Message - TR - SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3450 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3451 global TFT_message_sac
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3452 TFT_message_sac:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3453 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3454 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3455 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3456
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3457 MOVII int_O_SAC_measured,mpr ; copy measured SAC rate to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3458 call TFT_color_code_pres_sac ; color-code the output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3459 STRCPY_TEXT tSAC ; print "SAC" (needs to be exactly 3 chars long)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3460 STRCAT ": " ; print ": "
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3461 bsf decimal_digit1 ; place a decimal point in front of digit 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3462 output_999 ; print (0.0-99.9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3463 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3464
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3465
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3466 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3467 ; Dive Mode - Message - TR - switch Tank Advice
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3468 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3469 global TFT_message_switch_tanks
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3470 TFT_message_switch_tanks:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3471 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3472 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3473 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3474
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3475 FONT_COLOR_ADVICE ; set advice color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3476 STRCPY_TEXT tswap ; print "Swap Tank"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3477 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3478
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3479 ENDIF ; _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3480
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3481 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3482
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3483 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3484 ; Dive Mode - Message - Cave Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3485 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3486 global TFT_message_cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3487 TFT_message_cave_mode:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3488 rcall TFT_message_open ; set row and column for the message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3489 tstfsz WREG ; is there room for the message?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3490 return ; NO - skip message in this cycle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3491
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3492 btfss attn_det_cave_shut_down ; on attention level?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3493 bra TFT_message_cave_mode_1 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3494 FONT_COLOR_ATTENTION ; YES - select attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3495 bra TFT_message_cave_mode_sd ; - print shutdown message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3496
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3497 TFT_message_cave_mode_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3498 btfss warn_det_cave_shut_down ; on warning level?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3499 bra TFT_message_cave_mode_info ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3500 FONT_COLOR_WARNING ; YES - select warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3501 ;bra TFT_message_cave_mode_sd ; - print shutdown message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3502
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3503 TFT_message_cave_mode_sd:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3504 STRCPY_TEXT tCaveModeShutdown ; print "X-Cave-X"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3505 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3506
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3507 TFT_message_cave_mode_info:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3508 FONT_COLOR_MEMO ; set memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3509 bsf win_invert ; print in inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3510 STRCPY_TEXT tCaveMode ; write "Cave Mode"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3511 bra TFT_message_close ; finalize message output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3512
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3513 ENDIF ; _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3514
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3515
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3516 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3517 tft_out13 CODE
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3518 ;=============================================================================
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3519
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3520
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3521 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3522 ; Surface Custom View - Last Dive Summery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3523 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3524 global TFT_surf_cv_lastdive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3525 TFT_surf_cv_lastdive:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3526 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3527
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3528 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3529 STRCAT_TEXT_PRINT tLastDive ; "Last Dive:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3530
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3531 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3532 STRCAT_TEXT_PRINT tDivetime ; "Divetime:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3533
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3534 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3535 STRCAT_TEXT_PRINT tMaxDepth ; "Max.Depth"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3536
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3537 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)+.5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3538 STRCAT_TEXT_PRINT tAvgDepth ; "Average"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3539
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3540 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3541 SMOVII int_O_desaturation_time,mpr ; ISR-safe copy of the desaturation time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3542 movf mpr+0,W ; get low byte into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3543 iorwf mpr+1,W ; inclusive-or with high byte, check if desaturation time is zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3544 bz TFT_surface_lastdive_2 ; YES - show last dive time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3545 ;bra TFT_surface_lastdive_1 ; NO - show surface interval
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3546
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3547 TFT_surface_lastdive_1:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3548 ; surface interval
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3549 SMOVII surface_interval_mins,mpr ; ISR-safe copy of surface interval in minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3550 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3551 movff lo,up ; back-up low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3552 movff hi,lo ; get hours
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3553 output_99 ; print hours (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3554 PUTC 'h' ; append hours unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3555 movff up,lo ; get minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3556 output_99x ; print minutes (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3557 PUTC_PRINT "m" ; append minutes unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3558 bra TFT_surface_lastdive_com ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3559
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3560 TFT_surface_lastdive_2:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3561 ; last dive time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3562 SMOVQQ surface_interval_secs,xC ; ISR-safe copy of surface_interval_secs:4 to xC:4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3563 call output_secs_as_days_hours ; print seconds as days and hours
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3564 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3565 ;bra TFT_surface_lastdive_com ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3566
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3567 TFT_surface_lastdive_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3568 ; last dive duration
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3569 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.1)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3570 MOVII lastdive_duration,mpr ; get duration of last dive, minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3571 output_999 ; print minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3572 PUTC ":" ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3573 movff lastdive_duration+2,lo ; get duration of last dive, seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3574 output_99x ; print seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3575 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3576
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3577 ; last dive max depth
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3578 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.2)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3579 MOVII lastdive_maxdepth,mpr ; get max depth of last dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3580 rcall TFT_surface_lastdive_depth ; print depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3581
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3582 ; average depth
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3583 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.3)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3584 MOVII lastdive_avgdepth,mpr ; get avg depth of last dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3585 ;bra TFT_surface_lastdive_depth ; print depth and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3586
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3587 ; Helper Function - print depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3588 TFT_surface_lastdive_depth:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3589 TSTOSS opt_units ; 0=Meter, 1=Feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3590 bra TFT_surface_lastdive_m ; 0 - metric
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3591 ;bra TFT_surface_lastdive_ft ; 1 - imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3592
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3593 TFT_surface_lastdive_ft:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3594 call convert_cm_to_feet ; convert value in hi:lo from [cm] to [feet]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3595 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3596 STRCAT_TEXT tFeets1 ; "ft"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3597 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3598 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3599
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3600 TFT_surface_lastdive_m:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3601 bsf omit_digit_1 ; do not print 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3602 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3603 output_65535 ; print (0.0x-655.3x)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3604 STRCAT_TEXT tMeters ; "m"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3605 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3606 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3607
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3608
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3609 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3610 ; Surface Custom View - OC Gas List
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3611 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3612 global TFT_surf_cv_list_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3613 TFT_surf_cv_list_gas:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3614 clrf WREG ; do OC gases (0-4)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3615 ;bra TFT_surf_cv_list_gas_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3616
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3617 ; common list for OC gases and diluents
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3618 TFT_surf_cv_list_gas_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3619 movwf gaslist_gas ; set first gas/dil to show
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3620 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3621
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3622 bsf short_gas_descriptions ; use short versions of gaslist_strcat_gas and gaslist_strcat_setpoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3623 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3624
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3625 ; Gas 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3626 WIN_SMALL surf_gaslist_column,surf_gaslist_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3627 call gaslist_strcat_gas ; print gas description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3628 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3629
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3630 ; Gas 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3631 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3632 incf gaslist_gas,F ; select next gas/dil
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3633 call gaslist_strcat_gas ; print gas description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3634 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3635
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3636 ; Gas 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3637 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3638 incf gaslist_gas,F ; select next gas/dil
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3639 call gaslist_strcat_gas ; print gas description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3640 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3641
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3642 ; Gas 4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3643 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3644 incf gaslist_gas,F ; select next gas/dil
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3645 call gaslist_strcat_gas ; print gas description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3646 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3647
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3648 ; Gas 5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3649 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3650 incf gaslist_gas,F ; select next gas/dil
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3651 call gaslist_strcat_gas ; print gas description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3652 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3653
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3654 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3655
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3656
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3657 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3658 ; Surface Custom View - Custom Text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3659 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3660 global TFT_surf_cv_text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3661 TFT_surf_cv_text:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3662 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3663
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3664 ; 1st row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3665 WIN_SMALL surf_customtext_column,surf_customtext_row1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3666 MOVRR opt_name+ .0,buffer,.12 ; copy 1st 12 chars to output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3667 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3668
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3669 ; 2nd row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3670 WIN_SMALL surf_customtext_column,surf_customtext_row2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3671 MOVRR opt_name+.12,buffer,.12 ; copy 2nd 12 chars to output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3672 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3673
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3674 ; 3rd row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3675 WIN_SMALL surf_customtext_column,surf_customtext_row3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3676 MOVRR opt_name+.24,buffer,.12 ; copy 3rd 12 chars to output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3677 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3678
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3679 ; 4th row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3680 WIN_SMALL surf_customtext_column,surf_customtext_row4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3681 MOVRR opt_name+.36,buffer,.12 ; copy 4th 12 chars to output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3682 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3683
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3684 ; 5th row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3685 WIN_SMALL surf_customtext_column,surf_customtext_row5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3686 MOVRR opt_name+.48,buffer,.12 ; copy 5th 12 chars to output buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3687 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3688
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3689 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3690
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3691
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3692 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3693 ; Surface Custom View - Tissue Graphics
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3694 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3695 global TFT_surf_cv_tissues
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3696 TFT_surf_cv_tissues:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3697
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3698 ; draw outer frame
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3699 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
3700
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3701 ; draw labels
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3702 FONT_COLOR_MEMO ; set color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3703 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3704 IFDEF _helium
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3705 btfss tissue_graphic_layout ; shall N2 and He?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3706 bra TFT_surface_tissues_1 ; NO - print "Tissues"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3707 STRCPY_TEXT_PRINT tN2 ; YES - print "N2"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 581
diff changeset
3708 WIN_SMALL surf_tissue_He_column,surf_tissue_He_row
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3709 STRCPY_TEXT_PRINT tHe ; - print "He"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3710 bra TFT_surface_tissues_2 ; - continue with common part
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3711 ENDIF
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3712
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3713 TFT_surface_tissues_1:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3714 STRCPY_TEXT_PRINT tDiveTissues ; print "Tissues"
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3715
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3716 TFT_surface_tissues_2:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3717 ; draw scale
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3718
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3719 SCALELINE macro x
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3720 movlw color_deepblue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3721 WIN_FRAME_COLOR surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,surf_tissue_diagram_left+.4+x,surf_tissue_diagram_left+.4+x
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3722 endm
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3723
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3724 SCALELINE .0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3725 SCALELINE .8
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3726 SCALELINE .16
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3727 SCALELINE .24
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3728 SCALELINE .32
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3729 SCALELINE .40
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3730 SCALELINE .48
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3731 SCALELINE .56
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3732 SCALELINE .64
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3733 SCALELINE .72
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3734 SCALELINE .80
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3735
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3736 ; common initialization for tissue pressures and saturation
0
heinrichsweikamp
parents:
diff changeset
3737 movlw .1
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3738 movwf win_height ; hight of the bargraph (0-239)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3739 movlw surf_tissue_diagram_left+.4 ; left start position for N2 bars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3740 movwf win_leftx2 ; column left (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3741 movlw surf_tissue_diagram_right-surf_tissue_diagram_left-.4 ; get max width for N2 bars (78 pixel)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3742 movwf win_width+0 ; set width of the bar box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3743 clrf win_width+1 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3744 movlw color_white ; color for tissues not exceeding surface max pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3745 movwf ex ; store in ex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3746 movlw color_red ; color for tissues exceeding surface max pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3747 movwf ul ; store in ul
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3748 bcf aux_flag ; draw tissue pressures by default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3749
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3750 ; draw combined or N2 tissue pressures
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3751 lfsr FSR2,char_O_tissue_pressure ; load base address of combined pressures by default
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3752 IFDEF _helium
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3753 btfsc tissue_graphic_layout ; shall show N2+He ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3754 lfsr FSR2,char_O_tissue_pres_N2 ; YES - replace with base address of N2 pressures
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3755 ENDIF
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3756 btfsc tissue_graphic_mode ; in logbook mode?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3757 lfsr FSR2,header_buffer+index_tissue_pres_total ; YES - replace with base address from logbook
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3758 movlw d'16'
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3759 movwf lo ; tissue counter, 16 tissues
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3760 clrf hi ; row counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3761 TFT_surf_tissues_N2_loop:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3762 movlw surf_tissue_diagram_top+.23 ; surface mode top start position N2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3763 rcall TFT_surf_tissues_bargraph ; show one tissue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3764 movlw .2 ; bargraph spacing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3765 addwf hi,F ; increment row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3766 decfsz lo,F ; decrement tissue counter, done?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3767 bra TFT_surf_tissues_N2_loop ; NO - loop
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3768 IFDEF _helium
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3769 btfsc tissue_graphic_layout ; shall show N2+He ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3770 bra TFT_surface_tissues_3 ; YES - show He tissue pressures
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3771 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3772
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3773 ; draw tissue saturations
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3774 lfsr FSR2,char_O_tissue_saturation ; load base address of tissue supersaturation
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3775 btfsc tissue_graphic_mode ; in logbook mode?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3776 lfsr FSR2,header_buffer+index_tissue_supersat ; YES - replace with base address from logbook
0
heinrichsweikamp
parents:
diff changeset
3777 movlw d'16'
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3778 movwf lo ; tissue counter, 16 tissues
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3779 clrf hi ; row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3780 movlw color_grey ; color for tissue saturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3781 movwf ex ; store in ex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3782 ; movlw color_yellow ; 2nd color is not used by tissue saturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3783 ; movwf ul ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3784 bsf aux_flag ; draw tissue saturation
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3785 TFT_surf_tissues_sat_loop:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3786 movlw surf_tissue_diagram_top+.23+.57 ; surface mode top start position saturations
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3787 rcall TFT_surf_tissues_bargraph ; draw tissue bargraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3788 movlw .2 ; bargraph spacing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3789 addwf hi,F ; increment row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3790 decfsz lo,F ; decrement tissue counter, done?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3791 bra TFT_surf_tissues_sat_loop ; NO - loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3792
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3793 ; common part for vertical lines
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3794 movlw surf_tissue_diagram_top+.23+.57 ; get top position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3795 movwf win_top ; set top position (0-239)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3796 movlw .30 ; get hight
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3797 movwf win_height ; set height
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3798 movlw .1 ; get width
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3799 movwf win_width+0 ; set width, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3800 clrf win_width+1 ; set width, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3801
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3802 ; print 100% line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3803 movlw surf_tissue_diagram_left+.4+.64 ; get left position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3804 movwf win_leftx2 ; set left position (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3805 movlw color_red ; color for 100% line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3806 BOX_COLOR ; draw the line
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3807
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3808 ; GF factors enabled?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3809 btfss tissue_graphic_gf ; GF factors enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3810 bra TFT_surface_tissues_4 ; NO - continue with CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3811
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3812 ; print GF low line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3813 movlw surf_tissue_diagram_left+.4 ; get left base position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3814 movwf win_leftx2 ; set left base position (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3815 movff opt_GF_low,WREG ; get GF low in 0.01 %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3816 btfsc tissue_graphic_mode ; in logbook mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3817 movff header_buffer+index_gf_lo_hi+0,WREG ; YES - replace by GF low from logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3818 mullw .164 ; multiply with 164
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3819 movf PRODH,W ; divide by 256 -> resulting scale factor is 164/256 = 0.640625
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3820 addwf win_leftx2,F ; add to base position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3821 movlw color_green ; color for GF low line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3822 BOX_COLOR ; draw the line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3823
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3824 ; print GF high line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3825 movlw surf_tissue_diagram_left+.4 ; get left base position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3826 movwf win_leftx2 ; set left base position (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3827 movff opt_GF_high,WREG ; get GF high in 0.01 %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3828 btfsc tissue_graphic_mode ; in logbook mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3829 movff header_buffer+index_gf_lo_hi+1,WREG ; YES - replace by GF high from logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3830 mullw .164 ; multiply with 164
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3831 movf PRODH,W ; divide by 256 -> resulting scale factor is 164/256 = 0.640625
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3832 addwf win_leftx2,F ; add to base position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3833 movlw color_yellow ; color for GF high line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3834 BOX_COLOR ; draw the line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3835 bra TFT_surface_tissues_4 ; continue with CNS
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3836
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3837 IFDEF _helium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3838 TFT_surface_tissues_3:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3839 ; draw He tissue pressures
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3840 movlw surf_tissue_diagram_left+.4+.16 ; start position for He bars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3841 movwf win_leftx2 ; column left (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3842 movlw surf_tissue_diagram_right-surf_tissue_diagram_left-.4-.16 ; max width for He bars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3843 movwf win_width+0 ; set total width of the bar box
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3844 clrf win_width+1 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3845 lfsr FSR2,char_O_tissue_pres_He ; load base address of He pressures
0
heinrichsweikamp
parents:
diff changeset
3846 movlw d'16'
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3847 movwf lo ; tissue counter, 16 tissues
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3848 clrf hi ; row counter
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3849 TFT_surf_tissues_He_loop:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3850 movlw surf_tissue_diagram_top+.23+.57 ; surface mode top start position He
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3851 rcall TFT_surf_tissues_bargraph ; show one tissue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3852 movlw .2 ; bargraph spacing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3853 addwf hi,F ; increment row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3854 decfsz lo,F ; decrement tissue counter, done?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3855 bra TFT_surf_tissues_He_loop ; NO - loop
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3856 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3857
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3858 TFT_surface_tissues_4:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3859 btfss tissue_graphic_cns ; shall show CNS value?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3860 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3861
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3862 ; draw CNS% in-between tissue bars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3863 WIN_SMALL surf_tissue_He_column+.22,surf_tissue_He_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3864 MOVII int_O_CNS_current,mpr ; get current CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3865 call TFT_color_code_cns ; color-code CNS value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3866 STRCPY_TEXT tCNS2 ; "CNS: "
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3867 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3868 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3869 PUTC_PRINT "%" ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3870 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3871
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3872
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3873 ; Helper Function - draw a bargraph
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
3874 TFT_surf_tissues_bargraph:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3875 addwf hi,W ; add row number to start position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3876 movwf win_top ; set as row top (0-239)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3877 movff POSTINC2,up ; get tissue value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3878 movf ex,W ; default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3879 btfsc up,7 ; check if flag in bit 7 is set
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3880 movf ul,W ; YES - switch to 2nd color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3881 bcf up,7 ; clear flag bit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3882 btfss aux_flag ; drawing saturations?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3883 rlncf up,F ; NO - multiply with 2 (previously cleared bit 7 will be rotated to bit 0)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3884 movff up,win_bargraph ; set length of the bargraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3885 incf win_bargraph,F ; add 1 for a minimum visible bar (He-bars could be invisible else-wise)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3886 BOX_COLOR ; draw bargraph with color in WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3887 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3888
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3889
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3890 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3891 ; Surface Custom View - Tissue Graphics
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
3892 ;
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3893 global TFT_surf_cv_settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3894 TFT_surf_cv_settings:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3895 ; Deco Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3896 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3897 WIN_SMALL surf_gaslist_column,surf_gaslist_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3898 STRCAT_PRINT "ZH-L16" ; print fix part of model
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3899 movff char_I_model,WREG ; get model
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3900 iorwf WREG ; GF enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3901 bnz TFT_surface_decosettings1 ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3902 ;bra TFT_surface_decosettings0 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3903
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3904 TFT_surface_decosettings0:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3905 ; Display ZH-L16 sat/desat model
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3906 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3907 STRCPY_TEXT tSD ; print label (S/D)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3908 movff char_I_saturation_multiplier, lo ; get sat mult.
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3909 movff char_I_desaturation_multiplier,hi ; get desat mult.
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3910 bra TFT_surface_decosettings_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3911
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3912 TFT_surface_decosettings1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3913 ; Display ZH-L16-GF low/high model
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3914 WIN_SMALL surf_gaslist_column+.43,surf_gaslist_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3915 STRCPY_TEXT_PRINT tZHL16GF ; print GF label behind deco model label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3916
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3917 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3918 STRCPY_TEXT tGF ; print label (GF:)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3919 PUTC ' ' ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3920 movff opt_GF_low, lo ; get GF low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3921 movff opt_GF_high,hi ; get GF high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3922 ;bra TFT_surface_decosettings_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3923
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3924 TFT_surface_decosettings_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3925 ; percentage pair
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3926 output_256 ; print (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3927 STRCAT "%/" ; print "%/"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3928 movff hi,lo ; get 2nd value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3929 output_256 ; print (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3930 PUTC_PRINT "%" ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3931
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3932 ; fTTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3933 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3934 STRCPY_TEXT tFTTSSurf ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3935 movff char_I_extra_time,lo ; get time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3936 output_9 ; print time (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3937 STRCAT_TEXT_PRINT tMinutes ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3938
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3939 ; Last Stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3940 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3941 STRCPY_TEXT tLastDecostopSurf ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3942 movff opt_last_stop,lo ; get depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3943 output_9 ; print depth (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3944 STRCAT_TEXT_PRINT tMeters ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3945
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3946 ; Salinity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3947 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3948 STRCPY_TEXT tDvSalinitySurf ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3949 movff opt_salinity,lo ; get salinity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3950 output_9 ; print salinity (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3951 STRCAT_TEXT_PRINT tPercent ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3952
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3953 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3954
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3955
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3956 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3957
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3958 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3959 ; Surface Custom View - TR - Tank Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3960 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3961 global TFT_surf_cv_tankdata
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3962 TFT_surf_cv_tankdata:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3963 lfsr FSR1,rx_buffer ; load base address of RX buffer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3964
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3965 IFNDEF _rx_functions_debug
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3966
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3967 WIN_SMALL surf_customtext_column,surf_customtext_row1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3968 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3969 WIN_SMALL surf_customtext_column,surf_customtext_row2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3970 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3971 WIN_SMALL surf_customtext_column,surf_customtext_row3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3972 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3973 WIN_SMALL surf_customtext_column,surf_customtext_row4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3974 rcall TFT_surface_tankdata_print
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3975 WIN_SMALL surf_customtext_column,surf_customtext_row5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3976 rcall TFT_surface_tankdata_print
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3977
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3978 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3979
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3980
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3981 ; Helper Function - print transmitter data (max 12 char)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3982 TFT_surface_tankdata_print:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3983 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3984 movff POSTINC1,hi ; get ID high (+0)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3985 movff POSTINC1,lo ; get ID low (+1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3986 tstfsz hi ; ID high = 0 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3987 bra TFT_surface_tankdata_print_1; NO - slot in use
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3988 tstfsz lo ; ID low = 0?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3989 bra TFT_surface_tankdata_print_1; NO - slot in use
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3990 STRCAT_PRINT "---- " ; YES - mark as unused and clear rest of line from previous remains
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3991 movf POSTINC1,W ; - dummy read (+2) to advance index
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3992 movf POSTINC1,W ; - dummy read (+3) to advance index
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3993 movf POSTINC1,W ; - dummy read (+4) to advance index
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3994 bra TFT_surface_tankdata_print_3; - one more dummy read and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3995
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
3996 TFT_surface_tankdata_print_1:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3997 movf hi,W ; copy ID high to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3998 output_hex ; print as hex 2 chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
3999 movf lo,W ; copy ID low to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4000 output_hex ; print as hex 2 chars (4 in total)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4001 movff POSTINC1,hi ; get pressure high (+2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4002 movff POSTINC1,lo ; get pressure low (+3)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4003 call TFT_color_code_pres_sac ; needed to clear the status flags before output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4004 bsf omit_digit_1 ; do not print 1st digit (0.1 bar)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4005 output_65535 ; print (0x-6553x) 4 chars (8 in total)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4006 PUTC " " ; 1 char (9 in total)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4007 movf POSTINC1,W ; get status (+4)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4008 andlw .7 ; mask out battery voltage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4009 bnz TFT_surface_tankdata_2 ; branch if battery is not completely drained
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4010 FONT_COLOR_WARNING ; output in red
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4011 STRCAT_PRINT "XXX" ; "XXX" for low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4012 bra TFT_surface_tankdata_print_3; one more dummy read and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4013
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4014 TFT_surface_tankdata_2:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4015 addlw .28 ; add offset of 2.8 Volt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4016 movff WREG,lo ; copy to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4017 bsf decimal_digit1 ; put a decimal point in front of digit 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4018 output_99 ; print voltage 2 chars (11 in total)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4019 PUTC_PRINT " " ; dummy char 1 char (12 in total)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4020
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4021 TFT_surface_tankdata_print_3:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4022 movf POSTINC1,W ; dummy read (+5) to advance index
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4023 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4024
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4025 ELSE ; _rx_functions_debug
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4026
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4027 TFT_surface_tankdata_debug: ; surface custom view debug output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4028 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4029 WIN_TINY surf_customtext_column,surf_customtext_row1+.14*0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4030 rcall TFT_surface_tankdata_debug_print
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4031 WIN_TINY surf_customtext_column,surf_customtext_row1+.14*1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4032 rcall TFT_surface_tankdata_debug_print
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4033 WIN_TINY surf_customtext_column,surf_customtext_row1+.14*2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4034 rcall TFT_surface_tankdata_debug_print
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4035 WIN_TINY surf_customtext_column,surf_customtext_row1+.14*3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4036 rcall TFT_surface_tankdata_debug_print
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4037 WIN_TINY surf_customtext_column,surf_customtext_row1+.14*4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4038 rcall TFT_surface_tankdata_debug_print
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4039 WIN_TINY surf_customtext_column,surf_customtext_row1+.14*5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4040 rcall TFT_surface_tankdata_debug_print
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4041 WIN_TINY surf_customtext_column,surf_customtext_row1+.14*6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4042 rcall TFT_surface_tankdata_debug_print
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4043 WIN_TINY surf_customtext_column,surf_customtext_row1+.14*7
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4044 rcall TFT_surface_tankdata_debug_print
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4045 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4046
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4047 TFT_surface_tankdata_debug_print:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4048 movff POSTINC1,hi ; read ID high (+0)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4049 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4050 movff POSTINC1,lo ; read ID low (+1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4051 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4052 PUTC "," ; print ","
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4053 movff POSTINC1,hi ; read pressure high (+2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4054 movff POSTINC1,lo ; read pressure low (+3)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4055 call TFT_color_code_pres_sac ; needed to clear the status flags before output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4056 bsf decimal_digit1 ; place a decimal point in front of digit 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4057 output_9999 ; print pressure (0.0-999.9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4058 PUTC "," ; print ","
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4059 movff POSTINC1,lo ; read status (+4)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4060 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4061 PUTC "," ; print ","
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4062 movff POSTINC1,lo ; read date (+5)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4063 output_256 ; print (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4064 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4065 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4066
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4067 ENDIF ; _rx_functions_debug
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 621
diff changeset
4068 ENDIF ; _rx_functions
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 601
diff changeset
4069
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4070 IFDEF _compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4071
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4072 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4073 ; Surface Custom View - Compass - "set Bearing Dialog"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4074 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4075 global TFT_surf_cv_compass_bearing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4076 TFT_surf_cv_compass_bearing:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4077 btfsc compass_menu ; is the "set bearing" selection shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4078 return ; YES - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4079 bsf compass_menu ; NO - set "set bearing" selection as shown
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4080 WIN_BOX_BLACK surf_compass_bear_row,surf_warning1_row-1, surf_compass_bear_column, surf_decotype_column-.1 ; top, bottom, left, right
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4081 WIN_SMALL surf_compass_bear_column,surf_compass_bear_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4082 FONT_COLOR color_yellow ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4083 bsf win_invert ; print inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4084 STRCPY_TEXT_PRINT tSetHeading ; 7 chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4085 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4086
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4087 ENDIF ; _compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4088
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4089 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4090
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4091 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4092 ; Surface Custom View - Diluent List
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4093 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4094 global TFT_surf_cv_list_dil
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4095 TFT_surf_cv_list_dil:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4096 movlw .5 ; do diluents (5-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4097 bra TFT_surf_cv_list_gas_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4098
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4099
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4100 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4101 ; Surface Custom View - Setpoint List
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4102 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4103 global TFT_surf_cv_list_sp ; show setpoint list
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4104 TFT_surf_cv_list_sp:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4105 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4106 bsf short_gas_descriptions ; use short versions of gaslist_strcat_gas_PRODL and gaslist_strcat_setpoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4107 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4108
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4109 ;SP 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4110 WIN_SMALL surf_gaslist_column,surf_gaslist_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4111 clrf gaslist_gas ; select SP 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4112 call gaslist_strcat_setpoint ; show setpoint data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4113 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4114
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4115 ;SP 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4116 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4117 incf gaslist_gas,F ; select next SP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4118 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4119 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4120
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4121 ;SP 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4122 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4123 incf gaslist_gas,F ; select next SP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4124 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4125 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4126
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4127 ;SP 4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4128 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4129 incf gaslist_gas,F ; select next SP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4130 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4131 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4132
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4133 ;SP 5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4134 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4135 incf gaslist_gas,F ; select next SP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4136 call gaslist_strcat_setpoint ; show SP#+1 of PRODL#
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4137 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4138
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4139 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4140
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4141 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4142
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4143
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
4144 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4145 tft_out14 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4146 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4147
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4148
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4149 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4150 ; Dive Custom View - AVR / Stopwatch - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4151 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4152 global TFT_avr_stopwatch_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4153 TFT_avr_stopwatch_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4154 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4155
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4156 IFNDEF _min_depth_option
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4157
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4158 WIN_TINY dm_custom_avr_stop_column1+.2,dm_custom_avr_stop_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4159 TSTOSS opt_2ndDepthDisp ; show avg depth instead of max depth in main screen?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4160 bra TFT_avr_stopwatch_mask_1 ; NO - draw avg depth in custom view then
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4161 btfss alt_layout_active ; YES - in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4162 bra TFT_avr_stopwatch_mask_max ; NO - show max depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4163 ;bra TFT_avr_stopwatch_mask_avg ; YES - show avg depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4164
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4165 TFT_avr_stopwatch_mask_avg:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4166 STRCPY_TEXT_PRINT tDiveTotalAvg ; mask for average depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4167 bra TFT_avr_stopwatch_mask_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4168
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4169 TFT_avr_stopwatch_mask_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4170 btfss alt_layout_active ; YES - in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4171 bra TFT_avr_stopwatch_mask_avg ; NO - show avg depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4172 ;bra TFT_avr_stopwatch_mask_max ; YES - show max depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4173
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4174 TFT_avr_stopwatch_mask_max:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4175 STRCPY_TEXT_PRINT tMaxDepth ; mask for maximum depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4176 ;bra TFT_avr_stopwatch_mask_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4177
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4178 TFT_avr_stopwatch_mask_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4179 WIN_TINY dm_custom_avr_stop_column2+.3,dm_custom_avr_stop_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4180 STRCPY_TEXT_PRINT tDiveStopwatch ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4181
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4182 WIN_TINY dm_custom_avr_stop_column3-.8,dm_custom_avr_stop_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4183 STRCPY_TEXT_PRINT tDiveStopAvg ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4184
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4185 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4186
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4187 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4188
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4189 WIN_TINY dm_custom_avr_stop_column1+.2,dm_custom_avr_stop_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4190 STRCPY_PRINT "Max.Depth" ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4191
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4192 WIN_TINY dm_custom_avr_stop_column2+.3,dm_custom_avr_stop_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4193 STRCPY_PRINT "Avg.Depth" ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4194
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4195 WIN_TINY dm_custom_avr_stop_column3-.8,dm_custom_avr_stop_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4196 STRCPY_PRINT "Min.Depth" ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4197
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4198 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4199
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4200 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4201
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4202
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4203 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4204 ; Dive Custom View - AVR / Stopwatch - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4205 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4206 global TFT_avr_stopwatch
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4207 TFT_avr_stopwatch:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4208 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4209
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4210 IFNDEF _min_depth_option
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4211
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4212 ; total average depth or max depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4213 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4214 TSTOSS opt_2ndDepthDisp ; show average depth instead of maximum depth in main screen?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4215 bra TFT_avr_stopwatch_1 ; NO - draw avg depth in custom view then
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4216 btfsc alt_layout_active ; YES - in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4217 bra TFT_avr_stopwatch_avg ; YES - show avg depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4218 bra TFT_avr_stopwatch_max ; NO - show max depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4219
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4220 TFT_avr_stopwatch_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4221 btfsc alt_layout_active ; YES - in alternative layout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4222 bra TFT_avr_stopwatch_max ; YES - show max depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4223 ;bra TFT_avr_stopwatch_avg ; NO - show avg depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4224
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4225 TFT_avr_stopwatch_avg:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4226 MOVII pressure_rel_avg_total,mpr ; get total dive average pressure into hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4227 bra TFT_avr_stopwatch_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4228
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4229 TFT_avr_stopwatch_max:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4230 MOVII pressure_rel_max_cached,mpr ; get maximum pressure into hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4231 ;bra TFT_avr_stopwatch_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4232
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4233 TFT_avr_stopwatch_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4234 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4235 TSTOSS opt_units ; 0=m, 1=ft
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4236 bra TFT_update_avr_stopwatch1_metric; 0 - metric
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4237 ;bra TFT_update_avr_stopwatch1_imp ; 1 - imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4238
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4239 TFT_update_avr_stopwatch1_imp:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4240 call convert_cm_to_feet ; convert value in hi:lo from [cm] to [feet]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4241 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4242 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4243 bra TFT_update_avr_stopwatch2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4244
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4245 TFT_update_avr_stopwatch1_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4246 rcall TFT_update_avr_stopwatch_metric ; print metric depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4247 ;bra TFT_update_avr_stopwatch2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4248
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4249 TFT_update_avr_stopwatch2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4250 ; stopped average depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4251 WIN_MEDIUM dm_custom_avr_stop_column3,dm_custom_avr_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4252 MOVII pressure_rel_avg_trip,mpr ; get the resettable average pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4253 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4254 TSTOSS opt_units ; 0=m, 1=ft
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4255 bra TFT_update_avr_stopwatch2_metric; 0 - metric
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4256 ;bra TFT_update_avr_stopwatch2_imp ; 1 - imperial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4257
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4258 TFT_update_avr_stopwatch2_imp:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4259 call convert_cm_to_feet ; convert value in hi:lo from [cm] to [feet]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4260 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4261 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4262 bra TFT_update_avr_stopwatch3 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4263
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4264 TFT_update_avr_stopwatch2_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4265 rcall TFT_update_avr_stopwatch_metric ; print metric depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4266 bra TFT_update_avr_stopwatch3 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4267
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4268
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4269 ; Helper Function - print metric depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4270 TFT_update_avr_stopwatch_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4271 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4272 bsf omit_digit_1 ; do not print 1st digit (no cm)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4273 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4274 output_65535 ; print (0.0x-655.3x)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4275 PUTC " " ; wipe out remains from last output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4276 clrf WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4277 movff WREG,buffer+.4 ; limit string length to 4 = 3 digits + 1 half-size decimal dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4278 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4279 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4280
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4281 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4282
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4283 ; resettable maximum depth - needs ISR-safe copy!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4284 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4285 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4286 SMOVII pressure_rel_max_trip,mpr ; get resettable maximum pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4287 rcall TFT_avr_stopwatch_helper ; print depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4288
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4289 ; resettable average depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4290 WIN_MEDIUM dm_custom_avr_stop_column2-.1,dm_custom_avr_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4291 FONT_COLOR_ATTENTION ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4292 MOVII pressure_rel_avg_trip,mpr ; get resettable average pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4293 rcall TFT_avr_stopwatch_helper ; print depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4294
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4295 ; resettable minimum depth - needs ISR safe copy!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4296 WIN_MEDIUM dm_custom_avr_stop_column3-.12,dm_custom_avr_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4297 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4298 SMOVII pressure_rel_min_trip,mpr ; get resettable minimum pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4299 rcall TFT_avr_stopwatch_helper ; print depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4300
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4301 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4302
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4303 TFT_avr_stopwatch_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4304 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4305 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4306 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4307 output_65535 ; print (0.00-655.35)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4308 PUTC " " ; wipe out remains from last output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4309 clrf WREG ; load string terminator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4310 movff WREG,buffer+.5 ; limit string length to 5 = 4 digits + 1 half-size decimal dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4311 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4312 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4313
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4314 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4315
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4316 TFT_update_avr_stopwatch3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4317 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4318 ;bra TFT_update_stopwatch ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4319
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4320 TFT_update_stopwatch:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4321 ; jump-in point for stopped dive time in compass custom view
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4322 MOVII divesecs_avg_trip,mpr ; get the resettable dive time (stopwatch)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4323 call convert_time ; convert hi:lo in seconds to minutes (up:hi) and seconds (lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4324 movlw .100 ; display layout will change if minutes become >= 100
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4325 cpfslt hi ; minutes < 100 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4326 bra TFT_update_stopwatch_1 ; NO - display hours:minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4327 bcf aux_flag ; YES - will print minutes : seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4328 bra TFT_update_stopwatch_2 ; - continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4329
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4330 TFT_update_stopwatch_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4331 movff hi,lo ; transfer minutes (low byte) to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4332 movff up,hi ; transfer minutes (high byte) to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4333 call convert_time ; convert hi:lo in minutes to hours (up:hi) and minutes (lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4334 bsf aux_flag ; will print hours : minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4335
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4336 TFT_update_stopwatch_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4337 movf hi,W ; exchange lo and hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4338 movff lo,hi ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4339 movwf lo ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4340 output_99 ; print minutes or hours (0 - 99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4341 movlw ":" ; load standard separator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4342 btfsc aux_flag ; will print hours : minutes ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4343 movlw "'" ; YES - swap to alternative separator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4344 movwf POSTINC2 ; print separator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4345 movff hi,lo ; restore lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4346 output_99x ; print seconds or minutes (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4347 movlw .5 ; set target length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4348 call TFT_buffer_trim_length ; fill / cut buffer to target length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4349 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4350 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4351
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4352
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4353 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4354 ; Dive Custom View - Gas Needs - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4355 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4356 global TFT_gas_needs_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4357 TFT_gas_needs_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4358 WIN_TINY dm_custom_gas_column_title, dm_custom_gas_mask_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4359 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4360
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4361 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4362
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4363 movff char_O_deco_info,WREG ; get the deco info vector
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4364 btfss WREG,gas_needs_cave ; are the gas needs calculated for cave mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4365 bra TFT_gas_needs_mask_ascent_1 ; NO - show as direct ascent needs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4366 ;bra TFT_gas_needs_mask_ascent_0 ; YES - show as cave return needs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4367
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4368 TFT_gas_needs_mask_ascent_0:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4369 bsf gas_needs_mode_last ; remember last results were for cave mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4370 STRCPY_TEXT tGasNeedsCaveMode ; print "Gas Needs Cave Mode"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4371 bra TFT_gas_needs_mask_ascent_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4372
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4373 TFT_gas_needs_mask_ascent_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4374 bcf gas_needs_mode_last ; remember last results were for direct ascent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4375 STRCPY_TEXT tGasNeedsAscent ; "Gas Needs Ascent"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4376 ;bra TFT_gas_needs_mask_ascent_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4377
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4378 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4379
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4380 STRCPY_TEXT tGasNeedsAscent ; "Gas Needs Ascent"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4381
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4382 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4383
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4384 TFT_gas_needs_mask_ascent_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4385 TSTOSS char_I_extra_time ; fTTS enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4386 bra TFT_gas_needs_mask_ascent_3 ; NO - continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4387 STRCAT " fTTS" ; YES - append fTTS marking
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4388 TFT_gas_needs_mask_ascent_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4389 STRCAT_PRINT " (bar)" ; append " (bar)" and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4390 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4391
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4392
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4393 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4394 ; Dive Custom View - Gas Needs - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4395 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4396 ; LIMITATION: there is only space for 4 gases on the screen - if 5 gases
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4397 ; have a pres_need > 0, then only the first 4 will be shown!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4398 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4399 global TFT_gas_needs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4400 TFT_gas_needs:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4401
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4402 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4403
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4404 movff char_O_deco_info,WREG ; get deco info vector
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4405 btfss WREG,gas_needs_cave ; are the gas needs calculated for cave mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4406 bra TFT_gas_needs_ascent_1 ; NO - continue below...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4407 btfsc gas_needs_mode_last ; YES - were the last results calculated for cave mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4408 bra TFT_gas_needs_ascent_3 ; YES - mask still valid
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4409 bra TFT_gas_needs_ascent_2 ; NO - redraw mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4410
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4411 TFT_gas_needs_ascent_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4412 btfss gas_needs_mode_last ; NO - were the last results calculated for direct ascent?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4413 bra TFT_gas_needs_ascent_3 ; YES - mask still valid
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4414 ;bra TFT_gas_needs_ascent_2 ; NO - redraw mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4415
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4416 TFT_gas_needs_ascent_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4417 rcall TFT_gas_needs_mask ; redraw mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4418 ;bra TFT_gas_needs_ascent_3 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4419
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4420 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4421
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4422 TFT_gas_needs_ascent_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4423 clrf up ; initialize gas index (0-4)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4424 WIN_SMALL dm_custom_gas_column1+.5,dm_custom_gas_row1 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4425 rcall TFT_gas_needs_helper ; print need
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4426 WIN_SMALL dm_custom_gas_column1+.5,dm_custom_gas_row2 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4427 rcall TFT_gas_needs_helper ; print need
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4428 WIN_SMALL dm_custom_gas_column2+.5,dm_custom_gas_row1 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4429 rcall TFT_gas_needs_helper ; print need
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4430 WIN_SMALL dm_custom_gas_column2+.5,dm_custom_gas_row2 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4431 rcall TFT_gas_needs_helper ; print need
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4432 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4433
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4434
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4435 ; Helper Function - print need for next gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4436 TFT_gas_needs_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4437 FONT_COLOR_MEMO ; select default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4438 movlw .5 ; total number of gases
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4439 cpfslt up ; check if all gases have been processed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4440 bra TFT_gas_needs_helper_1 ; YES - clear display area
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4441 movf up,W ; NO - get gas number and check if need of that gas is > 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4442 rlncf WREG,W ; - multiply by 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4443 incf WREG,W ; - add 1 to address high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4444 lfsr FSR1,int_O_gas_need_pres ; - load base of gas needs in pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4445 movff PLUSW1,hi ; - read HIGH(int_O_gas_need_pres[up])
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4446 btfss hi,int_is_zero ; - check flag for pres_need == 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4447 bra TFT_gas_needs_helper_2 ; NO - print gas type and pressure needed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4448 incf up,F ; YES - increment to next gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4449 bra TFT_gas_needs_helper ; - loop and try the next gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4450
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4451 TFT_gas_needs_helper_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4452 ; no gases to show anymore, clear display area from potential remains of last invocation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4453 STRCAT_PRINT " ---- " ; overwrite outdated stuff if screen position is not needed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4454 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4455
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4456 TFT_gas_needs_helper_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4457 ; output gas type and pressure needed
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4458 movf up,W ; get gas number (0-4) to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4459 lfsr FSR1,opt_gas_O2_ratio ; read opt_gas_O2_ratio[WREG]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4460 movff PLUSW1,lo ; copy result to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4461 lfsr FSR1,opt_gas_He_ratio ; read opt_gas_He_ratio[WREG]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4462 movff PLUSW1,hi ; copy result to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4463 call gaslist_strcat_mix ; print "Air", "O2", "21/35", etc.
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4464 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4465 movf up,W ; get gas number (0-4) to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4466 rlncf WREG,W ; multiply by 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4467 lfsr FSR1,int_O_gas_need_pres ; load base of gas needs in pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4468 movff PLUSW1,lo ; read LOW(int_O_gas_need_pres[up])
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4469 incf WREG,W ; add 1 to address high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4470 movff PLUSW1,hi ; read HIGH(int_O_gas_need_pres[up])
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4471 btfsc hi,int_attention_flag ; check if attention flag is set (pres_need > pres_fill * threshold)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4472 FONT_COLOR_ATTENTION ; YES - print gas need in attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4473 btfsc hi,int_warning_flag ; check if warning flag is set (pres_need > pres_fill)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4474 FONT_COLOR_WARNING ; YES - print gas need in warning color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4475 movff int_O_gas_need_pres+1,WREG ; get HIGH(int_O_gas_need_pres[0]) which holds flag for invalid data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4476 btfsc WREG,int_invalid_flag ; check if invalid data flag is set
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4477 FONT_COLOR_DISABLED ; YES - print gas need in disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4478 bcf hi,int_attention_flag ; clear flag for attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4479 bcf hi,int_warning_flag ; clear flag for warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4480 bcf hi,int_high_flag ; clear flag for > 999 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4481 bcf hi,int_invalid_flag ; clear flag for invalid data (will actually only be set with 1st gas)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4482 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4483 PUTC_PRINT " " ; add a space to overwrite any potential remains of earlier outputs and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4484 incf up,F ; increment to next gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4485 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4486
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4487
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4488 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4489 ; Dive Custom View - Deco Plan - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4490 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4491 global TFT_decoplan_mask ; mask for deco plan
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4492 TFT_decoplan_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4493 WIN_TINY dm_custom_decoplan_title_column, dm_custom_decoplan_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4494 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4495 STRCPY_TEXT_PRINT tDiveDecoplan ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4496
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4497 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4498
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4499
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4500 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4501 ; Dive Custom View - Deco Plan - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4502 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4503 global TFT_decoplan
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4504 TFT_decoplan:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4505 lfsr FSR0,char_O_deco_depth ; load base address of stops table
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4506 clrf ex ; will be used for auxiliary flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4507 FONT_COLOR_MEMO ; set default output color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4508 movff char_O_deco_gas+0,lo ; get flag for invalid deco data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4509 btfsc lo,char_invalid_flag ; is the invalid flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4510 FONT_COLOR_DISABLED ; YES - set to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4511 ; 2nd stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4512 WIN_SMALL dm_cust_dstop_2nd_stop_column, dm_cust_dstop_2nd_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4513 rcall TFT_decoplan_helper ; show stop data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4514 ; 3rd stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4515 WIN_SMALL dm_cust_dstop_3rd_stop_column, dm_cust_dstop_3rd_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4516 rcall TFT_decoplan_helper ; show stop data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4517 ; 4th stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4518 bsf ex,4 ; flag we are on 4th screen position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4519 WIN_SMALL dm_cust_dstop_4th_stop_column, dm_cust_dstop_4th_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4520 rcall TFT_decoplan_helper ; show stop data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4521 bcf ex,4 ; clear 4th position flag again
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4522 ; 5th stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4523 WIN_SMALL dm_cust_dstop_5th_stop_column, dm_cust_dstop_5th_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4524 rcall TFT_decoplan_helper ; show stop data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4525 ; 6th stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4526 WIN_SMALL dm_cust_dstop_6th_stop_column, dm_cust_dstop_6th_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4527 rcall TFT_decoplan_helper ; show stop data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4528 ; 7th stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4529 WIN_SMALL dm_cust_dstop_7th_stop_column, dm_cust_dstop_7th_stop_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4530 rcall TFT_decoplan_helper ; show stop data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4531 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4532
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4533
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4534 ; Helper Function - show stop data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4535 TFT_decoplan_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4536 btfsc ex,0 ; no more stops to show?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4537 bra TFT_decoplan_helper_1 ; YES - skip checking next entry - it will be empty, too
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4538 movff PREINC0,lo ; NO - advance pointer to get the depth of the 2nd, 3rd, 4th, ... stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4539 tstfsz lo ; is the stop depth = 0, i.e. no stop entry?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4540 bra TFT_decoplan_helper_3 ; NO - show stop data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4541
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4542 TFT_decoplan_helper_1: ; no more stop table entries
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4543 bsf ex,0 ; flag that there are no more stop table entries
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4544 btfss ex,4 ; are we on the 4th screen position?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4545 bra TFT_decoplan_helper_2 ; NO - normal handling on this position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4546 btfsc ex,1 ; YES - special handling, has any stop been shown?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4547 bra TFT_decoplan_helper_2 ; YES - print normal blanking
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4548 STRCPY_PRINT " ---- " ; NO - print a "no stops" indication (blanking potential previous content, too)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4549 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4550
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4551 TFT_decoplan_helper_2: ; no more stop table entries, blank potential previous content
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4552 STRCPY_PRINT " " ; wipe screen position by printing 7 spaces
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4553 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4554
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4555 TFT_decoplan_helper_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4556 rcall TFT_display_stop_depth ; print stop depth (depth in lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4557 PUTC " " ; put a space char between depth and time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4558 movlw NUM_STOPS ; offset between arrays holding depths and durations
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4559 movff PLUSW0,lo ; get duration of the current stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4560 output_99dd ; print duration, prints double dots if duration is zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4561 PUTC_PRINT "'" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4562 bsf ex,1 ; flag that a stop was shown
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4563 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4564
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4565
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4566 ; Helper Function - print stop depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4567 TFT_display_stop_depth: ; print depth (stored in lo)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4568 TSTOSS opt_units ; get unit (0=m, 1=ft)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4569 bra TFT_display_stop_depth_m ; 0 - meter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4570 ;bra TFT_display_stop_depth_ft ; 1 - feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4571
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4572 TFT_display_stop_depth_ft:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4573 call convert_meter_to_feet ; convert value in lo from meters to feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4574 output_999 ; output stop depth (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4575 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4576
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4577 TFT_display_stop_depth_m:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4578 output_99 ; output stop depth (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4579 STRCAT_TEXT tMeters ; append unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4580 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4581
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4582
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4583 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4584 ; Dive Custom View - Ceiling, Supersaturation & Tissues - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4585 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4586 global TFT_ceiling_GF_tissue_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4587 TFT_ceiling_GF_tissue_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4588 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4589
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4590 WIN_TINY dm_custom_ceiling_column+.2,dm_custom_ceiling_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4591 STRCPY_TEXT_PRINT tCeiling ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4592
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4593 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4594 STRCPY_TEXT_PRINT tDiveTissues ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4595
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4596 WIN_TINY dm_custom_gf_column1+.5, dm_custom_gf_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4597 STRCPY_TEXT_PRINT tGFInfo ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4598
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4599 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4600
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4601
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4602 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4603 ; Dive Custom View - Ceiling, Supersaturation & Tissues - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4604 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4605 global TFT_ceiling_GF_tissue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4606 TFT_ceiling_GF_tissue:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4607 WIN_MEDIUM dm_custom_ceiling_column,dm_custom_ceiling_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4608 MOVII int_O_ceiling,mpr ; get ceiling in [mbar] relative pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4609 call TFT_color_code_ceiling ; color-code the output (also strips off flags)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4610 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4611
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4612 TSTOSS opt_units ; 0=m, 1=ft
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4613 bra TFT_ceiling_GF_tissue_metric ; 0 - meter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4614 ;bra TFT_ceiling_GF_tissue_imperial ; 1 - feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4615
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4616 TFT_ceiling_GF_tissue_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4617 call convert_cm_to_feet ; convert value in hi:lo from [cm] to [feet]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4618 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4619 bra TFT_ceiling_GF_tissue0 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4620
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4621 TFT_ceiling_GF_tissue_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4622 bsf omit_digit_1 ; do not print 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4623 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4624 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4625 output_65535 ; print (xxx.x-)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4626 bra TFT_ceiling_GF_tissue0 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4627
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4628 TFT_ceiling_GF_tissue0:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4629 PUTC_PRINT " " ; append a space and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4630 ; show tissue diagram
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4631 rcall TFT_dive_tissues ; show tissue pressure diagram
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4632 ; show current supersaturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4633 WIN_MEDIUM dm_custom_clock_column+.3, dm_custom_gf_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4634 MOVII int_O_lead_supersat,mpr ; bank-safe copy of leading tissue's supersaturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4635 call TFT_color_code_supersat ; color-code output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4636 output_256 ; need to print lo only, int_O_lead_supersat value is limited to 255
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4637 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4638 WIN_STD dm_custom_clock_column+.40, dm_custom_gf_row+.5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4639 PUTC_PRINT "%" ; print "%" and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4640 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4641
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4642
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4643 ;-------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4644 ; Draw saturation graph in dive mode custom view
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4645 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4646 TFT_dive_tissues:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4647 ; draw outer frame
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4648 movf pallet_color_memo,W ; get color into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4649 WIN_FRAME_COLOR dm_custom_tissue_diagram_top, dm_custom_tissue_diagram_bottom, dm_custom_tissue_diagram_left, .159 ; outer frame
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4651 ; clear area showing leading tissue number as it may not be printed over
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4652 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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4653
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4654 TFT_dive_tissues_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4655 ; common initialization for tissue pressures and saturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4656 movlw .1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4657 movwf win_height ; hight of the bargraph (0-239)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4658 movlw dm_custom_tissue_diagram_left+.3 ; get dive mode left start position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4659 movwf win_leftx2 ; set column left (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4660 movlw .159-dm_custom_tissue_diagram_left-.4 ; get max width
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4661 movwf win_width+0 ; set width (low byte)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4662 clrf win_width+1 ; high byte of with is always zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4663 movlw color_cyan ; color for tissues with decreasing pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4664 movwf ex ; store in ex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4665 movlw color_orange ; color for tissues with increasing pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4666 movwf ul ; store in ul
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4667
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4668 ; draw combined or N2 tissue pressures
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4669 lfsr FSR2,char_O_tissue_pressure ; load base address of combined pressures by default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4670 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4671 btfsc tissue_graphic_layout ; shall show N2+He ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4672 lfsr FSR2,char_O_tissue_pres_N2 ; YES - load base address of N2 pressures
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4673 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4674 movlw d'16'
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4675 movwf lo ; tissue counter, 16 tissues
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4676 clrf hi ; row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4677 TFT_dive_tissues_N2_loop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4678 movlw dm_custom_tissue_diagram_top+.3 ; dive mode top start position N2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4679 rcall TFT_dive_tissues_bargraph ; draw tissue bargraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4680 incf hi,F ; increment row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4681 decfsz lo,F ; decrement tissue counter, done?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4682 bra TFT_dive_tissues_N2_loop ; NO - loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4683 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4684 btfsc tissue_graphic_layout ; shall show N2+He ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4685 bra TFT_dive_tissues_3 ; YES - show He tissue pressures
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4686 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4687
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4688 ; draw tissue saturations
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4689 lfsr FSR2,char_O_tissue_saturation ; load base address of tissue supersaturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4690 movlw d'16'
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4691 movwf lo ; tissue counter, 16 tissues
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4692 clrf hi ; row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4693 movlw color_grey ; color for tissue saturation, alternative: color_lightblue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4694 movwf ex ; store in ex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4695 ; movlw color_yellow ; 2nd color is not used by tissue saturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4696 ; movwf ul ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4697 TFT_dive_tissues_sat_loop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4698 movlw dm_custom_tissue_diagram_top+.25 ; dive mode top start position saturations
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4699 rcall TFT_dive_tissues_bargraph ; draw tissue bargraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4700 incf hi,F ; increment row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4701 decfsz lo,F ; decrement tissue counter, done?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4702 bra TFT_dive_tissues_sat_loop ; NO - loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4703
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4704 ; common part for vertical lines
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4705 movlw dm_custom_tissue_diagram_top+.25 ; get top position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4706 movwf win_top ; set top position (0-239)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4707 movlw .15 ; get hight
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4708 movwf win_height ; set height
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4709 movlw .1 ; get width
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4710 movwf win_width+0 ; set width, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4711 clrf win_width+1 ; set width, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4712
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4713 ; print 100% line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4714 movlw dm_custom_tissue_diagram_left+.36 ; get left position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4715 movwf win_leftx2 ; set left position (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4716 movlw color_red ; color for 100% line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4717 BOX_COLOR ; draw line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4718
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4719 ; GF factors enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4720 btfss tissue_graphic_gf ; shall show GF lines?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4721 bra TFT_dive_tissues_4 ; NO - continue with number of leading tissue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4722
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4723 ; print GF low line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4724 movlw dm_custom_tissue_diagram_left+.3 ; get left base position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4725 movwf win_leftx2 ; set left base position (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4726 movff char_I_GF_Low_percentage,WREG ; get GF low in 0.01 %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4727 mullw .82 ; multiply with 82
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4728 movf PRODH,W ; divide by 256 -> resulting scale factor is 82/256 = 0.3203125
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4729 addwf win_leftx2,F ; add to base position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4730 movlw color_green ; color for GF low line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4731 BOX_COLOR ; draw line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4732
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4733 ; print GF high line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4734 movlw dm_custom_tissue_diagram_left+.3 ; get left base position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4735 movwf win_leftx2 ; set left base position (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4736 movff char_I_GF_High_percentage,WREG ; get GF high in 0.01 %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4737 mullw .82 ; multiply with 82
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4738 movf PRODH,W ; divide by 256 -> resulting scale factor is 82/256 = 0.3203125
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4739 addwf win_leftx2,F ; add to base position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4740 movlw color_yellow ; color for GF high line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4741 BOX_COLOR ; draw line
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
4742 bra TFT_dive_tissues_4 ; continue with number of leading tissue
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4743
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4744 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4745 TFT_dive_tissues_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4746 ; draw He tissues pressures
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4747 lfsr FSR2,char_O_tissue_pres_He ; load base address of He pressures
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4748 movlw dm_custom_tissue_diagram_left+.7 ; get dive mode left start position for He bars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4749 movwf win_leftx2 ; set column left (0-159)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4750 movlw .159-dm_custom_tissue_diagram_left-.8 ; get max width for He bars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4751 movwf win_width+0 ; set width (low byte)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4752 clrf win_width+1 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4753 movlw d'16'
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4754 movwf lo ; tissue counter, 16 tissues
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4755 clrf hi ; row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4756 TFT_dive_tissues_He_loop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4757 movlw dm_custom_tissue_diagram_top+.25 ; dive mode top start position H2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4758 rcall TFT_dive_tissues_bargraph ; draw tissue bargraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4759 incf hi,F ; increment row counter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4760 decfsz lo,F ; decrement tissue counter, done?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4761 bra TFT_dive_tissues_He_loop ; NO - loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4762 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4763
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4764 TFT_dive_tissues_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4765 ; print number of leading tissue ; TODO: some flicker due to overwriting by tissue bars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4766 movff int_O_lead_supersat+0,WREG ; get current leading tissue's supersaturation (only low byte used for value)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4767 tstfsz WREG ; current supersaturation = 0 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4768 bra TFT_dive_tissues_5 ; NO - print number of leading tissue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4769 movff char_O_deco_info,WREG ; YES - get deco info vector
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4770 btfss WREG,deco_ceiling ; - do we have a ceiling obligation?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4771 return ; NO - can ascent directly, don't print number, set standard color and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4772 ; YES - print number of leading tissue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4773 TFT_dive_tissues_5:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4774 movff char_O_lead_tissue,lo ; get number of leading tissue as 0-15
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4775 incf lo,F ; adjust to 1-16
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4776 movlw .10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4777 cpfsgt lo ; is it > 10 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4778 bra TFT_dive_tissues_6 ; NO - will output a single digit number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4779 ; start position for a 2 digit number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4780 WIN_TINY dm_custom_tissue_diagram_left+.32,dm_custom_tissue_diagram_top+.10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4781 bra TFT_dive_tissues_7
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4782 TFT_dive_tissues_6:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4783 ; start position for a 1 digit number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4784 WIN_TINY dm_custom_tissue_diagram_left+.32+.4,dm_custom_tissue_diagram_top+.10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4785 TFT_dive_tissues_7:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4786 FONT_COLOR_MEMO ; set output color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4787 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4788 output_99 ; print tissue number (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4789 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4790 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4791
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4792
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4793 ; Helper Function - draw a bargraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4794 TFT_dive_tissues_bargraph:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4795 addwf hi,W ; add row number to start position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4796 movwf win_top ; set as row top (0-239)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4797 movff POSTINC2,up ; get tissue value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4798 movf ex,W ; default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4799 btfsc up,7 ; check if flag in bit 7 is set
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4800 movf ul,W ; YES - switch to 2nd color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4801 bcf up,7 ; clear flag bit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4802 bcf STATUS,C ; clear carry bit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4803 rrcf up,F ; divide by 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4804 movff up,win_bargraph ; set bargraph length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4805 incf win_bargraph,F ; add a bit for a minimum visible bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4806 BOX_COLOR ; draw bargraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4807 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4808
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4809
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4810 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4811 ; Dive Custom View - CNS - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4812 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4813 global TFT_CNS_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4814 TFT_CNS_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4815 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4816
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4817 WIN_TINY dm_custom_cns3_column1, dm_custom_cns3_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4818 STRCPY_TEXT_PRINT tCNSsurf ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4819
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4820 WIN_TINY dm_custom_cns3_column2, dm_custom_cns3_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4821
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4822 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4823 btfss cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4824 bra TFT_CNS_mask_col2 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4825 STRCPY_TEXT_PRINT tCNScave ; YES - print cave TTS label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4826 bra TFT_CNS_mask_col3 ; - continue with 3rd column
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4827 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4828
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4829 TFT_CNS_mask_col2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4830 btfsc FLAG_oc_mode ; in OC mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4831 bra TFT_CNS_mask_ftts ; YES - print fTTS label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4832 btfsc bailout_mode ; NO - in bailout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4833 bra TFT_CNS_mask_ftts ; YES - print fTTS label (label will be printed, but a fTTS will actually not be calculated)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4834 TSTOSS opt_calc_gasvolume ; NO - bailout volume calculation requested?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4835 bra TFT_CNS_mask_ftts ; NO - print fTTS label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4836 ;bra TFT_CNS_mask_bo ; YES - print bailout label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4837
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4838 TFT_CNS_mask_bo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4839 STRCPY_TEXT_PRINT tCNSBO ; print bailout label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4840 bra TFT_CNS_mask_col3 ; continue with 3rd column
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4841
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4842 TFT_CNS_mask_ftts:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4843 STRCPY_TEXT_PRINT tCNSfTTS ; print fTTS label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4844 ;bra TFT_CNS_mask_col3 ; continue with 3rd column
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4845
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4846 TFT_CNS_mask_col3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4847 WIN_TINY dm_custom_cns3_column3, dm_custom_cns3_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4848 STRCPY_TEXT_PRINT tCNSnow ; print CNS now label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4849 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4850
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4851
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4852 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4853 ; Dive Custom View - CNS - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4854 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4855 global TFT_CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4856 TFT_CNS:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4857 ; CNS at end of normal dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4858 WIN_STD dm_custom_cns3_column1+.3,dm_custom_cns3_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4859 MOVII int_O_CNS_norm,mpr ; get CNS at end of dive in normal plan
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4860 call TFT_color_code_cns ; color-code the CNS value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4861 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4862 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4863 STRCAT_PRINT "% " ; append unit and trailing space and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4864 ; fTTS / Bailout CNS, if enabled
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4865 WIN_STD dm_custom_cns3_column2+.2,dm_custom_cns3_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4866 btfsc bailout_mode ; in bailout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4867 bra TFT_CNS_3 ; YES - show "---"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4868 TSTOSS opt_calc_gasvolume ; NO - bailout volume calculation requested?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4869 bra TFT_CNS_1 ; NO - continue checking fTTS extra time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4870 btfss FLAG_oc_mode ; YES - in OC mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4871 bra TFT_CNS_2 ; NO - show CNS%
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4872 ;bra TFT_CNS_1 ; YES - continue checking fTTS extra time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4873
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4874 TFT_CNS_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4875 ; not in bailout, no volume calculation, and/or in OC mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4876 TSTOSS char_I_extra_time ; fTTS extra time configured?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4877 bra TFT_CNS_3 ; NO - show "---"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4878 ;bra TFT_CNS_2 ; YES - show CNS%
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4879
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4880 TFT_CNS_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4881 MOVII int_O_CNS_alt,mpr ; get CNS at end of dive in alternative plan
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4882 call TFT_color_code_cns ; color-code the CNS value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4883 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4884 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4885 STRCAT_PRINT "% " ; append unit and trailing space and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4886 bra TFT_CNS_4 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4887
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4888 TFT_CNS_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4889 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4890 btfss cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4891 bra TFT_CNS_3a ; NO - show dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4892 btfsc backtrack_entire_full ; YES - cave mode shut down due to storage fully used up?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4893 bra TFT_CNS_3a ; YES - show dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4894 btfss dive_turned ; NO - dive turned?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4895 bra TFT_CNS_2 ; NO - show cave CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4896 ;bra TFT_CNS_3a ; YES - show dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4897 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4898
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4899 TFT_CNS_3a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4900 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4901 STRCPY_PRINT "--- " ; print non-avail symbol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4902 ;bra TFT_CNS_4 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4903
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4904 TFT_CNS_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4905 ; current CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4906 WIN_STD dm_custom_cns3_column3+.3,dm_custom_cns3_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4907 MOVII int_O_CNS_current,mpr ; get current CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4908 call TFT_color_code_cns ; color-code the CNS value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4909 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4910 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4911 PUTC_PRINT "%" ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4912 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4913
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4914
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4915 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4916 ; Dive Custom View - ppO2, EAD/END & Gas Density - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4917 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4918 global TFT_ppo2_ead_end_cns_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4919 TFT_ppo2_ead_end_cns_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4920 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4921
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4922 WIN_TINY dm_custom_ppo2_column-.2,dm_custom_ppo2_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4923 STRCPY_TEXT_PRINT tppO2 ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4924
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4925 WIN_TINY dm_custom_ead_column,dm_custom_eadend_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4926 STRCPY_TEXT_PRINT tDiveEAD_END ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4927
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4928 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4929 WIN_TINY dm_custom_cns_column-.5,dm_custom_eadend_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4930 STRCPY_TEXT_PRINT tGasDensity ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4931 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4932 WIN_TINY dm_custom_cns_column,dm_custom_cns_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4933 STRCPY_TEXT_PRINT tCNS2 ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4934 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4935
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4936 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4937
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4938
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4939
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4940 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4941 ; Dive Custom View - ppO2, EAD/END & Gas Density - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4942 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4943 global TFT_ppo2_ead_end_cns
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4944 TFT_ppo2_ead_end_cns:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4945 ; show ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4946 WIN_MEDIUM dm_custom_ppo2_column, dm_custom_ppo2_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4947 MOVII int_O_breathed_ppO2,mpr ; copy ppO2 of the currently breathed gas to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4948 call TFT_color_code_ppo2 ; color-code output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4949 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4950 output_999 ; print ppO2 (0.00-9.99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4951 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4952 ; show END/EAD
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4953 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4954 WIN_SMALL dm_custom_ead_column, dm_custom_ead_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4955 STRCPY_TEXT tEAD ; print "EAD:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4956 MOVII int_O_EAD_pres,mpr ; copy EAD in [mbar] to MPR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4957 rcall TFT_end_ead_common ; convert to depth, print and limit to 8 chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4958 WIN_SMALL dm_custom_end_column, dm_custom_end_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4959 STRCPY_TEXT tEND ; print "END:"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4960 MOVII int_O_END_pres,mpr ; copy END in [mbar] to MPR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4961 rcall TFT_end_ead_common ; convert to depth, print and limit to 8 chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4962 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4963 ; show gas density
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4964 WIN_MEDIUM dm_custom_cns_column-.5, dm_custom_cns_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4965 MOVII int_O_gas_density,mpr ; get current gas density
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4966 call TFT_color_code_cns ; color-code output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4967 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4968 output_999 ; print (0.00-9.99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4969 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4970 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4971 ; show CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4972 WIN_STD dm_custom_cns_column+.3, dm_custom_cns_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4973 MOVII int_O_CNS_current,mpr ; get current CNS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4974 call TFT_color_code_cns ; color-code CNS output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4975 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4976 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4977 PUTC_PRINT "%" ; append unit and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4978 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4979 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4980
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4981
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4982 ; Helper Function - convert to depth, print and limit to 8 chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4983 TFT_end_ead_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4984 call convert_pres_to_depth ; convert pressure in [mbar] to depth in [cm]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4985 TSTOSS opt_units ; 0=Meter, 1=Feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4986 bra TFT_end_ead_common_metric ; 0: meter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4987 ;bra TFT_end_ead_common_imperial ; 1: feet
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4988
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4989 TFT_end_ead_common_imperial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4990 call convert_cm_to_feet ; convert depth in [cm] to depth in [feet]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4991 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4992 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4993 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4994
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4995 TFT_end_ead_common_metric:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4996 bsf omit_digit_2 ; do not print 2nd and 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4997 output_65535 ; print (0xx-655xx)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4998 PUTC_PRINT 'm' ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
4999 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5000
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5001
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5002 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5003 ; Dive Custom View - GF Factors (Mask only)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5004 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5005 global TFT_gf_factors_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5006 TFT_gf_factors_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5007 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5008
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5009 ; show labels
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5010 WIN_TINY dm_custom_gf_column1,dm_custom_gf_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5011 STRCPY_TEXT_PRINT tGFactors
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5012 WIN_TINY dm_custom_gf_column3,dm_custom_gf_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5013 STRCPY_TEXT_PRINT taGFactors
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5014
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5015 ; show GF (static)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5016 WIN_STD dm_custom_gf_column1, dm_custom_gf_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5017 FONT_COLOR_DISABLED ; default to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5018 btfss use_aGF ; shall use alternative GF factors?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5019 FONT_COLOR_MEMO ; NO - switch to memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5020 movff opt_GF_low, lo ; get normal GF low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5021 movff opt_GF_high,hi ; get normal GF high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5022 rcall TFT_gf_factors_mask_helper ; print GFs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5023
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5024 ; show aGF (static)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5025 FONT_COLOR_MEMO ; select memo color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5026 TSTOSS opt_enable_aGF ; are alternative GF factors enabled?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5027 bra TFT_gf_factors_mask_3 ; NO - show "---" and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5028 ; bra TFT_gf_factors_mask_0 ; YES - show arrow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5029
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5030 TFT_gf_factors_mask_0:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5031 WIN_STD dm_custom_gf_column2, dm_custom_gf_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5032 btfss use_aGF ; shall use aGF?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5033 bra TFT_gf_factors_mask_1L ; NO - print "<- "
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5034 ;bra TFT_gf_factors_mask_1R ; YES - print " ->"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5035
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5036 TFT_gf_factors_mask_1R:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5037 STRCPY_PRINT " ->" ; print " ->"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5038 bra TFT_gf_factors_mask_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5039
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5040 TFT_gf_factors_mask_1L:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5041 STRCPY_PRINT "<- " ; print "<- "
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5042 ;bra TFT_gf_factors_mask_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5043
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5044 TFT_gf_factors_mask_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5045 WIN_STD dm_custom_gf_column3, dm_custom_gf_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5046 ;FONT_COLOR_MEMO ; select memo color (still selected)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5047 btfss use_aGF ; shall use aGF?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5048 FONT_COLOR_DISABLED ; NO - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5049 movff opt_aGF_low, lo ; get aGF low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5050 movff opt_aGF_high,hi ; get aGF high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5051 rcall TFT_gf_factors_mask_helper ; print GFs
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5052 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5053
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5054 TFT_gf_factors_mask_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5055 WIN_STD dm_custom_gf_column3+.10, dm_custom_gf_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5056 STRCPY_PRINT "---" ; print not-avail symbol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5057 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5058
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5059 ; Helper Function - print GF pair
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5060 TFT_gf_factors_mask_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5061 output_256 ; print GF low (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5062 PUTC "/" ; print "/"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5063 movff hi,lo ; get GF high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5064 output_256 ; print GF high (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5065 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5066 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5067
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5068
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5069 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5070 ; Dive Custom View - Clock, Battery & Surface Pressure - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5071 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5072 global TFT_clock_batt_surfpress_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5073 TFT_clock_batt_surfpress_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5074 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5075
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5076 WIN_TINY dm_custom_clock_column, dm_custom_clock_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5077 STRCPY_TEXT_PRINT tTime ; "Time"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5078
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5079 WIN_TINY dm_custom_battery_column, dm_custom_battery_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5080 STRCPY_TEXT_PRINT tBattery ; "Battery"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5081
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5082 WIN_TINY dm_custom_surfpres_column+.8, dm_custom_surfpres_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5083 STRCPY_TEXT_PRINT tSurface ; "Surface"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5084
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5085 ; show configured surface pressure (done in mask, because it's static during the dive)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5086 WIN_SMALL dm_custom_surfpres_column, dm_custom_surfpres_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5087 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5088 MOVII pressure_surf,mpr ; get surface pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5089 output_65535 ; print (5 digits, first one used as spacer)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5090 PUTC ' ' ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5091 STRCAT_TEXT_PRINT tMBAR ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5092 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5093
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5094
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5095 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5096 ; Dive Custom View - Clock, Battery & Surface Pressure - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5097 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5098 global TFT_clock_batt_surfpress
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5099 TFT_clock_batt_surfpress:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5100 ; update clock
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5101 WIN_SMALL dm_custom_clock_column, dm_custom_clock_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5102 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5103 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5104 movff rtc_latched_hour,lo ; get hours
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5105 output_99 ; print hours (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5106 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5107 movff rtc_latched_mins,lo ; get minutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5108 output_99x ; print minutes (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5109 PUTC ":" ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5110 movff rtc_latched_secs,lo ; get seconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5111 output_99x ; print seconds (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5112 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5113
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5114 ; show battery voltage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5115 WIN_SMALL dm_custom_battery_column, dm_custom_battery_volt_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5116 ;FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5117 MOVII batt_voltage,mpr ; get voltage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5118 bsf decimal_digit3 ; place a decimal point in front of digit 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5119 bsf omit_digit_1 ; do not print 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5120 output_9999 ; print voltage (0.00x-9.99x)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5121 PUTC_PRINT 'V' ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5122
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5123 ; show battery percent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5124 WIN_SMALL dm_custom_battery_column+.7, dm_custom_battery_percent_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5125 call TFT_color_code_battery ; color-code according to battery_low_condition flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5126 movff batt_percent,lo ; get battery %
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5127 output_256 ; print battery % (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5128 PUTC_PRINT "%" ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5129
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5130 ; surface pressure is shown via the mask because it is static
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5131 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5132
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5133
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5134 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5135
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5136 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5137 ; Dive Custom View - Sensor Check - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5138 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5139 global TFT_sensor_check_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5140 TFT_sensor_check_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5141 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5142
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5143 WIN_TINY dm_custom_s_check_title_column, dm_custom_s_check_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5144 STRCPY_TEXT_PRINT tSensorCheck ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5145
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5146 WIN_TINY dm_custom_ppO2_column, dm_custom_s_check_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5147 STRCPY_TEXT_PRINT tppO2O2 ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5148
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5149 WIN_TINY dm_custom_ppDil_column, dm_custom_s_check_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5150 STRCPY_TEXT_PRINT tppO2Dil ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5151
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5152 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5153
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5154
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5155 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5156 ; Dive Custom View - Sensor Check - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5157 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5158 global TFT_sensor_check
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5159 TFT_sensor_check:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5160 ; show ppO2 of O2 in this depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5161 WIN_MEDIUM dm_custom_ppO2_column, dm_custom_s_check_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5162 MOVII int_O_O2_ppO2,mpr ; copy ppO2 of pure O2 to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5163 rcall TFT_sensor_check_helper ; print ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5164 ; show ppO2 of the diluent in this depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5165 WIN_MEDIUM dm_custom_ppDil_column, dm_custom_s_check_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5166 MOVII int_O_pure_ppO2,mpr ; copy ppO2 of pure gas to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5167 rcall TFT_sensor_check_helper ; print ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5168 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5169
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5170 TFT_sensor_check_helper:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5171 call TFT_color_code_ppo2 ; color-code output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5172 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5173 output_999 ; print ppO2 (0.00-9.99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5174 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5175 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5176
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5177
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5178 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5179 ; Dive Custom View - pSCR Info - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5180 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5181 global TFT_pscr_info_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5182 TFT_pscr_info_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5183 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5184
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5185 WIN_TINY dm_custom_pscr_drop_column, dm_custom_pscr_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5186 STRCPY_TEXT_PRINT tPSCR_O2_drop ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5187
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5188 WIN_TINY dm_custom_pscr_ratio_column, dm_custom_pscr_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5189 STRCPY_TEXT_PRINT tPSCR_lungratio ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5190
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5191 WIN_TINY dm_custom_ppo2_column-.2,dm_custom_ppo2_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5192 btfsc bailout_mode ; in bailout?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5193 bra TFT_pscr_info_mask_2 ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5194 ;bra TFT_pscr_info_mask_1 ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5195
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5196 TFT_pscr_info_mask_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5197 STRCPY_TEXT_PRINT tppO2Mix ; print "ppO2(Mix)"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5198 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5199
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5200 TFT_pscr_info_mask_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5201 STRCPY_TEXT_PRINT tppO2 ; print "ppO2"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5202 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5203
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5204
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5205 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5206 ; Dive Custom View - pSCR Info - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5207 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5208 global TFT_pscr_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5209 TFT_pscr_info:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5210 ;show ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5211 WIN_MEDIUM dm_custom_ppo2_column,dm_custom_ppo2_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5212 MOVII int_O_pSCR_ppO2,mpr ; copy pSCR ppO2 to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5213 call TFT_color_code_ppo2 ; color-code output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5214 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5215 output_999 ; print ppO2 (0.00-9-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5216 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5217 ; show drop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5218 WIN_STD dm_custom_pscr_drop_column+.11,dm_custom_pscr_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5219 FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5220 movff char_I_PSCR_drop,lo ; get drop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5221 output_99 ; print drop (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5222 PUTC_PRINT "%" ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5223 ; show lung ratio
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5224 WIN_STD dm_custom_pscr_ratio_column+.5,dm_custom_pscr_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5225 ;FONT_COLOR_MEMO ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5226 movff char_I_PSCR_lungratio,lo ; get ratio
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5227 STRCPY "1/" ; print "1/"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5228 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5229 output_256 ; print ratio number (0-256)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5230 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5231 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5232
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5233 ENDIF ; _ccr_psrc
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5234
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5235 IFDEF _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5236
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5237 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5238 ; Dive Custom View - Sensor ppO2 - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5239 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5240 global TFT_ppo2_sensors_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5241 TFT_ppo2_sensors_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5242 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5243
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5244 WIN_TINY dm_custom_hud_sensor1_column+.4,dm_custom_hud_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5245 STRCPY_TEXT_PRINT tDiveHudMask1 ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5246
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5247 WIN_TINY dm_custom_hud_sensor2_column+.3,dm_custom_hud_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5248 STRCPY_TEXT_PRINT tDiveHudMask2 ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5249
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5250 WIN_TINY dm_custom_hud_sensor3_column+.2,dm_custom_hud_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5251 STRCPY_TEXT_PRINT tDiveHudMask3 ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5252
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5253 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5254
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5255
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5256 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5257 ; Dive Custom View - Sensor ppO2 - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5258 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5259 ; Definition of the output:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5260 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5261 ; sensorX use voting o2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5262 ; _calibrated _O2 _logic _ppo2 Output Color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5263 ; _ok _sensorX _sensorX _sensorX
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5264 ;-----------------------------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5265 ; 0 -/- -/- -/- "----" memo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5266 ; 1 0 -/- = 0 o2_ppo2_sensorX attention
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5267 ; 1 0 -/- > 0 o2_ppo2_sensorX disabled
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5268 ; 1 1 0 -/- o2_ppo2_sensorX TFT_color_code_ppo2_hud + win_invert
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5269 ; 1 1 1 -/- o2_ppo2_sensorX TFT_color_code_ppo2_hud
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5270 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5271 global TFT_ppo2_sensors
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5272 TFT_ppo2_sensors:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5273
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5274 ; sensor 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5275 TFT_ppo2_sensors_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5276 btfsc sensor1_calibrated_ok ; valid calibration?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5277 bra TFT_ppo2_sensors_1b ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5278 btfsc sensor1_active ; NO - valid HUD data for this sensor?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5279 bra TFT_ppo2_sensors_1b ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5280 ;bra TFT_ppo2_sensors_1a ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5281
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5282 TFT_ppo2_sensors_1a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5283 ; no valid calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5284 WIN_STD dm_custom_hud_sensor1_column+.7, dm_custom_hud_row+.5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5285 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5286 STRCPY_PRINT "---" ; print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5287 bra TFT_ppo2_sensors_2 ; continue with sensor 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5288
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5289 TFT_ppo2_sensors_1b:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5290 ; sensor has a valid calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5291 WIN_MEDIUM dm_custom_hud_sensor1_column,dm_custom_hud_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5292 movff sensor1_ppO2,lo ; load ppO2 value into transfer storage for output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5293 btfsc use_O2_sensor1 ; in use?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5294 bra TFT_ppo2_sensors_1d ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5295 tstfsz lo ; NO - sensor value = 0 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5296 bra TFT_ppo2_sensors_1c ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5297 FONT_COLOR_ATTENTION ; YES - set attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5298 bra TFT_ppo2_sensors_1e ; - print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5299
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5300 TFT_ppo2_sensors_1c:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5301 ; sensor has valid calibration, is not in use and has a value > 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5302 FONT_COLOR_DISABLED ; set disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5303 bra TFT_ppo2_sensors_1e ; print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5304
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5305 TFT_ppo2_sensors_1d:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5306 ; sensor has valid calibration and is in use
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5307 call TFT_color_code_ppo2_hud ; color-code with ppO2 [cbar] in lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5308 btfsc voting_logic_sensor1 ; sensor value agrees with values of other sensors?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5309 bra TFT_ppo2_sensors_1e ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5310 bsf win_invert ; NO - invert output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5311 ;bra TFT_ppo2_sensors_1e ; print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5312
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5313 TFT_ppo2_sensors_1e:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5314 ; all coloring is set up now, let's write the value to the display!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5315 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5316 output_256 ; print (0.00-2.55)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5317 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5318
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5319 ; sensor 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5320 TFT_ppo2_sensors_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5321 btfsc sensor2_calibrated_ok ; valid calibration?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5322 bra TFT_ppo2_sensors_2b ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5323 btfsc sensor2_active ; NO - valid HUD data for this sensor?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5324 bra TFT_ppo2_sensors_2b ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5325 ;bra TFT_ppo2_sensors_2a ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5326
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5327 TFT_ppo2_sensors_2a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5328 ; no valid calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5329 WIN_STD dm_custom_hud_sensor2_column+.7, dm_custom_hud_row+.5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5330 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5331 STRCPY_PRINT "---" ; print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5332 bra TFT_ppo2_sensors_3 ; continue with sensor 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5333
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5334 TFT_ppo2_sensors_2b:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5335 ; sensor has a valid calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5336 WIN_MEDIUM dm_custom_hud_sensor2_column,dm_custom_hud_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5337 movff sensor2_ppO2,lo ; load ppO2 value into transfer storage for output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5338 btfsc use_O2_sensor2 ; in use?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5339 bra TFT_ppo2_sensors_2d ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5340 tstfsz lo ; NO - sensor value = 0?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5341 bra TFT_ppo2_sensors_2c ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5342 FONT_COLOR_ATTENTION ; YES - print in attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5343 bra TFT_ppo2_sensors_2e ; - print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5344
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5345 TFT_ppo2_sensors_2c:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5346 ; sensor has valid calibration, is not in use and has a value > 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5347 FONT_COLOR_DISABLED ; output in light blue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5348 bra TFT_ppo2_sensors_2e ; print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5349
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5350 TFT_ppo2_sensors_2d:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5351 ; sensor has valid calibration and is in use
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5352 call TFT_color_code_ppo2_hud ; color-code with ppO2 [cbar] in lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5353 btfsc voting_logic_sensor2 ; sensor value agrees with values of other sensors?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5354 bra TFT_ppo2_sensors_2e ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5355 bsf win_invert ; NO - invert output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5356 ;bra TFT_ppo2_sensors_2e ; - print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5357
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5358 TFT_ppo2_sensors_2e:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5359 ; all coloring is set up now, let's write the value to the display!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5360 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5361 output_256 ; print (0.00-2.55)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5362 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5363
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5364 ; sensor 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5365 TFT_ppo2_sensors_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5366 btfsc sensor3_calibrated_ok ; valid calibration?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5367 bra TFT_ppo2_sensors_3b ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5368 btfsc sensor3_active ; NO - valid HUD data for this sensor?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5369 bra TFT_ppo2_sensors_3b ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5370 ;bra TFT_ppo2_sensors_3a ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5371
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5372 TFT_ppo2_sensors_3a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5373 WIN_STD dm_custom_hud_sensor3_column+.7, dm_custom_hud_row+.5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5374 FONT_COLOR_MEMO ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5375 STRCPY_PRINT "---" ; print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5376 bra TFT_ppo2_sensors_4 ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5377
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5378 TFT_ppo2_sensors_3b:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5379 ; sensor has a valid calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5380 WIN_MEDIUM dm_custom_hud_sensor3_column,dm_custom_hud_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5381 movff sensor3_ppO2,lo ; load ppO2 value into transfer storage for output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5382 btfsc use_O2_sensor3 ; in use?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5383 bra TFT_ppo2_sensors_3d ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5384 tstfsz lo ; NO - sensor value = 0?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5385 bra TFT_ppo2_sensors_3c ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5386 FONT_COLOR_ATTENTION ; YES - print in attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5387 bra TFT_ppo2_sensors_3e ; - print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5388
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5389 TFT_ppo2_sensors_3c:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5390 ; sensor has valid calibration, is not in use and has a value > 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5391 FONT_COLOR_DISABLED ; print in disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5392 bra TFT_ppo2_sensors_3e ; print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5393
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5394 TFT_ppo2_sensors_3d:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5395 ; sensor has valid calibration and is in use
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5396 call TFT_color_code_ppo2_hud ; color-code with ppO2 [cbar] in lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5397 btfsc voting_logic_sensor3 ; sensor value agrees with values other sensors?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5398 bra TFT_ppo2_sensors_3e ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5399 bsf win_invert ; NO - invert output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5400 ;bra TFT_ppo2_sensors_3e ; - print ppO2 value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5401
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5402 TFT_ppo2_sensors_3e:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5403 ; all coloring is set up now, let's write the value to the display!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5404 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5405 output_256 ; print (0.00-2.55)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5406 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5407
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5408 TFT_ppo2_sensors_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5409 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5410
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5411 ENDIF ; _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5412
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5413 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5414
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5415 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5416 ; Dive Custom View - Pressures & SAC - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5417 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5418 global TFT_pressures_SAC_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5419 TFT_pressures_SAC_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5420 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5421
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5422 ; pressure reading 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5423 WIN_TINY dm_custom_tankdata_pres1_col, dm_custom_tankdata_mask_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5424 movff char_I_pressure_gas+0,WREG ; =0: disabled, =1..10: gases/dils
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5425 bcf aux_flag ; selector for disabled / need set to disabled
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5426 rcall TFT_pressures_SAC_mask_h1 ; print gas composition or " ---" if disabled
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5427
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5428 ; pressure reading 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5429 WIN_TINY dm_custom_tankdata_pres2_col, dm_custom_tankdata_mask_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5430 movff char_I_pressure_gas+1,WREG ; =0: need to reading 1, =1..10: gases/dils
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5431 bsf aux_flag ; selector for disabled / need set to need
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5432 rcall TFT_pressures_SAC_mask_h1 ; print gas composition or "Need " if 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5433
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5434 ; SAC rate
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5435 WIN_TINY dm_custom_tankdata_SAC_col, dm_custom_tankdata_mask_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5436 STRCPY_TEXT tSAC ; "SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5437 STRCAT " (" ; (
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5438 STRCAT_TEXT tLitersMinute ; l/min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5439 PUTC_PRINT ")" ; )"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5440 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5441
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5442
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5443 ; Helper Function - print gas composition or " ---" if disabled
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5444 TFT_pressures_SAC_mask_h1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5445 tstfsz WREG ; pressure reading assigned?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5446 bra TFT_pressures_SAC_mask_h2 ; YES - print gas composition
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5447 btfsc aux_flag ; NO - check auxiliary flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5448 bra TFT_pressures_SAC_mask_h3 ; 1 - print "Need "
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5449 STRCAT_PRINT " ---" ; 0 - print " ---"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5450 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5451
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5452 TFT_pressures_SAC_mask_h2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5453 decf WREG,W ; (1..10) -> (0..9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5454 bsf short_gas_descriptions ; just "Air", "O2" or "xx/yy"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5455 call gaslist_strcat_mix_WREG ; print composition of gas/dil in WREG (0..9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5456 bra TFT_pressures_SAC_mask_h4 ; finish with adding "(bar)"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5457
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5458 TFT_pressures_SAC_mask_h3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5459 STRCPY_TEXT tNeed ; "Need"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5460 ;bra TFT_pressures_SAC_mask_h4 ; finish with adding "(bar)"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5461
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5462 TFT_pressures_SAC_mask_h4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5463 STRCAT_PRINT "(bar)" ; print "(bar)"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5464 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5465
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5466
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5467 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5468 ; Dive Custom View - Pressures & SAC - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5469 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5470 global TFT_pressures_SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5471 TFT_pressures_SAC:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5472 ; check mode for second reading
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5473 bcf aux_flag ; clear auxiliary flag by default (reading 2 is pressure)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5474 movff char_I_pressure_gas+1,WREG ; =0: need to reading 1, =1..10: gases/dils
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5475 addlw .0 ; dummy operation to set status register flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5476 btfsc STATUS,Z ; gas selected = 0 (i.e. no 2nd pressure reading) ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5477 bsf aux_flag ; YES - set auxiliary flag (display position of reading 2 shall show need to reading 1)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5478 ; get data of reading 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5479 movff int_IO_pressure_value+0,lo ; copy pressure 1 to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5480 movff int_IO_pressure_value+1,hi ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5481 movff char_I_pressure_stat+0,ex ; copy status data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5482 ; pressure of reading 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5483 WIN_STD dm_custom_tankdata_pres1_col+.4,dm_custom_tankdata_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5484 rcall TFT_pressures_SAC_helper_1 ; print pressure if available, else " ---"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5485 ; battery status of reading 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5486 WIN_SMALL dm_custom_hud_sensor1_column+.4+.36,dm_custom_tankdata_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5487 rcall TFT_pressures_SAC_helper_2 ; print or clear down arrow as low bat indicator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5488 ; get data for reading 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5489 btfsc aux_flag ; shall reading 2 show need to reading 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5490 bra TFT_pressures_SAC_1 ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5491 movff int_IO_pressure_value+2,lo ; NO - copy pressure 2 to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5492 movff int_IO_pressure_value+3,hi ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5493 movff char_I_pressure_stat+1,ex ; - copy status data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5494 bra TFT_pressures_SAC_2 ; - continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5495
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5496 TFT_pressures_SAC_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5497 MOVII int_O_pressure_need,mpr ; copy need to pressure 1 to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5498 clrf ex ; set status data to 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5499 bra TFT_pressures_SAC_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5500
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5501 TFT_pressures_SAC_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5502 ; pressure of reading 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5503 WIN_STD dm_custom_tankdata_pres2_col+.2,dm_custom_tankdata_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5504 rcall TFT_pressures_SAC_helper_1 ; print pressure if available, else " ---"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5505 ; battery status of reading 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5506 WIN_SMALL dm_custom_tankdata_pres2_col+.2+.36,dm_custom_tankdata_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5507 rcall TFT_pressures_SAC_helper_2 ; print or clear down arrow as low bat indicator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5508
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5509 TFT_pressures_SAC_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5510 ; SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5511 WIN_STD dm_custom_tankdata_SAC_col+.6,dm_custom_tankdata_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5512 MOVII int_O_SAC_measured,mpr ; copy measured SAC rate to hi:lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5513 btfsc hi,int_not_avail_flag ; SAC rate available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5514 bra TFT_pressures_SAC_4 ; NO - print " --.-"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5515 call TFT_color_code_pres_sac ; color-code the output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5516 bsf decimal_digit1 ; place a decimal point in front of digit 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5517 output_999 ; print (0.0-99.9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5518 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5519 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5520
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5521 TFT_pressures_SAC_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5522 FONT_COLOR_DISABLED ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5523 STRCAT_PRINT "--.-" ; output for no SAC data available
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5524 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5525
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5526
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5527 ; Helper Function - print pressure if available, else " ---"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5528 TFT_pressures_SAC_helper_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5529 btfss hi,int_not_avail_flag ; pressure available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5530 bra TFT_pressures_SAC_helper_1a ; YES - print pressure
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5531 FONT_COLOR_DISABLED ; NO - use disabled color as default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5532 ; btfsc ex,char_transmitter_lost ; - transmitter lost?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5533 ; FONT_COLOR_ATTENTION ; YES - use attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5534 STRCAT_PRINT " ---" ; - print " ---"
0
heinrichsweikamp
parents:
diff changeset
5535 return
heinrichsweikamp
parents:
diff changeset
5536
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5537 TFT_pressures_SAC_helper_1a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5538 btfsc hi,int_warning_flag ; out of range (signaled by warning flag)?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5539 bra TFT_pressures_SAC_helper_1c ; YES - special treatment
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5540 call TFT_color_code_pres_sac ; NO - color-code the output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5541 PUTC ' ' ; - add a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5542 bsf omit_digit_1 ; - do not print 1st digit (0.1 bar)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5543 output_999 ; - print pressure (0x-999x)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5544 PRINT ; - dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5545 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5546
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5547 TFT_pressures_SAC_helper_1c:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5548 call TFT_color_code_pres_sac ; color-code the output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5549 STRCPY_PRINT ">400" ; print ">400"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5550 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5551
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5552
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5553 ; Helper Function - print or clear down arrow as low bat indicator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5554 TFT_pressures_SAC_helper_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5555 btfss ex,char_transmitter_low_bat ; low battery flag set?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5556 bra TFT_pressures_SAC_helper_2b ; NO - clear down arrow (low bat indicator)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5557 ;bra TFT_pressures_SAC_helper_2a ; YES - show down arrow (low bat indicator)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5558
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5559 TFT_pressures_SAC_helper_2a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5560 FONT_COLOR_ATTENTION ; use attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5561 STRCPY_PRINT "\xb8" ; print down arrow as bat low indication
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5562 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5563
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5564 TFT_pressures_SAC_helper_2b:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5565 STRCPY_PRINT " " ; wipe out down arrow (low bat indicator)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5566 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5567
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5568 ENDIF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5569
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5570 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5571
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5572 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5573 ; Dive Custom View - Cave Mode TTS, total Stops and Run Time - Mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5574 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5575
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5576 global TFT_cave_tts_mask
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5577 TFT_cave_tts_mask:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5578 FONT_COLOR_MASK ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5579
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5580 WIN_TINY dm_custom_cave_title_column1,dm_custom_cave_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5581 STRCPY_TEXT_PRINT tCaveStops ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5582
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5583 WIN_TINY dm_custom_cave_title_column2,dm_custom_cave_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5584 STRCPY_TEXT_PRINT tCaveTTS ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5585
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5586 WIN_TINY dm_custom_cave_title_column3,dm_custom_cave_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5587 STRCPY_TEXT_PRINT tCaveRuntime ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5588
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5589 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5590
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5591
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5592 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5593 ; Dive Custom View - Cave Mode TTS, total Stops and Run Time - Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5594 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5595 global TFT_cave_tts
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5596 TFT_cave_tts:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5597 ; total time of all stops
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5598 WIN_MEDIUM dm_custom_cave_data_column1,dm_custom_cave_data_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5599 FONT_COLOR_MEMO ; set default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5600 btfss cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5601 bra TFT_cave_1b ; NO - print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5602 MOVII int_O_TST_norm,mpr ; YES - get normal plan total stops time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5603 btfss mpr+1,int_not_yet_computed ; - not yet computed?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5604 bra TFT_cave_1a ; NO - continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5605 FONT_COLOR_DISABLED ; YES - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5606 bra TFT_cave_1b ; - print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5607
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5608 TFT_cave_1a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5609 btfsc mpr+1,int_invalid_flag ; stops time invalid?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5610 FONT_COLOR_DISABLED ; YES - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5611 bcf mpr+1,int_invalid_flag ; clear invalid flag if applicable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5612 movf mpr+0,W ; copy low byte of stops time to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5613 iorwf mpr+1,W ; ior with high byte of stops time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5614 bz TFT_cave_1b ; print dashes if stops time is zero
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5615 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5616 PUTC_PRINT "'" ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5617 bra TFT_cave_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5618
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5619 TFT_cave_1b:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5620 STRCAT_PRINT ",-,-,-," ; print 3 dashes (',' produces a half-width space)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5621 ;bra TFT_cave_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5622
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5623 TFT_cave_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5624 ; cave TTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5625 WIN_MEDIUM dm_custom_cave_data_column2,dm_custom_cave_data_row ; column 60
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5626 FONT_COLOR_MEMO ; set default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5627 btfsS cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5628 bra TFT_cave_2b ; NO - print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5629 MOVII int_O_TTS_norm,mpr ; YES - get normal plan total time to surface
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5630 btfss mpr+1,int_not_yet_computed ; - not yet computed?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5631 bra TFT_cave_2a ; NO - continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5632 FONT_COLOR_DISABLED ; YES - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5633 bra TFT_cave_2b ; - print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5635 TFT_cave_2a:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5636 btfsc mpr+1,int_invalid_flag ; TTS invalid?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5637 FONT_COLOR_DISABLED ; YES - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5638 bcf mpr+1,int_invalid_flag ; clear invalid flag if applicable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5639 output_999 ; print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5640 PUTC_PRINT "'" ; append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5641 bra TFT_cave_3 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5642
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5643 TFT_cave_2b:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5644 STRCAT_PRINT ",-,-,-," ; print 3 dashes (',' produces a half-width space)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5645 ;bra TFT_cave_3 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5646
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5647 TFT_cave_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5648 ; estimated total runtime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5649 WIN_MEDIUM dm_custom_cave_data_column3,dm_custom_cave_data_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5650 ; ; keep color from cave TTS
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5651 btfss cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5652 bra TFT_cave_3b ; NO - print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5653 SMOVII counted_divetime_mins,mpr ; YES - ISR safe copy of counted dive time to MPR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5654 movff int_O_TTS_norm+0,WREG ; - get TTS, low byte, into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5655 addwf mpr+0,F ; - add TTS, low byte, to dive time in MPR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5656 movff int_O_TTS_norm+1,WREG ; - get TTS, high byte, into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5657 btfsc WREG,int_not_yet_computed ; - not yet computed?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5658 bra TFT_cave_3b ; YES - print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5659 bcf WREG,int_invalid_flag ; NO - clear invalid flag if applicable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5660 addwfc mpr+1,F ; - add TTS, high byte, to dive time in MPR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5661 output_999 ; - print (0-999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5662 PUTC_PRINT "'" ; - append unit and dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5663 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5664
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5665 TFT_cave_3b:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5666 STRCAT_PRINT ",-,-,-," ; print 3 dashes (',' produces a half-width space)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5667 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5668
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5669
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5670 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5671 ; Dive Custom View - Cave Mode Waypoints
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5672 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5673 global TFT_cave_waypoints
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5674 TFT_cave_waypoints:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5675 ; arrow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5676 WIN_TINY .70,dm_custom_cave_title_row
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5677 FONT_COLOR_ATTENTION ; select color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5678 btfss cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5679 bra TFT_cave_waypoints_3 ; NO - do not show any marker (any more)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5680 btfsc dive_turned ; YES - dive turned?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5681 bra TFT_cave_waypoints_2 ; YES - print marker in the middle
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5682 ;bra TFT_cave_waypoints_1 ; NO - print marker on right side
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5683
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5684 TFT_cave_waypoints_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5685 movlw .12 ; start with 12 space chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5686 call TFT_buffer_trim_length ; fill / cut buffer to target length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5687 ;bra TFT_cave_waypoints_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5688
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5689 TFT_cave_waypoints_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5690 STRCAT "<=====" ; print marker symbol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5691 ;bra TFT_cave_waypoints_3 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5692
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5693 TFT_cave_waypoints_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5694 movlw .18 ; set overall number of chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5695 call TFT_buffer_trim_length ; fill / cut buffer to target length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5696 PRINT ; dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5697 ; waypoint band
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5698 btfsc cave_mode ; cave mode switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5699 bra TFT_cave_waypoints_4 ; YES - show graphics
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5700 WIN_STD .0,dm_custom_cave_data_row ; NO - show "Cave Mode off" text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5701 FONT_COLOR_ATTENTION ; - select attention color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5702 PUTC " " ; - print 2 space chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5703 PUTC " " ; - ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5704 STRCAT_TEXT tCaveMode ; - print "Cave Mode"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5705 PUTC " " ; - print 1 space char
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5706 STRCAT_TEXT tOff ; - print "off"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5707 movlw .17 ; - set max number of chars
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5708 call TFT_buffer_trim_length ; - fill / cut buffer to target length
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5709 PRINT ; - dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5710 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5711
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5712 TFT_cave_waypoints_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5713 WIN_MEDIUM .0,dm_custom_cave_data_row; start in column 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5714 FONT_COLOR_MEMO ; select default color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5715 tstfsz DM_flags_cavereq ; any pending cave mode requests?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5716 FONT_COLOR_DISABLED ; YES - switch to disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5717 ; 1st section: previous waypoint number or beginning line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5718 movlw .1 ; load a one into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5719 cpfsgt backtrack_waypoint_num ; current waypoint number > 1 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5720 bra TFT_cave_waypoints_5 ; NO - print line segment only
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5721 STRCAT ",-," ; YES - print one dash
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5722 movff backtrack_waypoint_num,lo ; - copy current waypoint number to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5723 decf lo,F ; - create previous waypoint number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5724 output_99 ; - print previous waypoint number in two digit format
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5725 STRCAT "," ; - print a half-space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5726 bra TFT_cave_waypoints_6 ; - continue with next section
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5727
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5728 TFT_cave_waypoints_5:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5729 STRCAT ",-,-----" ; print line segment
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5730 ;bra TFT_cave_waypoints_6 ; continue with next section
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5731
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5732 TFT_cave_waypoints_6:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5733 ; 2nd section: solid line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5734 STRCAT "---" ; print a solid line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5735 ; 3rd section: current waypoint number, turn point symbol or line segment
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5736 tstfsz backtrack_waypoint_num ; does a current waypoint exist?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5737 bra TFT_cave_waypoints_8 ; YES - print its number or the turn point symbol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5738 btfss dive_turned ; NO - dive turned?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5739 bra TFT_cave_waypoints_7 ; NO - print a separated line segment
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5740 STRCAT "------" ; YES - print a continuous line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5741 bra TFT_cave_waypoints_10 ; - continue with next section
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5742
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5743 TFT_cave_waypoints_7:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5744 STRCAT ",----," ; print a separated line segment
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5745 bra TFT_cave_waypoints_10 ; continue with next section
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5746
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5747 TFT_cave_waypoints_8:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5748 STRCAT "," ; print a half-width space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5749 movff backtrack_waypoint_num,lo ; copy current waypoint number to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5750 movf backtrack_waypoint_turn,W ; copy turn point number to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5751 cpfseq lo ; current waypoint = turn point ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5752 bra TFT_cave_waypoints_9 ; NO - show waypoint number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5753 STRCAT_PRINT "--|, " ; YES - print end-of-line symbol, clear remaining output and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5754 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5755
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5756 TFT_cave_waypoints_9:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5757 movff backtrack_waypoint_num,lo ; copy current waypoint number to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5758 output_99 ; print current waypoint number in two digit format
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5759 STRCAT "," ; print a half-space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5760 ;bra TFT_cave_waypoints_10 ; continue with next section
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5761
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5762 TFT_cave_waypoints_10:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5763 ; 4th section: solid line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5764 STRCAT "---" ; print a solid line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5765 ; 5th section: next waypoint number or end of line symbol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5766 incf backtrack_waypoint_num,W ; load WREG with next waypoint number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5767 cpfseq backtrack_waypoint_turn ; next waypoint number = turn point number ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5768 btfsc waypoint_reached_last ; NO - is the current waypoint the last waypoint?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5769 bra TFT_cave_waypoints_11 ; YES / YES - print end-of-line symbol
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5770 STRCAT "," ; NO - print a half-space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5771 incf backtrack_waypoint_num,W ; - (re)load WREG with next waypoint number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5772 movwf lo ; NO - copy next waypoint number to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5773 output_99 ; - print next waypoint number in two digit format
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5774 PRINT ; - dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5775 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5776
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5777 TFT_cave_waypoints_11:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5778 STRCAT_PRINT "---|," ; print end-of-line symbol and dump buffer to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5779 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5780
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5781 ENDIF ; _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5782
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
5783
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
5784 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5785 tft_out15 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5786 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5787
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5788
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5789 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5790 ; Helper Function - check if firmware is within expiry period
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5791 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5792 ; Output: aux_flag set if not
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5793 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5794 check_expiry:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5795 SMOVSS rtc_year,rtc_latched_year ; ISR-safe 6 byte copy of date and time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5796 movff rtc_latched_day,lo ; get current day
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5797 movff rtc_latched_month,hi ; get current month
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5798 movff rtc_latched_year,up ; get current year
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5799 bsf aux_flag ; set firmware as expired by default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5800 movlw firmware_expire_year ; start with checking year
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5801 cpfsgt up ; current year > expiry year ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5802 bra check_expiry_Y ; NO - continue checks
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5803 return ; YES - expired
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5804
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5805 check_expiry_Y:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5806 cpfseq up ; current year = expiry year ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5807 bra check_expiry_ok ; NO - must be < then, OK whatever month & day
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5808 movlw firmware_expire_month ; YES - continue checking month
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5809 cpfsgt hi ; current month > expiry month ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5810 bra check_expiry_M ; NO - continue checks
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5811 return ; YES - expired
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5812
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5813 check_expiry_M:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5814 cpfseq hi ; current month = expiry month ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5815 bra check_expiry_ok ; NO - must be < then, OK whatever day
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5816 movlw firmware_expire_day ; YES - continue checking day
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5817 cpfsgt lo ; current day > expiry day ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5818 bra check_expiry_ok ; NO - must be <= then, OK
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5819 return ; YES - expired
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5820
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5821 check_expiry_ok:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5822 bcf aux_flag ; not expired
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5823 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5824
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5825
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5826 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5827 ; show Firmware updated Message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5828 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5829 ; Attention:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5830 ; Pallet colors and language switching are not
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5831 ; available yet, all text outputs are hard-coded!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5832 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5833 global TFT_message_fw_update
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5834 TFT_message_fw_update:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5835 FONT_COLOR_STANDARD ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5836
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5837 ; show update message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5838 WIN_SMALL .20,.100 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5839 STRCPY_PRINT "Update successful!" ; print message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5840
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5841 ; show firmware version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5842 WIN_SMALL .20,.140 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5843 STRCPY "New Firmware: " ; print message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5844
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5845 bra TFT_message_fw_common ; show firmware version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5846
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5847
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5848 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5849 ; show Firmware kept Message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5850 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5851 ; Attention:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5852 ; Pallet colors and language switching are not
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5853 ; available yet, all text outputs are hard-coded!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5854 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5855 global TFT_message_fw_kept
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5856 TFT_message_fw_kept:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5857 FONT_COLOR_STANDARD ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5858
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5859 ; show reboot message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5860 WIN_SMALL .60,.100 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5861 STRCPY_PRINT "Reboot" ; print message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5862
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5863 ; show firmware version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5864 WIN_SMALL .30,.140 ; set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5865 STRCPY "Firmware: " ; print message
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5866
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5867 ;bra TFT_message_fw_common ; show firmware version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5868
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5869
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5870 ; Helper Function - show firmware version x.y and color-code + invert if outdated
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5871 TFT_message_fw_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5872 rcall TFT_cat_firmware ; append major/minor and color-code on expiry
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5873 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5874 ; show firmware beta status
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5875 WIN_SMALL .60,.180
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5876 FONT_COLOR_STANDARD ; set default color for a release version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5877 rcall TFT_cat_beta_long ; show "Release" or "BETA" + issue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5878 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5879 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5880
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5881
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5882 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5883 ; append Firmware Version to current String, including color-coding on expiry
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5884 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5885 global TFT_cat_firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5886 TFT_cat_firmware:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5887 movlw fw_version_major ; get major
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5888 movwf lo ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5889 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5890 output_99 ; print major (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5891 PUTC '.' ; print a dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5892 movlw fw_version_minor ; get minor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5893 movwf lo ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5894 output_99x ; print minor in two digit format
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5895 rcall check_expiry ; check if firmware is expired
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5896 btfss aux_flag ; expired?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5897 return ; NO
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5898 bsf win_invert ; YES - print in inverse
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5899 FONT_COLOR color_yellow ; - print in yellow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5900 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5901
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5902
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5903 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5904 ; append Firmware BETA Status to current String, including color-coding on BETA
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5905 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5906 global TFT_cat_beta_long
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5907 TFT_cat_beta_long:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5908 bsf aux_flag ; do long version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5909 bra TFT_cat_beta_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5910
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5911 global TFT_cat_beta_short
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5912 TFT_cat_beta_short:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5913 bcf aux_flag ; do short version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5914 ;bra TFT_cat_beta_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5915
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5916 TFT_cat_beta_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5917
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5918 IFDEF _DEBUG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5919
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5920 FONT_COLOR color_red ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5921 btfss aux_flag ; shall show long version?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5922 bra TFT_cat_debug_short ; NO - show short version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5923 ;bra TFT_cat_debug_long ; YES - show long version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5924
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5925 TFT_cat_debug_long:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5926 STRCAT "DEBUG" ; print long debug
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5927 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5928
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5929 TFT_cat_debug_short:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5930 STRCAT "DBG." ; print short debug
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5931 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5932
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5933 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5934
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5935 movlw fw_version_beta ; =0: release, =1: beta 1, =2: beta 2, ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5936 movwf lo ; copy to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5937 tstfsz lo ; release version?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5938 bra TFT_cat_beta_com ; NO - must be beta version then
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5939 btfss aux_flag ; YES - shall show long version?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5940 bra TFT_cat_beta_rel_short ; NO - show short version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5941 rcall check_expiry ; YES - check expiry date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5942 btfsc aux_flag ; - within expiry date?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5943 bra TFT_cat_beta_update ; NO - give update cue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5944 ;bra TFT_cat_beta_rel_long ; YES - "Release"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5945
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5946 TFT_cat_beta_rel_long:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5947 STRCAT "Release" ; print long "Release"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5948 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5949
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5950 TFT_cat_beta_rel_short:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5951 STRCAT "Rel." ; print short "Release"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5952 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5953
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5954 TFT_cat_beta_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5955 FONT_COLOR color_yellow ; set color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5956 btfss aux_flag ; shall show long version?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5957 bra TFT_cat_beta_short_exec ; NO - show short version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5958 ;bra TFT_cat_beta_long_exec ; YES - show long version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5959
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5960 TFT_cat_beta_long_exec:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5961 STRCAT "Beta " ; print long "Beta"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5962 bra TFT_cat_beta_version ; print version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5963
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5964 TFT_cat_beta_short_exec:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5965 STRCAT "B." ; print short "Beta"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5966 ;bra TFT_cat_beta_version ; append beta version number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5967
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5968 TFT_cat_beta_version:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5969 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5970 output_256 ; print beta version number (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5971 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5972
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5973 TFT_cat_beta_update:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5974 FONT_COLOR color_yellow
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5975 STRCAT "update!" ; print update cue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5976 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5977
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5978 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5979
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5980
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5981 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5982 ; append Serial Number to to current String
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5983 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5984 global TFT_cat_serial
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5985 TFT_cat_serial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5986 call eeprom_serial_number_read ; read OSTC serial number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5987 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5988 output_65535 ; print serial number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5989 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5990
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5991
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5992 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5993 ; print Serial Number and Firmware Version (used by comm mode)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5994 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5995 global TFT_print_serial_and_firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5996 TFT_print_serial_and_firmware:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5997 STRCPY "#" ; print "#"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5998 rcall TFT_cat_serial ; print serial number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
5999 STRCAT " " ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6000 STRCAT "v" ; print a "v" (version)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6001 ;bra TFT_print_firmware ; print firmware version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6002
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6003
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6004 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6005 ; print Firmware Version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6006 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6007 global TFT_print_firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6008 TFT_print_firmware:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6009 rcall TFT_cat_firmware ; print firmware major/minor, will set win_invert if outdated
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6010 STRCAT " " ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6011 rcall TFT_cat_beta_long ; print release/beta and update notification if expired
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6012 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6013 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6014
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6015
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6016 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6017 ; print Deco Type (OC, CCR, ...)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6018 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6019 ; Input: lo deco type number: 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6020 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6021 global TFT_print_decotype
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6022 TFT_print_decotype:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6023 bsf aux_flag ; default to dive with deco calculation (used by logbook)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6024 incf lo,W ; WREG = lo + 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6025 TFT_print_decotype_1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6026 decfsz WREG,W ; in OC mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6027 bra TFT_print_decotype_2 ; NO - try next
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6028 STRCAT_TEXT_PRINT tDvOC ; YES - print "OC"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6029 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6030 TFT_print_decotype_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6031 decfsz WREG,W ; in CCR mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6032 bra TFT_print_decotype_3 ; NO - try next
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6033 STRCAT_TEXT_PRINT tDvCC ; YES - print "CCR"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6034 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6035 TFT_print_decotype_3:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6036 decfsz WREG,W ; in gauge mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6037 bra TFT_print_decotype_4 ; NO - try next
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6038 bcf aux_flag ; YES - dive without deco data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6039 STRCAT_TEXT_PRINT tDvGauge ; - Print "Gauge"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6040 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6041 TFT_print_decotype_4:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6042 decfsz WREG,W ; in apnea mode?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6043 bra TFT_print_decotype_5 ; NO - try next
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6044 bcf aux_flag ; YES - dive without deco data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6045 STRCAT_TEXT_PRINT tDvApnea ; - print "Apnoe"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6046 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6047 TFT_print_decotype_5:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6048 STRCAT_TEXT_PRINT tDvPSCR ; print "pSCR"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6049 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6050
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
6051
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
6052 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6053 tft_out16 CODE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6054 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6055
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6056 global TFT_debug_output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6057 TFT_debug_output:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6058
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6059 IFNDEF _debug_output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6060
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6061 return ; do nothing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6062
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6063 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6064
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6065 ; btfsc alt_layout_active ; alternative layout active?
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6066 ; return ; YES - abort
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6067
636
2737ddc643bb 3.11 release
heinrichsweikamp
parents: 635
diff changeset
6068 WIN_TINY .100,.30 ; surface mode: fits under the textual logo in the upper right corner
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6069 ; WIN_TINY .35, .0 ; dive mode: fits to the right side of the depth label
636
2737ddc643bb 3.11 release
heinrichsweikamp
parents: 635
diff changeset
6070 ; WIN_TINY .0, . 0 ; dive mode: overwrites depth label
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6071 FONT_COLOR_MEMO ; set color
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6072
645
070528a88715 3.16 release
heinrichsweikamp
parents: 643
diff changeset
6073 movff ambient_light+0,lo
643
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
6074 output_256
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
6075 PUTC ","
645
070528a88715 3.16 release
heinrichsweikamp
parents: 643
diff changeset
6076 movff ambient_light+0,lo
070528a88715 3.16 release
heinrichsweikamp
parents: 643
diff changeset
6077 movff ambient_light+1,hi
643
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
6078 output_65535
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
6079
7d8a4c60ec1a 3.15 release
heinrichsweikamp
parents: 640
diff changeset
6080
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6081
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6082 ; ; deco engine scheduling performance
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6083 ; MOVII int_O_profiling_overrun,mpr ; runtime +/- versus target
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6084 ; btfss mpr+1,7 ; overrun?
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6085 ; bra TFT_debug_output_1 ; YES
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6086 ; bcf mpr+1,7 ; NO - clear flag
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6087 ; PUTC "-" ; - print a minus
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6088 ; bra TFT_debug_output_2 ; - continue
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6089 ;TFT_debug_output_1:
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6090 ; PUTC " " ; print a space instead of the minus
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6091 ;TFT_debug_output_2:
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6092 ; output_999 ; print time (0-999)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6093 ; PUTC "." ; print a dot as separator
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6094 ; MOVII int_O_profiling_overrun_max,mpr ; get max runtime so far
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6095 ; output_999 ; print (0-999)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6096 ; PUTC "." ; print a dot as separator
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6097 ; movff char_O_profiling_overrun_phase,WREG ; get calculation phase causing the max runtime
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6098 ; output_hex ; print a hex
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6099 ; PUTC "." ; print a dot as separator
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6100 ; movff char_O_profiling_runs_norm,mpr ; get runs/cycle normal plan
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6101 ; output_99 ; print (0-99)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6102 ; PUTC "." ; print a dot as separator
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6103 ; movff char_O_profiling_runs_alt,mpr ; get runs/cycle alternative plan
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 636
diff changeset
6104 ; output_99 ; print (0-99)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6105 PRINT ; dump to screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6106 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6107
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6108 ENDIF ; _debug_output
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6109
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6110 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6111
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 633
diff changeset
6112 END