comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 263:27c9bb14b008

making the seconds display in divemode smoother...
author heinrichsweikamp
date Mon, 11 Apr 2011 11:47:00 +0200
parents f8f869bafd92
children a728b4a1b660
comparison
equal deleted inserted replaced
262:a9f8c87dda06 263:27c9bb14b008
48 ; Startup Tasks for deco modes 48 ; Startup Tasks for deco modes
49 call PLED_display_ndl_mask ; display "no stop" if not in gauge or apnoe mode 49 call PLED_display_ndl_mask ; display "no stop" if not in gauge or apnoe mode
50 50
51 diveloop_loop: ; The diveloop starts here 51 diveloop_loop: ; The diveloop starts here
52 btfss onesecupdate ; tasks any new second 52 btfss onesecupdate ; tasks any new second
53 bra diveloop_loop2 53 bra diveloop_loop3
54 54
55 btfsc gauge_mode ; Only in gauge mode 55 btfsc gauge_mode ; Only in gauge mode
56 bra diveloop_loop1a ; One Second Tasks in Gauge mode 56 bra diveloop_loop1a ; One Second Tasks in Gauge mode
57 btfsc FLAG_apnoe_mode ; Only in apnoe mode 57 btfsc FLAG_apnoe_mode ; Only in apnoe mode
58 bra diveloop_loop1b ; One Second Tasks in Apnoe mode 58 bra diveloop_loop1b ; One Second Tasks in Apnoe mode
69 btfss premenu ; Is the divemode menu active? 69 btfss premenu ; Is the divemode menu active?
70 call PLED_divemins ; display (new) divetime! 70 call PLED_divemins ; display (new) divetime!
71 call timeout_divemode ; dive finished? This routine sets the required flags 71 call timeout_divemode ; dive finished? This routine sets the required flags
72 72
73 btfsc twosecupdate ; two seconds after the last call 73 btfsc twosecupdate ; two seconds after the last call
74 bra diveloop_loop1a2 ; Common Tasks 74 bra diveloop_loop1a2 ; Common Tasks
75 75
76 bsf twosecupdate ; Routines used in the "other second" 76 bsf twosecupdate ; Routines used in the "other second"
77 call calc_average_depth ; calculate average depth 77 call calc_average_depth ; calculate average depth
78 78
79 bra diveloop_loop1x ; Common Tasks 79 bra diveloop_loop1x ; Common Tasks
80 80
81 diveloop_loop1a2: 81 diveloop_loop1a2:
82 bcf twosecupdate 82 bcf twosecupdate
96 96
97 bra diveloop_loop1x ; Common Tasks 97 bra diveloop_loop1x ; Common Tasks
98 98
99 ; Common Tasks for all modes 99 ; Common Tasks for all modes
100 diveloop_loop1x: 100 diveloop_loop1x:
101 call customview_second ; Do every-second tasks for the custom view area
102
103 GETCUSTOM8 d'38' ; Show seconds (=1?)
104 movwf lo
105 movlw d'1'
106 cpfseq lo ; =1?
107 bra diveloop_loop1y ; No, minutes only
108 bsf update_divetime ; Set Update flag
109 diveloop_loop1y:
110 btfss update_divetime ; display new divetime?
111 bra diveloop_loop1z ; No
112 btfsc premenu ; Is the divemode menu active?
113 bra diveloop_loop1z ; Yes
114 call PLED_divemins ; Display (new) divetime!
115
116 diveloop_loop1z
117 bcf update_divetime ; clear flag
118
119 btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode
120 call PLED_const_ppO2_value ; display const ppO2 setting in [Bar]
121 btfsc ppO2_show_value ; show ppO2?
122 call check_ppO2 ; check ppO2 and displays warning if required
123
101 call timeout_divemode ; dive finished? This routine sets the required flags 124 call timeout_divemode ; dive finished? This routine sets the required flags
102 btfsc low_battery_state ; If battery is low, then... 125 btfsc low_battery_state ; If battery is low, then...
103 call update_batt_voltage_divemode ; Display Battery Warning Text 126 call update_batt_voltage_divemode ; Display Battery Warning Text
104 btfsc premenu ; is Menu? displayed? 127 btfsc premenu ; is Menu? displayed?
105 call timeout_premenu_divemode ; No, so check for timeout premenu 128 call timeout_premenu_divemode ; No, so check for timeout premenu
106 btfsc menubit ; is the Dive mode menu displayed? 129 btfsc menubit ; is the Dive mode menu displayed?
107 call timeout_divemenu ; Yes, so check for timeout divemenu 130 call timeout_divemenu ; Yes, so check for timeout divemenu
108 call set_leds_divemode ; Sets warnings, if required. Also Sets buzzer 131 call set_leds_divemode ; Sets warnings, if required. Also Sets buzzer
109 btfsc enter_error_sleep ; Enter Fatal Error Routine? 132 btfsc enter_error_sleep ; Enter Fatal Error Routine?
110 call fatal_error_sleep ; Yes (In Sleepmode_vxx.asm!) 133 call fatal_error_sleep ; Yes (In Sleepmode_vxx.asm!)
111 call customview_second ; Do every-second tasks for the custom view area
112 134
113 bcf onesecupdate ; one seconds update done 135 bcf onesecupdate ; one seconds update done
114 136
115 GETCUSTOM8 d'38' ; Show seconds (=1?) 137 ; GETCUSTOM8 d'38' ; Show seconds (=1?)
116 movwf lo 138 ; movwf lo
117 movlw d'1' 139 ; movlw d'1'
118 cpfseq lo ; =1? 140 ; cpfseq lo ; =1?
119 bra diveloop_loop2 ; No, minutes only 141 ; bra diveloop_loop2 ; No, minutes only
120 bsf update_divetime ; Set Update flag 142 ; bsf update_divetime ; Set Update flag
121 143 ;
122 144 ;
123 diveloop_loop2: 145 ;diveloop_loop2:
124 btfss update_divetime ; display new divetime? 146 ; btfss update_divetime ; display new divetime?
125 bra diveloop_loop3 ; No 147 ; bra diveloop_loop3 ; No
126 btfsc premenu ; Is the divemode menu active? 148 ; btfsc premenu ; Is the divemode menu active?
127 bra diveloop_loop2a ; Yes 149 ; bra diveloop_loop2a ; Yes
128 call PLED_divemins ; Display (new) divetime! 150 ; call PLED_divemins ; Display (new) divetime!
129 btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode 151 ; btfsc FLAG_const_ppO2_mode ; only in const_ppO2_mode
130 call PLED_const_ppO2_value ; display const ppO2 setting in [Bar] 152 ; call PLED_const_ppO2_value ; display const ppO2 setting in [Bar]
131 btfsc ppO2_show_value ; show ppO2? 153 ; btfsc ppO2_show_value ; show ppO2?
132 call check_ppO2 ; check ppO2 and displays warning if required 154 ; call check_ppO2 ; check ppO2 and displays warning if required
133 155 ;
134 diveloop_loop2a: 156 ;diveloop_loop2a:
135 bcf update_divetime ; clear flag 157 ; bcf update_divetime ; clear flag
136 158 ;
137 diveloop_loop3: 159 diveloop_loop3:
138 btfss menubit ; Divemode menu active? 160 btfss menubit ; Divemode menu active?
139 call test_switches_divemode ; No, Check switches normal 161 call test_switches_divemode ; No, Check switches normal
140 162
141 btfsc menubit ; Divemode menu active? 163 btfsc menubit ; Divemode menu active?