comparison code_part1/OSTC_code_asm_part1/customview.asm @ 150:fc699a7460e6

Fix desat graph: + clean right part, to allow decreasing animation. + In divemode, show every 10 seconds.
author JeanDo
date Mon, 10 Jan 2011 02:57:59 +0100
parents e6aa4a74c3c2
children a728b4a1b660
comparison
equal deleted inserted replaced
149:55a763d514ed 150:fc699a7460e6
88 customview_1sec_clock: ; Do nothing extra 88 customview_1sec_clock: ; Do nothing extra
89 customview_1sec_lead_tiss: ; Do nothing extra 89 customview_1sec_lead_tiss: ; Do nothing extra
90 return 90 return
91 91
92 customview_1sec_graphs: ; Do nothing extra 92 customview_1sec_graphs: ; Do nothing extra
93 return 93 decfsz apnoe_mins ; 10 sec passed ?
94 94 return ; No: skip.
95 ;============================================================================= 95 movlw .10 ; Yes: reset counter.
96 ; Do every-minute tasks for the custom view area 96 movwf apnoe_mins
97 97
98 customview_minute:
99 movff menupos3,WREG ; copy
100 dcfsnz WREG,F
101 bra customview_minute_stopwatch ; Update the Stopwatch
102 dcfsnz WREG,F
103 bra customview_minute_marker ; Update the Marker
104 dcfsnz WREG,F
105 bra customview_minute_clock ; Update the Clock
106 dcfsnz WREG,F
107 bra customview_minute_lead_tiss ; Update the leading tissue
108 dcfsnz WREG,F
109 bra customview_minute_average ; Update the Average depth
110 dcfsnz WREG,F
111 bra customview_minute_graphs ; Update the graphs
112 ; Menupos3=0, do nothing
113 return
114
115 customview_minute_clock:
116 call PLED_diveclock2 ; Update the clock
117 return
118
119 customview_minute_lead_tiss:
120 call PLED_show_leading_tissue_2 ; Update the leading tissue
121 return
122
123 customview_minute_graphs:
124 call deco_calc_desaturation_time ; calculate desaturation time 98 call deco_calc_desaturation_time ; calculate desaturation time
125 movlb b'00000001' ; select ram bank 1 99 movlb b'00000001' ; select ram bank 1
126 call PLED_tissue_saturation_graph 100 call PLED_tissue_saturation_graph
127 return 101 return
128 102
103 ;=============================================================================
104 ; Do every-minute tasks for the custom view area
105
106 customview_minute:
107 movff menupos3,WREG ; copy
108 dcfsnz WREG,F
109 bra customview_minute_stopwatch ; Update the Stopwatch
110 dcfsnz WREG,F
111 bra customview_minute_marker ; Update the Marker
112 dcfsnz WREG,F
113 bra customview_minute_clock ; Update the Clock
114 dcfsnz WREG,F
115 bra customview_minute_lead_tiss ; Update the leading tissue
116 dcfsnz WREG,F
117 bra customview_minute_average ; Update the Average depth
118 dcfsnz WREG,F
119 bra customview_minute_graphs ; Update the graphs
120 ; Menupos3=0, do nothing
121 return
122
123 customview_minute_clock:
124 call PLED_diveclock2 ; Update the clock
125 return
126
127 customview_minute_lead_tiss:
128 call PLED_show_leading_tissue_2 ; Update the leading tissue
129 return
130
129 customview_minute_marker: ; Do nothing extra 131 customview_minute_marker: ; Do nothing extra
130 customview_minute_stopwatch: ; Do nothing extra 132 customview_minute_stopwatch: ; Do nothing extra
131 customview_minute_average: ; Do nothing extra 133 customview_minute_average: ; Do nothing extra
134 customview_minute_graphs:
132 return 135 return
133 136
134 ;============================================================================= 137 ;=============================================================================
135 ; Yes, show next customview (and delete this flag) 138 ; Yes, show next customview (and delete this flag)
136 139
179 customview_init_marker: ; Init Marker 182 customview_init_marker: ; Init Marker
180 GETCUSTOM8 d'50' ; Show Marker? (=1 in WREG) 183 GETCUSTOM8 d'50' ; Show Marker? (=1 in WREG)
181 decfsz WREG,F ; WREG=1? 184 decfsz WREG,F ; WREG=1?
182 bra customview_toggle ; No, use next Customview 185 bra customview_toggle ; No, use next Customview
183 186
184 call PLED_standard_color 187 call PLED_standard_color
185 DISPLAYTEXT d'151' ; Set Marker? 188 DISPLAYTEXT d'151' ; Set Marker?
186 bra customview_toggle_exit 189 bra customview_toggle_exit
187 190
188 customview_init_clock: ; Init Clock 191 customview_init_clock: ; Init Clock
189 call PLED_diveclock 192 call PLED_diveclock
190 bra customview_toggle_exit 193 bra customview_toggle_exit
191 194
192 customview_init_lead_tissue: ; Show leading tissue 195 customview_init_lead_tissue: ; Show leading tissue
193 GETCUSTOM8 d'53' ; Show Lead Tissue? (=1 in WREG) 196 GETCUSTOM8 d'53' ; Show Lead Tissue? (=1 in WREG)
194 decfsz WREG,F ; WREG=1? 197 decfsz WREG,F ; WREG=1?
195 bra customview_toggle ; No, use next Customview 198 bra customview_toggle ; No, use next Customview
196 199
197 btfsc no_deco_customviews ; no-deco-mode-flag = 1 200 btfsc no_deco_customviews ; no-deco-mode-flag = 1
198 bra customview_toggle ; Yes, use next Customview! 201 bra customview_toggle ; Yes, use next Customview!
199 202
200 call PLED_show_leading_tissue 203 call PLED_show_leading_tissue
201 bra customview_toggle_exit 204 bra customview_toggle_exit
202 205
203 customview_init_graphs: ; Show tissue graph 206 customview_init_graphs: ; Show tissue graph
204 GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG) 207 GETCUSTOM8 d'52' ; Show Tissue Graph? (=1 in WREG)
205 decfsz WREG,F ; WREG=1? 208 decfsz WREG,F ; WREG=1?
206 bra customview_toggle ; No, use next Customview 209 bra customview_toggle ; No, use next Customview
207 210
208 btfsc no_deco_customviews ; no-deco-mode-flag = 1 211 btfsc no_deco_customviews ; no-deco-mode-flag = 1
209 bra customview_toggle ; Yes, use next Customview! 212 bra customview_toggle ; Yes, use next Customview!
210 213
211 call deco_calc_desaturation_time ; calculate desaturation time 214 movlw .1 ; Draw next second.
212 movlb b'00000001' ; select ram bank 1 215 movwf apnoe_mins ; 10sec counter.
213 call PLED_tissue_saturation_graph 216
214 bra customview_toggle_exit 217 call deco_calc_desaturation_time ; calculate desaturation time
218 movlb b'00000001' ; select ram bank 1
219 call PLED_tissue_saturation_graph
220
221 bra customview_toggle_exit
222
215 customview_toggle_exit: 223 customview_toggle_exit:
216 bcf toggle_customview ; Clear flag 224 bcf toggle_customview ; Clear flag
217 ostc_debug 'Y' ; Sends debug-information to screen in debugmode 225 ostc_debug 'Y' ; Sends debug-information to screen in debugmode
218 return 226 return
219 227
320 bra surfcustomview_minute_cfview ; Update the critical cf view 328 bra surfcustomview_minute_cfview ; Update the critical cf view
321 ; Menupos3=0, do nothing 329 ; Menupos3=0, do nothing
322 return 330 return
323 331
324 surfcustomview_minute_graphs: 332 surfcustomview_minute_graphs:
325 call PLED_tissue_saturation_graph ; Draw/Update the graphs 333 call deco_calc_desaturation_time ; calculate desaturation time
334 movlb b'00000001' ; select ram bank 1
335 call PLED_tissue_saturation_graph ; Draw/Update the graphs
326 return 336 return
327 337
328 surfcustomview_minute_interval: 338 surfcustomview_minute_interval:
329 DISPLAYTEXT d'189' ; Surface 339 DISPLAYTEXT d'189' ; Surface
330 DISPLAYTEXT d'240' ; Interval: 340 DISPLAYTEXT d'240' ; Interval: