Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 98:6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
author | heinrichsweikamp |
---|---|
date | Sun, 12 Dec 2010 15:01:05 +0100 |
parents | 8d3c1bef6551 |
children | 39d325b2a5f9 |
comparison
equal
deleted
inserted
replaced
97:dc349e4264bb | 98:6f8e3a08011e |
---|---|
1 | |
2 ; OSTC - diving computer code | 1 ; OSTC - diving computer code |
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR | 2 ; Copyright (C) 2008 HeinrichsWeikamp GbR |
4 | 3 |
5 ; This program is free software: you can redistribute it and/or modify | 4 ; This program is free software: you can redistribute it and/or modify |
6 ; it under the terms of the GNU General Public License as published by | 5 ; it under the terms of the GNU General Public License as published by |
55 | 54 |
56 test_switches_divemode2: | 55 test_switches_divemode2: |
57 bcf switch_left ; Also reactivate left button if there was a right press without prior left press | 56 bcf switch_left ; Also reactivate left button if there was a right press without prior left press |
58 bcf switch_right ; enable right button again | 57 bcf switch_right ; enable right button again |
59 | 58 |
60 btfss premenu | 59 btfsc premenu |
61 bra set_marker ; No Pre-Menu displayed -> Set Markerflag! | 60 bra test_switches_divemode2_2 |
62 | 61 |
62 bsf toggle_customview ; Toggle customview (Cleared in divemode.asm) | |
63 btfsc standalone_simulator ; Standalone Simualtor active? | |
64 bra divemode_menu_simulator ; Yes, Show simulator menu! | |
65 | |
66 test_switches_divemode2_2: | |
63 btfss FLAG_apnoe_mode ; In Apnoe mode? | 67 btfss FLAG_apnoe_mode ; In Apnoe mode? |
64 bra test_switches_divemode2a; No! | 68 bra test_switches_divemode2a; No! |
65 | 69 |
66 ; Yes, so quit Apnoe mode at once... | 70 ; Yes, so quit Apnoe mode at once... |
67 bcf divemode ; Clear Divemode flag... | 71 bcf divemode ; Clear Divemode flag... |
72 bsf menubit ; Enter Divemode-Menu! | 76 bsf menubit ; Enter Divemode-Menu! |
73 bcf premenu ; clear premenu flag | 77 bcf premenu ; clear premenu flag |
74 call PLED_clear_divemode_menu ; Clear dive mode menu area | 78 call PLED_clear_divemode_menu ; Clear dive mode menu area |
75 call PLED_divemode_menu_mask_first ; Write Divemode menu1 mask | 79 call PLED_divemode_menu_mask_first ; Write Divemode menu1 mask |
76 bcf display_set_simulator ; Clear Simulator-Menu flag | 80 bcf display_set_simulator ; Clear Simulator-Menu flag |
77 bcf divemode_menu_page ; Start in Menu Page one | |
78 movlw d'1' | 81 movlw d'1' |
79 movwf menupos ; reset cursor in divemode menu | 82 movwf menupos ; reset cursor in divemode menu |
80 call PLED_divemenu_cursor ; show cursor | 83 call PLED_divemenu_cursor ; show cursor |
81 bcf switch_right | 84 bcf switch_right |
82 bcf switch_left ; Left button pressed! | 85 bcf switch_left ; Left button pressed! |
83 return | 86 return |
84 | 87 |
85 set_marker: | 88 reset_stopwatch: |
86 btfsc standalone_simulator ; Standalone Simualtor active? | |
87 bra divemode_menu_simulator ; Yes, Show simulator menu! | |
88 | |
89 bsf LED_red ; LEDr on | |
90 movlw d'6' ; Type of Alarm (Manual Marker) | |
91 movwf AlarmType ; Copy to Alarm Register | |
92 bsf event_occured ; Set Event Flag | |
93 | |
94 btfss stopwatch_active ; =1: Reset Average registers | |
95 return | |
96 btfsc lock_stopwatch_reset ; Reset locked? | 89 btfsc lock_stopwatch_reset ; Reset locked? |
97 return ; Yes, do not reset (now)... | 90 return ; Yes, do not reset (now)... |
98 | |
99 ; Maker Set, also reset average Depth.... | 91 ; Maker Set, also reset average Depth.... |
100 clrf average_depth_hold+0 | 92 clrf average_depth_hold+0 |
101 clrf average_depth_hold+1 | 93 clrf average_depth_hold+1 |
102 clrf average_depth_hold+2 | 94 clrf average_depth_hold+2 |
103 clrf average_depth_hold+3 ; Clear average depth register | 95 clrf average_depth_hold+3 ; Clear average depth register |
111 btfsc switch_left | 103 btfsc switch_left |
112 bra test_switches_divemode_menu3 | 104 bra test_switches_divemode_menu3 |
113 btfss switch_right | 105 btfss switch_right |
114 return | 106 return |
115 | 107 |
116 btfsc display_see_l_tissue ; Is the leading tissue info screen active | |
117 bra divemenu_see_leading_tissue2; Yes, quit menu | |
118 | |
119 btfsc display_see_deco ; Is the Decoplan displayed? | 108 btfsc display_see_deco ; Is the Decoplan displayed? |
120 bra divemenu_see_decoplan2 ; Yes, exit menu on left button press | 109 bra divemenu_see_decoplan2 ; Yes, exit menu on left button press |
121 | 110 |
122 btfsc display_set_graphs ; Is the Graph displayed? | |
123 bra divemode_set_graphs2 ; Yes, exit menu on right button press | |
124 | |
125 bcf switch_right ; Left button pressed | 111 bcf switch_right ; Left button pressed |
126 clrf timeout_counter3 ; timout_divemenu! | 112 clrf timeout_counter3 ; timout_divemenu! |
127 incf menupos,F | 113 incf menupos,F |
128 | 114 |
129 ; Following routine configures the number of menu entries for the different modes | 115 ; Following routine configures the number of menu entries for the different modes |
130 movlw d'6' ; number of available gases+1, ; number of menu options+1 | 116 movlw d'6' ; number of available gases+1, ; number of menu options+1 |
117 btfsc display_set_gas ; Are we in the "Gaslist" menu? | |
118 movlw d'7' ; Yes, Number of entries for this menu+1 = 7 | |
131 btfsc display_set_setpoint ; In SetPoint Menu? | 119 btfsc display_set_setpoint ; In SetPoint Menu? |
132 movlw d'4' ; Number of entries for this menu+1 | 120 movlw d'5' ; Number of entries for this menu+1 = 5 |
133 | |
134 cpfseq menupos ; =limit? | 121 cpfseq menupos ; =limit? |
135 bra test_switches_divemode_menu1; No! | 122 bra test_switches_divemode_menu1; No! |
136 movlw d'1' ; Yes, reset to position 1! | 123 movlw d'1' ; Yes, reset to position 1! |
137 movwf menupos | 124 movwf menupos |
125 | |
138 test_switches_divemode_menu1: | 126 test_switches_divemode_menu1: |
127 ; Finally, check if menuposition 3 should be skipped (No customview with function displayed) | |
128 | |
129 btfsc display_set_gas ; Are we in the "Gaslist" or "SetPoint" menu? | |
130 bra test_switches_divemode_menu1a ; Skip test for sub menus | |
131 btfsc display_set_xgas ; Are we in the "Gaslist" or "SetPoint" menu? | |
132 bra test_switches_divemode_menu1a ; Skip test for sub menus | |
133 | |
134 movlw d'3' | |
135 cpfseq menupos ; At position 3? | |
136 bra test_switches_divemode_menu1a; No | |
137 btfss menu3_active ; Menu position 3 has functionality? | |
138 incf menupos,F ; No, +1, skip to menuos=4 | |
139 | |
140 test_switches_divemode_menu1a: | |
139 call PLED_divemenu_cursor ; update cursor | 141 call PLED_divemenu_cursor ; update cursor |
140 return | 142 return |
141 | 143 |
142 test_switches_divemode_menu3: | 144 test_switches_divemode_menu3: |
143 bcf switch_left | 145 bcf switch_left |
144 bcf switch_right | 146 bcf switch_right |
145 bsf menubit ; Enter Divemode-Menu! | 147 bsf menubit ; Enter Divemode-Menu! |
146 bcf premenu ; clear premenu flag | 148 bcf premenu ; clear premenu flag |
147 clrf timeout_counter3 | 149 clrf timeout_counter3 |
148 | 150 |
149 btfsc display_see_l_tissue ; Is the leading tissue info screen active | 151 ; btfsc display_see_l_tissue ; Is the leading tissue info screen active |
150 bra divemenu_see_leading_tissue2; Yes, quit menu | 152 ; bra divemenu_see_leading_tissue2; Yes, quit menu |
151 | 153 |
152 btfsc display_set_gas ; Are we in the "Gaslist" or "SetPoint" menu? | 154 btfsc display_set_gas ; Are we in the "Gaslist" or "SetPoint" menu? |
153 bra divemenu_set_gas2 ; Yes, so set gas and exit menu | 155 bra divemenu_set_gas2 ; Yes, so set gas and exit menu |
154 | 156 |
155 btfsc display_see_deco ; Is the Decoplan displayed? | 157 btfsc display_see_deco ; Is the Decoplan displayed? |
162 bra divemenu_set_xgas2 ; Yes, so configure gas or set menu and exit menu | 164 bra divemenu_set_xgas2 ; Yes, so configure gas or set menu and exit menu |
163 | 165 |
164 btfsc display_set_simulator ; Are we in the Divemode Simulator menu? | 166 btfsc display_set_simulator ; Are we in the Divemode Simulator menu? |
165 goto divemode_menu_simulator2 ; Yes, so adjust depth or set and exit | 167 goto divemode_menu_simulator2 ; Yes, so adjust depth or set and exit |
166 | 168 |
167 btfsc divemode_menu_page ; Are we in the second menu page? | |
168 bra test_switches_divemode_menu4; Yes, use second page items | |
169 | |
170 ; Options for Menu 1 | 169 ; Options for Menu 1 |
171 dcfsnz menupos,F | 170 dcfsnz menupos,F |
172 bra divemenu_set_gas ; Set gas sub-menu | 171 bra divemenu_set_gas ; Set gas sub-menu |
173 dcfsnz menupos,F | 172 dcfsnz menupos,F |
174 bra divemenu_see_decoplan ; display the full decoplan | 173 bra divemenu_see_decoplan ; display the full decoplan |
175 dcfsnz menupos,F | 174 dcfsnz menupos,F |
176 bra divemode_set_xgas ; Configure the extra gas / Select Bailout | 175 bra divemode_menu3 ; Customview-function |
177 dcfsnz menupos,F | 176 dcfsnz menupos,F |
178 bra divemenu_enter_second ; Enter second Menu page | 177 bra divemode_toggle_brightness ; Toggle OLED-Brightness |
179 dcfsnz menupos,F | 178 dcfsnz menupos,F |
180 bra timeout_divemenu2 ; Quit divemode menu | 179 bra timeout_divemenu2 ; Quit divemode menu |
181 return | 180 return |
182 | 181 |
183 test_switches_divemode_menu4: | 182 divemode_menu3: |
184 ; Options for Menu 2 | 183 movff menupos3,temp1 ; copy |
185 dcfsnz menupos,F | 184 dcfsnz temp1,F |
186 bra divemode_set_graphs ; Show saturation graphs | 185 bra toggle_stopwatch ; Toggle Stopwatch/Average register |
187 dcfsnz menupos,F | 186 dcfsnz temp1,F |
188 bra divemode_toggle_brightness ; Toggle OLED-Brightness | 187 bra set_marker ; Set Marker |
189 dcfsnz menupos,F | 188 dcfsnz temp1,F |
190 bra divemenu_see_leading_tissue ; Display details about leading tissue | 189 bra divemode_menu3_nothing ; clock... |
191 dcfsnz menupos,F | 190 dcfsnz temp1,F |
192 bra toggle_stopwatch ; Toggle Stopwatch | 191 bra divemode_menu3_nothing ; leading tissue... |
193 dcfsnz menupos,F | 192 |
193 divemode_menu3_nothing: | |
194 bra timeout_divemenu2 ; Quit divemode menu | 194 bra timeout_divemenu2 ; Quit divemode menu |
195 return | 195 return |
196 | |
197 set_marker: | |
198 movlw d'6' ; Type of Alarm (Manual Marker) | |
199 movwf AlarmType ; Copy to Alarm Register | |
200 bsf event_occured ; Set Event Flag | |
201 bra timeout_divemenu2 ; quit menu! | |
196 | 202 |
197 toggle_stopwatch: | 203 toggle_stopwatch: |
198 btg stopwatch_active ; Toggle Flag | 204 btg stopwatch_active ; Toggle Flag |
199 | 205 |
200 btfss stopwatch_active ; Show Stopwatch? | 206 btfss stopwatch_active ; Show Stopwatch? |
202 | 208 |
203 clrf average_depth_hold+0 | 209 clrf average_depth_hold+0 |
204 clrf average_depth_hold+1 | 210 clrf average_depth_hold+1 |
205 clrf average_depth_hold+2 | 211 clrf average_depth_hold+2 |
206 clrf average_depth_hold+3 ; Clear average depth register | 212 clrf average_depth_hold+3 ; Clear average depth register |
207 movlw d'2' | 213 movlw d'3' |
208 movwf average_divesecs+0 | 214 movwf average_divesecs+0 |
209 clrf average_divesecs+1 | 215 clrf average_divesecs+1 |
210 call calc_average_depth | 216 call calc_average_depth |
211 | |
212 bra timeout_divemenu2 ; quit menu! | 217 bra timeout_divemenu2 ; quit menu! |
213 | 218 |
214 toggle_stopwatch2: | 219 toggle_stopwatch2: |
215 call PLED_clear_customview_divemode ; Remove Stopwatch Outputs | 220 call PLED_clear_customview_divemode ; Remove Stopwatch Outputs |
216 bra timeout_divemenu2 ; quit menu! | 221 bra timeout_divemenu2 ; quit menu! |
249 call PLED_display_deko_mask ; clear nostop time, display decodata | 254 call PLED_display_deko_mask ; clear nostop time, display decodata |
250 btfss dekostop_active | 255 btfss dekostop_active |
251 call PLED_display_ndl_mask ; Clear deco data, display nostop time | 256 call PLED_display_ndl_mask ; Clear deco data, display nostop time |
252 bra timeout_divemenu2 ; quit menu! | 257 bra timeout_divemenu2 ; quit menu! |
253 | 258 |
254 divemenu_enter_second: | |
255 call PLED_clear_divemode_menu ; Clear dive mode menu area | |
256 call PLED_divemode_menu_mask_second ; Write Divemode menu1 mask | |
257 movlw d'1' | |
258 movwf menupos ; reset cursor to first item in divemode menu page two | |
259 bsf divemode_menu_page ; Enter Menu Page two | |
260 call PLED_divemenu_cursor ; show cursor | |
261 bcf switch_right | |
262 bcf switch_left ; Left button pressed! | |
263 return | |
264 | |
265 divemode_set_xgas: ; Set the extra gas... | 259 divemode_set_xgas: ; Set the extra gas... |
266 btfsc FLAG_const_ppO2_mode ; are we in ppO2 mode? | |
267 bra divemenu_set_bailout ; Yes, so display Bailot list... | |
268 | |
269 bsf display_set_xgas ; Set Flag | 260 bsf display_set_xgas ; Set Flag |
261 bcf display_set_gas ; Clear Flag | |
270 call PLED_clear_divemode_menu ; Clear Menu | 262 call PLED_clear_divemode_menu ; Clear Menu |
271 | 263 |
272 movff char_I_O2_ratio, EEDATA ; Reset Gas6 to current gas | 264 movff char_I_O2_ratio, EEDATA ; Reset Gas6 to current gas |
273 write_int_eeprom d'24' | 265 write_int_eeprom d'24' |
274 movff char_I_He_ratio, EEDATA | 266 movff char_I_He_ratio, EEDATA |
277 call PLED_divemode_set_xgas ; Show mask | 269 call PLED_divemode_set_xgas ; Show mask |
278 | 270 |
279 movlw d'1' | 271 movlw d'1' |
280 movwf menupos ; reset cursor | 272 movwf menupos ; reset cursor |
281 call PLED_divemenu_cursor ; update cursor | 273 call PLED_divemenu_cursor ; update cursor |
282 | |
283 return | 274 return |
284 | 275 |
285 divemode_menu_simulator: | 276 divemode_menu_simulator: |
286 bsf menubit ; Enter Divemode-Menu! | 277 bsf menubit ; Enter Divemode-Menu! |
287 bcf premenu ; clear premenu flag | 278 bcf premenu ; clear premenu flag |
288 bcf switch_right | 279 bcf switch_right |
289 bcf switch_left ; Left button pressed! | 280 bcf switch_left ; Left button pressed! |
290 bsf display_set_simulator ; Set Flag | 281 bsf display_set_simulator ; Set Flag |
291 call PLED_clear_divemode_menu ; Clear Menu | 282 call PLED_clear_divemode_menu ; Clear Menu |
292 call PLED_divemode_simulator_mask; Show mask | 283 call PLED_divemode_simulator_mask; Show mask |
293 bcf divemode_menu_page ; Start in Menu Page one | |
294 movlw d'1' | 284 movlw d'1' |
295 movwf menupos ; reset cursor | 285 movwf menupos ; reset cursor |
296 call PLED_divemenu_cursor ; update cursor | 286 call PLED_divemenu_cursor ; update cursor |
297 return | 287 return |
298 | 288 |
392 | 382 |
393 divemode_set_graphs2: | 383 divemode_set_graphs2: |
394 bcf display_set_graphs ; clear flag | 384 bcf display_set_graphs ; clear flag |
395 bra timeout_divemenu2 ; quit menu! | 385 bra timeout_divemenu2 ; quit menu! |
396 | 386 |
397 divemenu_see_leading_tissue: | |
398 bsf display_see_l_tissue ; Set Flag | |
399 call PLED_clear_divemode_menu ; Clear Menu | |
400 call PLED_show_leading_tissue ; Show infos about leading tissue | |
401 return | |
402 | |
403 divemenu_see_leading_tissue2: | |
404 bcf display_see_l_tissue ; Clear Flag | |
405 bra timeout_divemenu2 ; quit menu! | |
406 | |
407 divemenu_see_decoplan: | 387 divemenu_see_decoplan: |
408 bsf display_see_deco ; set flag | 388 bsf display_see_deco ; set flag |
409 call PLED_clear_divemode_menu ; Clear Menu | 389 call PLED_clear_divemode_menu ; Clear Menu |
410 | 390 |
411 read_int_eeprom d'34' | 391 read_int_eeprom d'34' |
445 btfsc last_ceiling_gf_shown ; last ceiling shown? | 425 btfsc last_ceiling_gf_shown ; last ceiling shown? |
446 bra divemenu_see_decoplan2_0 ; All done, clear and return | 426 bra divemenu_see_decoplan2_0 ; All done, clear and return |
447 | 427 |
448 clrf timeout_counter3 ; Clear timeout Divemode menu | 428 clrf timeout_counter3 ; Clear timeout Divemode menu |
449 bra timeout_divemenu3x ; Display next page | 429 bra timeout_divemenu3x ; Display next page |
450 | |
451 | |
452 | 430 |
453 divemenu_set_xgas2: | 431 divemenu_set_xgas2: |
454 dcfsnz menupos,F | 432 dcfsnz menupos,F |
455 bra divemenu_set_xgas2_exit ; Use the gas6 configured and exit | 433 bra divemenu_set_xgas2_exit ; Use the gas6 configured and exit |
456 dcfsnz menupos,F | 434 dcfsnz menupos,F |
563 subfwb wait_temp,W ; minus He | 541 subfwb wait_temp,W ; minus He |
564 subfwb EEDATA,F ; minus O2 | 542 subfwb EEDATA,F ; minus O2 |
565 movff EEDATA, char_I_N2_ratio ; = N2! | 543 movff EEDATA, char_I_N2_ratio ; = N2! |
566 bsf manual_gas_changed ; set event flag | 544 bsf manual_gas_changed ; set event flag |
567 bsf event_occured ; set global event flag | 545 bsf event_occured ; set global event flag |
546 bsf is_bailout ;=1: CC mode, but bailout active! | |
547 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail" | |
548 movff lo,char_I_const_ppO2 | |
568 bra timeout_divemenu2 ; quit underwater menu! | 549 bra timeout_divemenu2 ; quit underwater menu! |
569 | |
570 divemenu_set_bailout: | |
571 bsf display_set_gas ; set flag | |
572 call PLED_clear_divemode_menu ; Clear Menu | |
573 | |
574 bcf FLAG_const_ppO2_mode ; Delete Flag to show all bailouts | |
575 bsf select_bailoutgas ; Set Flag for Bailout list | |
576 call PLED_gas_list ; Display all 5 gases | |
577 bsf FLAG_const_ppO2_mode ; Reset Flag | |
578 | |
579 movlw d'1' | |
580 movwf menupos ; reset cursor | |
581 call PLED_divemenu_cursor ; update cursor | |
582 return | |
583 | 550 |
584 divemenu_set_gas: | 551 divemenu_set_gas: |
585 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | 552 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? |
586 bra divemenu_set_setpoint ; Yes, display SetPoint list | 553 bra divemenu_set_setpoint ; Yes, display SetPoint list |
587 | 554 |
555 divemenu_set_gas_2: | |
588 bsf display_set_gas ; set flag | 556 bsf display_set_gas ; set flag |
589 call PLED_clear_divemode_menu ; Clear Menu | 557 call PLED_clear_divemode_menu ; Clear Menu |
590 call PLED_gas_list ; Display all 5 gases | 558 call PLED_gas_list ; Display all 5 gases |
591 movlw d'1' | 559 movlw d'1' |
592 movwf menupos ; reset cursor | 560 movwf menupos ; reset cursor |
596 divemenu_set_setpoint: | 564 divemenu_set_setpoint: |
597 bsf display_set_setpoint ; set flag | 565 bsf display_set_setpoint ; set flag |
598 bsf display_set_gas ; set flag | 566 bsf display_set_gas ; set flag |
599 | 567 |
600 call PLED_clear_divemode_menu ; Clear Menu | 568 call PLED_clear_divemode_menu ; Clear Menu |
601 call PLED_splist_start ; Display SetPoints and Sensor results | 569 call PLED_splist_start ; Display SetPoints |
570 DISPLAYTEXT d'137' ; Bailout (as a sub-menu) | |
602 movlw d'1' | 571 movlw d'1' |
603 movwf menupos ; reset cursor | 572 movwf menupos ; reset cursor |
604 call PLED_divemenu_cursor ; update cursor | 573 call PLED_divemenu_cursor ; update cursor |
605 | |
606 return | 574 return |
607 | 575 |
608 | 576 |
609 divemenu_set_gas2: | 577 divemenu_set_gas2: |
610 btfsc select_bailoutgas ; Are we in the Bailout list? | 578 btfsc select_bailoutgas ; Are we in the Bailout list? |
611 bra divemenu_set_gas2a ; Yes, choose gas | 579 bra divemenu_set_gas2a ; Yes, choose gas |
612 | 580 |
613 btfss FLAG_const_ppO2_mode ; are we in ppO2 mode? | 581 btfss FLAG_const_ppO2_mode ; are we in ppO2 mode? |
614 bra divemenu_set_gas2a ; no, choose gas | 582 bra divemenu_set_gas2a ; no, choose gas |
615 ; Yes, so select SP 1-3 or Sensor mode | 583 ; Yes, so select SP 1-3 |
616 | |
617 bcf is_bailout ;=1: CC mode, but bailout active! | 584 bcf is_bailout ;=1: CC mode, but bailout active! |
618 call PLED_show_ppO2_clear; Clear ppO2 value | 585 call PLED_show_ppO2_clear ; Clear ppO2 value |
619 | 586 |
620 divemenu_set_gas1: | 587 divemenu_set_gas1: |
588 movlw d'4' | |
589 cpfseq menupos ; At the "Bailout" position? | |
590 bra divemenu_set_gas1b ; No, select SetPoint 1-3 | |
591 bsf select_bailoutgas ; Set Flag | |
592 bcf display_set_setpoint ; Clear Flag | |
593 bra divemenu_set_gas_2 ; Configure the extra gas / Select Bailout | |
594 | |
595 divemenu_set_gas1b: | |
621 movlw d'35' ; offset in memory | 596 movlw d'35' ; offset in memory |
622 addwf menupos,W ; add SP number 0-2 | 597 addwf menupos,W ; add SP number 0-2 |
623 movwf EEADR | 598 movwf EEADR |
624 call read_eeprom ; Read SetPoint | 599 call read_eeprom ; Read SetPoint |
625 movff EEDATA, char_I_const_ppO2 ; Use SetPoint | 600 movff EEDATA, char_I_const_ppO2 ; Use SetPoint |
626 movff EEDATA, ppO2_setpoint_store ; Store also in this byte... | 601 movff EEDATA, ppO2_setpoint_store ; Store also in this byte... |
627 | 602 |
628 divemenu_set_gas1a: | 603 divemenu_set_gas1a: |
629 bcf display_set_setpoint ; Clear Display Flag | 604 bcf display_set_setpoint ; Clear Display Flag |
630 ; Now, Set correct Diluent (again) | |
631 ; read_int_eeprom d'33' ; Read byte (stored in EEDATA) | |
632 ; movff EEDATA,active_gas ; Read start gas (1-5) | |
633 ; | |
634 ; decf active_gas,W ; Gas 0-4 | |
635 ; mullw d'4' | |
636 ; movf PRODL,W | |
637 ; addlw d'7' ; = address for He ratio | |
638 ; movwf EEADR | |
639 ; call read_eeprom ; Read He ratio | |
640 ; movff EEDATA,char_I_He_ratio ; And copy into hold register | |
641 ; decf active_gas,W ; Gas 0-4 | |
642 ; mullw d'4' | |
643 ; movf PRODL,W | |
644 ; addlw d'6' ; = address for O2 ratio | |
645 ; movwf EEADR | |
646 ; call read_eeprom ; Read O2 ratio | |
647 ; movff EEDATA, char_I_O2_ratio ; O2 ratio | |
648 ; movff char_I_He_ratio, wait_temp ; copy into bank1 register | |
649 ; bsf STATUS,C ; Borrow bit | |
650 ; movlw d'100' ; 100% | |
651 ; subfwb wait_temp,W ; minus He | |
652 ; bsf STATUS,C ; Borrow bit | |
653 ; subfwb EEDATA,F ; minus O2 | |
654 ; movff EEDATA, char_I_N2_ratio ; = N2! | |
655 ; call PLED_active_gas_clear ; Clear gas in case of AIR (Will be redrawn) | |
656 | |
657 bsf stored_gas_changed ; set event flag | 605 bsf stored_gas_changed ; set event flag |
658 bsf event_occured ; set global event flag | 606 bsf event_occured ; set global event flag |
659 bra timeout_divemenu2 ; quit menu! | 607 bra timeout_divemenu2 ; quit menu! |
660 | 608 |
661 divemenu_set_gas2a: | 609 divemenu_set_gas2a: |
610 movlw d'6' | |
611 cpfseq menupos ; At the "Gas 6.." position? | |
612 bra divemenu_set_gas2b ; No, select Gas1-5 (Stored in Menupos) | |
613 bra divemode_set_xgas ; Configure the extra gas | |
614 divemenu_set_gas2b: | |
662 bsf is_bailout ;=1: CC mode, but bailout active! | 615 bsf is_bailout ;=1: CC mode, but bailout active! |
663 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail" | 616 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail" |
664 movff lo,char_I_const_ppO2 | 617 movff lo,char_I_const_ppO2 |
665 | 618 |
666 bcf display_set_gas ; clear flag | 619 bcf display_set_gas ; clear flag |
692 | 645 |
693 timeout_divemenu: | 646 timeout_divemenu: |
694 btfss menubit ; is the Dive mode menu displayed? | 647 btfss menubit ; is the Dive mode menu displayed? |
695 return ; No | 648 return ; No |
696 | 649 |
697 btfsc display_see_l_tissue ; Are the leading tissue details displayed? | |
698 bra timeout_divemenu7 ; Yes, update them | |
699 | 650 |
700 btfsc display_set_simulator ; Is the Simulator Mask active? | 651 btfsc display_set_simulator ; Is the Simulator Mask active? |
701 bra timeout_divemenu6 ; Yes, update Simulator mask | 652 bra timeout_divemenu6 ; Yes, update Simulator mask |
702 | |
703 | 653 |
704 btfss display_see_deco ; Is the decoplan active? | 654 btfss display_see_deco ; Is the decoplan active? |
705 bra timeout_divemenu1 ; No, skip updating the decoplan | 655 bra timeout_divemenu1 ; No, skip updating the decoplan |
706 | 656 |
707 btfsc multi_gf_display ; display the multi-gf table screen? | 657 btfsc multi_gf_display ; display the multi-gf table screen? |
739 call PLED_divemins ; Display (new) divetime! | 689 call PLED_divemins ; Display (new) divetime! |
740 btfss dekostop_active | 690 btfss dekostop_active |
741 call PLED_display_ndl_mask | 691 call PLED_display_ndl_mask |
742 btfsc dekostop_active | 692 btfsc dekostop_active |
743 call PLED_display_deko_mask | 693 call PLED_display_deko_mask |
744 | 694 call customview_mask ; Redraw current customview mask |
745 clrf timeout_counter3 ; Also clear timeout | 695 clrf timeout_counter3 ; Also clear timeout |
746 bcf display_see_deco ; clear all display flags | 696 bcf display_see_deco ; clear all display flags |
747 bcf display_see_l_tissue | 697 ; bcf display_see_l_tissue |
748 bcf display_set_gas | 698 bcf display_set_gas |
749 bcf display_set_graphs | 699 bcf display_set_graphs |
750 bcf display_set_xgas | 700 bcf display_set_xgas |
751 bcf display_set_setpoint | 701 bcf display_set_setpoint |
752 bcf display_set_simulator | 702 bcf display_set_simulator |
767 ; Update Simulator Mask | 717 ; Update Simulator Mask |
768 call PLED_divemode_simulator_mask; Show mask | 718 call PLED_divemode_simulator_mask; Show mask |
769 call PLED_divemenu_cursor ; update cursor | 719 call PLED_divemenu_cursor ; update cursor |
770 bra timeout_divemenu1 ; Check timeout | 720 bra timeout_divemenu1 ; Check timeout |
771 | 721 |
772 timeout_divemenu7: | 722 ;timeout_divemenu7: |
773 ; Update Leading tissue infos | 723 ; ; Update Leading tissue infos |
774 call PLED_show_leading_tissue ; Update infos about leading tissue | 724 ; call PLED_show_leading_tissue ; Update infos about leading tissue |
775 bra timeout_divemenu1 ; Check timeout | 725 ; bra timeout_divemenu1 ; Check timeout |