comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 104:2a2606e9db5f

some fixes with the onboard simulator
author heinrichsweikamp
date Wed, 15 Dec 2010 11:01:35 +0100
parents 39d325b2a5f9
children a2b9eca1f396
comparison
equal deleted inserted replaced
103:fe195f766014 104:2a2606e9db5f
146 bcf switch_right 146 bcf switch_right
147 bsf menubit ; Enter Divemode-Menu! 147 bsf menubit ; Enter Divemode-Menu!
148 bcf premenu ; clear premenu flag 148 bcf premenu ; clear premenu flag
149 clrf timeout_counter3 149 clrf timeout_counter3
150 150
151 ; btfsc display_see_l_tissue ; Is the leading tissue info screen active
152 ; bra divemenu_see_leading_tissue2; Yes, quit menu
153
154 btfsc display_set_gas ; Are we in the "Gaslist" or "SetPoint" menu? 151 btfsc display_set_gas ; Are we in the "Gaslist" or "SetPoint" menu?
155 bra divemenu_set_gas2 ; Yes, so set gas and exit menu 152 bra divemenu_set_gas2 ; Yes, so set gas and exit menu
156 153
157 btfsc display_see_deco ; Is the Decoplan displayed? 154 btfsc display_see_deco ; Is the Decoplan displayed?
158 bra divemenu_see_decoplan2 ; Yes, exit menu on right button press 155 bra divemenu_see_decoplan2 ; Yes, exit menu on right button press
159
160 btfsc display_set_graphs ; Is the Graph displayed?
161 bra divemode_set_graphs2 ; Yes, exit menu on right button press
162 156
163 btfsc display_set_xgas ; Are we in the "Set Gas" menu? 157 btfsc display_set_xgas ; Are we in the "Set Gas" menu?
164 bra divemenu_set_xgas2 ; Yes, so configure gas or set menu and exit menu 158 bra divemenu_set_xgas2 ; Yes, so configure gas or set menu and exit menu
165 159
166 btfsc display_set_simulator ; Are we in the Divemode Simulator menu? 160 btfsc display_set_simulator ; Are we in the Divemode Simulator menu?
276 divemode_menu_simulator: 270 divemode_menu_simulator:
277 bsf menubit ; Enter Divemode-Menu! 271 bsf menubit ; Enter Divemode-Menu!
278 bcf premenu ; clear premenu flag 272 bcf premenu ; clear premenu flag
279 bcf switch_right 273 bcf switch_right
280 bcf switch_left ; Left button pressed! 274 bcf switch_left ; Left button pressed!
281 bsf display_set_simulator ; Set Flag 275 bsf display_set_simulator ; Set Flag
276 bsf menu3_active ; So "+1" is accessible at all times
282 call PLED_clear_divemode_menu ; Clear Menu 277 call PLED_clear_divemode_menu ; Clear Menu
283 call PLED_divemode_simulator_mask; Show mask 278 call PLED_divemode_simulator_mask; Show mask
284 movlw d'1' 279 movlw d'1'
285 movwf menupos ; reset cursor 280 movwf menupos ; reset cursor
286 call PLED_divemenu_cursor ; update cursor 281 call PLED_divemenu_cursor ; update cursor
370 subwfb sim_pressure+1,F 365 subwfb sim_pressure+1,F
371 movlw d'3' 366 movlw d'3'
372 movwf menupos ; reset cursor 367 movwf menupos ; reset cursor
373 bra divemode_menu_simulator_common 368 bra divemode_menu_simulator_common
374 369
375 divemode_set_graphs:
376 bsf display_set_graphs ; set flag
377 call PLED_clear_divemode_menu ; Clear Menu
378 call deco_main_calc_desaturation_time ; calculate desaturation time
379 movlb b'00000001' ; select ram bank 1
380 call PLED_saturation_graph_divemode ; Display saturation graph
381 return
382
383 divemode_set_graphs2:
384 bcf display_set_graphs ; clear flag
385 bra timeout_divemenu2 ; quit menu!
386
387 divemenu_see_decoplan: 370 divemenu_see_decoplan:
388 bsf display_see_deco ; set flag 371 bsf display_see_deco ; set flag
389 call PLED_clear_divemode_menu ; Clear Menu 372 call PLED_clear_divemode_menu ; Clear Menu
390 373
391 read_int_eeprom d'34' 374 read_int_eeprom d'34'
393 cpfsgt EEDATA ; in multi-gf mode? Z16 GF OC=4 and Z16 GF CC=5 376 cpfsgt EEDATA ; in multi-gf mode? Z16 GF OC=4 and Z16 GF CC=5
394 bra divemenu_see_decoplan1 ; No, standard ZH-L16 377 bra divemenu_see_decoplan1 ; No, standard ZH-L16
395 378
396 bsf multi_gf_display ; Yes, display the multi-gf table screen 379 bsf multi_gf_display ; Yes, display the multi-gf table screen
397 bcf last_ceiling_gf_shown ; Clear flag 380 bcf last_ceiling_gf_shown ; Clear flag
398
399 ; movff char_O_deco_status,deco_status ;
400 ; tstfsz deco_status ; deco_status=0 if decompression calculation done
401 ; return ; calculation not yet finished!
402 381
403 call PLED_decoplan_gf_page1 ; Display the new screen 382 call PLED_decoplan_gf_page1 ; Display the new screen
404 return 383 return
405 384
406 divemenu_see_decoplan1: 385 divemenu_see_decoplan1:
692 btfsc dekostop_active 671 btfsc dekostop_active
693 call PLED_display_deko_mask 672 call PLED_display_deko_mask
694 call customview_mask ; Redraw current customview mask 673 call customview_mask ; Redraw current customview mask
695 clrf timeout_counter3 ; Also clear timeout 674 clrf timeout_counter3 ; Also clear timeout
696 bcf display_see_deco ; clear all display flags 675 bcf display_see_deco ; clear all display flags
697 ; bcf display_see_l_tissue
698 bcf display_set_gas 676 bcf display_set_gas
699 bcf display_set_graphs
700 bcf display_set_xgas 677 bcf display_set_xgas
701 bcf display_set_setpoint 678 bcf display_set_setpoint
702 bcf display_set_simulator 679 bcf display_set_simulator
703 bcf switch_left ; and debounce switches 680 bcf switch_left ; and debounce switches
704 bcf switch_right 681 bcf switch_right
716 timeout_divemenu6: 693 timeout_divemenu6:
717 ; Update Simulator Mask 694 ; Update Simulator Mask
718 call PLED_divemode_simulator_mask; Show mask 695 call PLED_divemode_simulator_mask; Show mask
719 call PLED_divemenu_cursor ; update cursor 696 call PLED_divemenu_cursor ; update cursor
720 bra timeout_divemenu1 ; Check timeout 697 bra timeout_divemenu1 ; Check timeout
721
722 ;timeout_divemenu7:
723 ; ; Update Leading tissue infos
724 ; call PLED_show_leading_tissue ; Update infos about leading tissue
725 ; bra timeout_divemenu1 ; Check timeout