Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/surfmode.asm @ 497:06db5dd9149f
show numeric _and_ graphic velocity, move desat, nofly and interval into isr
author | heinrichsweikamp |
---|---|
date | Wed, 09 Nov 2011 16:17:11 +0100 |
parents | a5235ae970af |
children | 2ac77db9c150 |
comparison
equal
deleted
inserted
replaced
496:97d3f5537b43 | 497:06db5dd9149f |
---|---|
215 ; call PLED_active_gas_surfmode ; Show start gas / SetPoint | 215 ; call PLED_active_gas_surfmode ; Show start gas / SetPoint |
216 call update_date ; and date in divemode | 216 call update_date ; and date in divemode |
217 call calc_deko_surfmode ; calculate desaturation every minute | 217 call calc_deko_surfmode ; calculate desaturation every minute |
218 call check_temp_extrema ; check for new temperature extremas | 218 call check_temp_extrema ; check for new temperature extremas |
219 call PLED_custom_text ; Displays custom text | 219 call PLED_custom_text ; Displays custom text |
220 call calc_surface_interval ; Increases Surface-Interval time | |
221 call surfcustomview_minute ; Do every-minute tasks for the custom view area | 220 call surfcustomview_minute ; Do every-minute tasks for the custom view area |
222 | 221 |
223 btfsc gauge_mode ; Ignore in gauge mode | 222 btfsc gauge_mode ; Ignore in gauge mode |
224 bra update_surfloop60_2 | 223 bra update_surfloop60_2 |
225 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode | 224 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode |
231 call PLED_desaturation_time ; display desaturation time | 230 call PLED_desaturation_time ; display desaturation time |
232 btfsc premenu ; Not when "Menu?" is displayed! | 231 btfsc premenu ; Not when "Menu?" is displayed! |
233 bra update_surfloop60_2 | 232 bra update_surfloop60_2 |
234 | 233 |
235 update_surfloop60_2: | 234 update_surfloop60_2: |
236 call nofly_timeout60 ; checks if nofly time is > 0 | |
237 bcf oneminupdate | 235 bcf oneminupdate |
238 return | |
239 | |
240 nofly_timeout60: | |
241 movf desaturation_time_buffer+0,W; Is Desat null ? | |
242 iorwf desaturation_time_buffer+1,W | |
243 rcall nofly_timeout60_0 ; No... | |
244 | |
245 movf nofly_time+0,W ; Is nofly null ? | |
246 iorwf nofly_time+1,W | |
247 bnz nofly_timeout60_1 ; No... | |
248 | |
249 bcf nofly_active ; Clear flag | |
250 bcf LED_blue ; Clear led. | |
251 return | |
252 | |
253 nofly_timeout60_0: | |
254 movlw d'1' | |
255 subwf desaturation_time_buffer+0,F | |
256 movlw d'0' | |
257 subwfb desaturation_time_buffer+1,F ; reduce by one | |
258 return | |
259 | |
260 nofly_timeout60_1: | |
261 bsf nofly_active ; Set flag | |
262 movlw d'1' | |
263 subwf nofly_time+0,F | |
264 movlw d'0' | |
265 subwfb nofly_time+1,F ; reduce by one | |
266 return | |
267 | |
268 calc_surface_interval: | |
269 movff int_O_desaturation_time+0,lo ; divide by 60... | |
270 movff int_O_desaturation_time+1,hi | |
271 tstfsz lo ;=0? | |
272 bra calc_surface_interval2 ; No | |
273 tstfsz hi ;=0? | |
274 bra calc_surface_interval2 ; No | |
275 clrf surface_interval+0 | |
276 clrf surface_interval+1 ; Clear surface interval timer | |
277 return | |
278 | |
279 calc_surface_interval2: ; Increase surface interval timer | |
280 movlw d'1' | |
281 addwf surface_interval+0,F | |
282 movlw d'0' | |
283 addwfc surface_interval+1,F | |
284 return | 236 return |
285 | 237 |
286 set_leds_surfmode: | 238 set_leds_surfmode: |
287 btfsc nofly_active | 239 btfsc nofly_active |
288 btg LED_blue | 240 btg LED_blue |