annotate src/tft_outputs.asm @ 574:b8f45b57302d

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