comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 576:ab2686087bce

faster font display, code cleaning
author heinrichsweikamp
date Sun, 22 Apr 2012 14:38:10 +0200
parents 67ab3c028bc2
children f3735da18809
comparison
equal deleted inserted replaced
575:cbdcbbc91877 576:ab2686087bce
30 btfsc switch_left 30 btfsc switch_left
31 bra test_switches_divemode2 31 bra test_switches_divemode2
32 32
33 btfss switch_right 33 btfss switch_right
34 return 34 return
35 35
36 bcf switch_left ; Left button pressed! 36 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
37 bcf switch_right
38 37
39 bcf select_bailoutgas ; Clear Flag for Bailout list 38 bcf select_bailoutgas ; Clear Flag for Bailout list
40 39
41 btfsc premenu ; Pre-Menu? already shown? 40 btfsc premenu ; Pre-Menu? already shown?
42 bra test_switches_divemode0 ; Yes, check if we should jump to menu Entry3 41 bra test_switches_divemode0 ; Yes, check if we should jump to menu Entry3
66 test_switches_divemode1: 65 test_switches_divemode1:
67 DISPLAYTEXT .141 ;Quit? 66 DISPLAYTEXT .141 ;Quit?
68 return 67 return
69 68
70 test_switches_divemode2: 69 test_switches_divemode2:
71 bcf switch_left ; Also reactivate left button if there was a right press without prior left press 70 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
72 bcf switch_right ; enable right button again
73 71
74 btfsc premenu 72 btfsc premenu
75 bra test_switches_divemode2_2 73 bra test_switches_divemode2_2
76 btfsc menubit 74 btfsc menubit
77 bra test_switches_divemode2_2 ; Not in Premenu or Menu... 75 bra test_switches_divemode2_2 ; Not in Premenu or Menu...
99 bcf premenu ; clear premenu flag 97 bcf premenu ; clear premenu flag
100 call PLED_clear_divemode_menu ; Clear dive mode menu area 98 call PLED_clear_divemode_menu ; Clear dive mode menu area
101 call PLED_divemode_menu_mask_first ; Write Divemode menu1 mask 99 call PLED_divemode_menu_mask_first ; Write Divemode menu1 mask
102 bcf display_set_simulator ; Clear Simulator-Menu flag 100 bcf display_set_simulator ; Clear Simulator-Menu flag
103 call PLED_divemenu_cursor ; show cursor 101 call PLED_divemenu_cursor ; show cursor
104 bcf switch_right 102 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
105 bcf switch_left ; Left button pressed!
106 return 103 return
107 104
108 test_switches_divemode_menu: 105 test_switches_divemode_menu:
109 btfsc uart_dump_screen ; Asked to dump screen contains ? 106 btfsc uart_dump_screen ; Asked to dump screen contains ?
110 call dump_screen ; Yes! 107 call dump_screen ; Yes!
159 btfsc display_set_gas ; In Gaslist or Setpoint list menu? 156 btfsc display_set_gas ; In Gaslist or Setpoint list menu?
160 call PLED_show_change_depth ; Yes, show change depth for gas #menupos 157 call PLED_show_change_depth ; Yes, show change depth for gas #menupos
161 return 158 return
162 159
163 test_switches_divemode_menu3: 160 test_switches_divemode_menu3:
164 bcf switch_left 161 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
165 bcf switch_right
166 bsf menubit ; Enter Divemode-Menu! 162 bsf menubit ; Enter Divemode-Menu!
167 bcf premenu ; clear premenu flag 163 bcf premenu ; clear premenu flag
168 clrf timeout_counter3 164 clrf timeout_counter3
169 165
170 btfsc display_set_gas ; Are we in the "Gaslist" or "SetPoint" menu? 166 btfsc display_set_gas ; Are we in the "Gaslist" or "SetPoint" menu?
337 return 333 return
338 334
339 divemode_menu_simulator: 335 divemode_menu_simulator:
340 bsf menubit ; Enter Divemode-Menu! 336 bsf menubit ; Enter Divemode-Menu!
341 bcf premenu ; clear premenu flag 337 bcf premenu ; clear premenu flag
342 bcf switch_right 338 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
343 bcf switch_left ; Left button pressed!
344 bsf display_set_simulator ; Set Flag 339 bsf display_set_simulator ; Set Flag
345 bsf menu3_active ; So "+1" is accessible at all times 340 bsf menu3_active ; So "+1" is accessible at all times
346 call PLED_clear_divemode_menu ; Clear Menu 341 call PLED_clear_divemode_menu ; Clear Menu
347 call PLED_divemode_simulator_mask; Show mask 342 call PLED_divemode_simulator_mask; Show mask
348 movlw d'1' 343 movlw d'1'
740 bcf display_set_xgas 735 bcf display_set_xgas
741 bcf display_set_setpoint 736 bcf display_set_setpoint
742 bcf display_set_simulator 737 bcf display_set_simulator
743 bcf display_set_active 738 bcf display_set_active
744 bcf menu3_active 739 bcf menu3_active
745 bcf switch_left ; and debounce switches 740 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
746 bcf switch_right
747 return 741 return
748 742
749 ; Re-Draw current page of decoplan (may have more stops) 743 ; Re-Draw current page of decoplan (may have more stops)
750 timeout_divemenu3: 744 timeout_divemenu3:
751 movff char_O_deco_status,WREG ; Get last computation state (BANK safe) 745 movff char_O_deco_status,WREG ; Get last computation state (BANK safe)