Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 297:ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
author | Heinrichsweikamp |
---|---|
date | Fri, 29 Apr 2011 20:17:32 +0200 |
parents | 4dbff2aa31ee |
children | eac799f69360 |
rev | line source |
---|---|
0 | 1 |
2 ; OSTC - diving computer code | |
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR | |
4 | |
5 ; 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 | |
7 ; the Free Software Foundation, either version 3 of the License, or | |
8 ; (at your option) any later version. | |
9 | |
10 ; This program is distributed in the hope that it will be useful, | |
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 ; GNU General Public License for more details. | |
14 | |
15 ; You should have received a copy of the GNU General Public License | |
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | |
18 | |
19 ; Gas Setup menu | |
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
21 ; written: 10/08/07 | |
22 ; last updated: 080906 | |
23 ; known bugs: | |
24 ; ToDo: | |
25 | |
26 menu_gassetup: | |
27 movlw d'1' | |
28 movwf menupos | |
29 | |
30 menu_gassetup_prelist: | |
36
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
31 call PLED_ClearScreen |
47 | 32 call gassetup_sort_gaslist ; Sorts Gaslist according to change depth |
0 | 33 clrf timeout_counter2 |
34 bcf sleepmode | |
35 bcf menubit2 | |
36 bcf menubit3 | |
37 call PLED_topline_box | |
38 WIN_INVERT .1 ; Init new Wordprocessor | |
39 DISPLAYTEXT .106 ; Gas List | |
40 WIN_INVERT .0 ; Init new Wordprocessor | |
41 clrf decodata+0 ; Here: # of gas 0-4 | |
42 clrf divemins+0 ; Here: # of Gas * 4 | |
43 movlw d'5' | |
44 movwf waitms_temp ; here: stores row for gas list | |
45 movlw d'2' | |
46 movwf wait_temp ; here: stores eeprom address for gas list | |
47 | |
48 ; Changed v1.44se | |
49 menu_gassetup_list: | |
50 WIN_LEFT .20 | |
51 movlw d'4' | |
52 addwf wait_temp,F ; Increase eeprom address for gas list | |
53 movlw d'30' | |
54 addwf waitms_temp,F ; Increase row | |
55 movf waitms_temp,W ; Load row into WREG | |
56 movff WREG,win_top | |
57 lfsr FSR2,letter | |
123 | 58 PUTC 'G' |
0 | 59 movff decodata+0,lo |
60 incf lo,F | |
61 bsf leftbind | |
62 output_99 | |
123 | 63 PUTC ':' |
0 | 64 |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
115
diff
changeset
|
65 movf decodata+0,W |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
115
diff
changeset
|
66 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases |
0 | 67 call word_processor |
68 WIN_LEFT .40 | |
69 movf waitms_temp,W ; Load row into WREG | |
70 movff WREG,win_top | |
71 lfsr FSR2,letter | |
72 | |
73 movlw d'33' | |
74 movwf EEADR | |
75 call read_eeprom ; Get current startgas 1-5 # into EEDATA | |
76 decf EEDATA,W ; 0-4 | |
77 cpfseq decodata+0 ; =current displayed gas #? | |
78 bra menu_gassetup_Tx ; no, do not display * | |
123 | 79 PUTC '*' ; display * |
0 | 80 |
81 ; New v1.44se | |
82 menu_gassetup_Tx: | |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
115
diff
changeset
|
83 movf decodata+0,W |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
115
diff
changeset
|
84 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases |
0 | 85 call word_processor |
86 | |
87 WIN_LEFT .48 | |
88 movf waitms_temp,W ; Load row into WREG | |
89 movff WREG,win_top | |
90 lfsr FSR2,letter | |
91 | |
92 movff wait_temp, EEADR ; Gas %He - Set address in internal EEPROM | |
93 incf EEADR,F ; Gas %He - Set address in internal EEPROM | |
94 call read_eeprom ; Read He value from EEPROM | |
95 movff EEDATA,lo ; Move EEDATA -> lo | |
96 movf lo,f ; Move lo -> f | |
97 movlw d'0' ; Move 0 -> WREG | |
98 cpfsgt lo ; He > 0? | |
99 bra menu_gassetup_Nx ; NO check o2 | |
100 | |
101 ; YES Write TX 15/55 | |
102 call gassetup_write_Tx | |
103 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM | |
104 call read_eeprom ; O2 value | |
105 movff EEDATA,lo | |
106 output_8 | |
123 | 107 PUTC '/' |
0 | 108 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
109 call read_eeprom ; He value | |
110 movff EEDATA,lo | |
111 output_8 | |
112 bra menu_gassetup_list0 | |
113 | |
114 ; New v1.44se | |
115 menu_gassetup_Nx: | |
116 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM | |
117 call read_eeprom ; Read O2 value from EEPROM | |
118 movff EEDATA,lo ; Move EEDATA -> lo | |
119 movf lo,f ; Move lo -> f | |
120 movlw d'21' ; Move 21 -> WREG | |
121 cpfsgt lo ; o2 > 21% | |
122 bra menu_gassetup_Air ; NO AIR | |
123 movlw d'100' ; Move 100 -> WREG | |
124 cpfslt lo ; o2 < 100% | |
125 bra menu_gassetup_O2 ; NO write O2 | |
126 | |
127 ; YES Write NX 32 | |
128 call gassetup_write_Nx | |
129 output_8 | |
130 bra menu_gassetup_list0 | |
131 | |
132 ; New v1.44se | |
133 menu_gassetup_O2: | |
123 | 134 STRCAT "O2 " |
0 | 135 output_8 |
136 bra menu_gassetup_list0 | |
137 | |
138 ; New v1.44se | |
139 menu_gassetup_Air: | |
140 cpfseq lo ; o2 = 21% | |
141 call menu_gassetup_Err | |
142 | |
123 | 143 STRCAT "AIR " |
0 | 144 output_8 |
145 bra menu_gassetup_list0 | |
146 | |
147 ; New v1.44se | |
148 menu_gassetup_Err: | |
123 | 149 STRCAT "ERR " |
0 | 150 output_8 |
151 | |
152 ; Changed v1.44se | |
153 menu_gassetup_list0: | |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
115
diff
changeset
|
154 movf decodata+0,W |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
115
diff
changeset
|
155 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases |
0 | 156 call word_processor |
157 | |
158 WIN_LEFT .105 | |
159 movf waitms_temp,W ; Load row into WREG | |
160 movff WREG,win_top | |
161 lfsr FSR2,letter | |
162 | |
123 | 163 STRCAT " in " |
0 | 164 movf decodata+0,W ; read current value |
165 addlw d'28' ; offset in memory | |
166 movwf EEADR | |
167 call read_eeprom ; Low-value | |
168 movff EEDATA,lo | |
169 output_8 | |
123 | 170 PUTC 'm' |
121
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
115
diff
changeset
|
171 movf decodata+0,W |
e0f29e20bd24
Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents:
115
diff
changeset
|
172 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases |
0 | 173 call word_processor |
174 | |
3 | 175 call PLED_standard_color |
0 | 176 |
177 incf decodata+0,F | |
178 movlw d'5' | |
179 cpfseq decodata+0 | |
180 goto menu_gassetup_list | |
181 | |
182 DISPLAYTEXT .11 ; Exit | |
183 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
184 call PLED_menu_cursor | |
185 | |
186 gassetup_list_loop: | |
187 call check_switches_logbook | |
188 | |
189 btfsc menubit3 | |
190 bra gassetup_list2 ; move cursor | |
191 | |
192 btfsc menubit2 | |
193 bra do_gassetup_list; call gas-specific submenu | |
194 | |
195 btfsc divemode | |
196 goto restart ; dive started! | |
197 | |
198 btfsc onesecupdate | |
199 call timeout_surfmode | |
200 | |
201 btfsc onesecupdate | |
202 call set_dive_modes | |
203 | |
204 bcf onesecupdate ; 1 sec. functions done | |
205 | |
206 btfsc sleepmode | |
207 bra exit_gassetup_list | |
208 | |
209 bra gassetup_list_loop | |
210 | |
211 gassetup_list2: | |
212 incf menupos,F | |
213 movlw d'7' | |
214 cpfseq menupos ; =7? | |
215 bra gassetup_list3 ; No | |
216 movlw d'1' | |
217 movwf menupos | |
218 | |
219 gassetup_list3: | |
220 clrf timeout_counter2 | |
221 call PLED_menu_cursor | |
222 | |
223 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
224 | |
225 bcf menubit3 ; clear flag | |
226 bra gassetup_list_loop | |
227 | |
228 exit_gassetup_list: ; exit... | |
229 movlw d'2' | |
230 movwf menupos | |
231 goto menu2 | |
232 | |
233 do_gassetup_list: | |
234 dcfsnz menupos,F | |
235 bra gassetup_list_edit_gas1 | |
236 dcfsnz menupos,F | |
237 bra gassetup_list_edit_gas2 | |
238 dcfsnz menupos,F | |
239 bra gassetup_list_edit_gas3 | |
240 dcfsnz menupos,F | |
241 bra gassetup_list_edit_gas4 | |
242 dcfsnz menupos,F | |
243 bra gassetup_list_edit_gas5 | |
244 bra exit_gassetup_list ; Exit List | |
245 | |
246 gassetup_list_edit_gas1: | |
247 movlw d'0' | |
248 movwf decodata+0 | |
249 movlw d'0' | |
250 movwf divemins+0 | |
251 bra menu_gassetup_page1 | |
252 | |
253 gassetup_list_edit_gas2: | |
254 movlw d'1' | |
255 movwf decodata+0 | |
256 movlw d'4' | |
257 movwf divemins+0 | |
258 bra menu_gassetup_page1 | |
259 | |
260 gassetup_list_edit_gas3: | |
261 movlw d'2' | |
262 movwf decodata+0 | |
263 movlw d'8' | |
264 movwf divemins+0 | |
265 bra menu_gassetup_page1 | |
266 | |
267 gassetup_list_edit_gas4: | |
268 movlw d'3' | |
269 movwf decodata+0 | |
270 movlw d'12' | |
271 movwf divemins+0 | |
272 bra menu_gassetup_page1 | |
273 | |
274 gassetup_list_edit_gas5: | |
275 movlw d'4' | |
276 movwf decodata+0 | |
277 movlw d'16' | |
278 movwf divemins+0 | |
279 bra menu_gassetup_page1 | |
280 | |
281 menu_gassetup_page1: | |
282 movlw d'1' | |
283 movwf menupos | |
284 bcf gas_setup_page2 ; Page 1 of gassetup | |
285 bcf menubit4 | |
286 bcf cursor | |
287 bcf sleepmode | |
288 bcf first_FA ; Here: =1: -, =0: + | |
289 | |
290 menu_gassetup0: | |
291 call PLED_ClearScreen | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
50
diff
changeset
|
292 DISPLAYTEXT .147 ; More... |
0 | 293 DISPLAYTEXT .11 ; Exit |
294 | |
295 menu_gassetup1: | |
296 clrf timeout_counter2 | |
297 bcf menubit2 | |
298 bcf menubit3 | |
299 | |
300 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info | |
301 | |
302 WIN_LEFT .20 | |
199 | 303 WIN_TOP .65 |
123 | 304 STRCPY "O2: " |
0 | 305 |
306 movf divemins+0,W | |
307 addlw 0x06 | |
308 movwf EEADR | |
199 | 309 call read_eeprom ; O2 value |
0 | 310 movff EEDATA,lo |
311 output_8 | |
199 | 312 STRCAT_PRINT "% " |
0 | 313 |
314 ; Show MOD in m | |
199 | 315 WIN_LEFT .90 |
316 lfsr FSR2, letter | |
317 OUTPUTTEXTH .297 ; MOD: | |
318 | |
319 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG | |
0 | 320 mullw d'10' |
321 movff PRODL,xA+0 | |
199 | 322 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10 |
0 | 323 |
324 movf divemins+0,W | |
325 addlw 0x06 | |
326 movwf EEADR | |
199 | 327 call read_eeprom ; O2 value |
0 | 328 movff EEDATA,xB+0 |
329 clrf xB+1 | |
199 | 330 call div16x16 ; xA/xB=xC with xA as remainder |
0 | 331 movlw d'10' |
199 | 332 subwf xC+0,F ; Subtract 10m... |
0 | 333 movff xC+0,lo |
334 movlw d'0' | |
335 subwfb xC+1,F | |
336 movff xC+1,hi | |
337 output_16 | |
199 | 338 STRCAT_PRINT "m " |
0 | 339 |
199 | 340 WIN_LEFT .20 |
0 | 341 WIN_TOP .95 |
123 | 342 STRCPY "He: " |
0 | 343 movf divemins+0,W |
344 addlw 0x07 | |
345 movwf EEADR | |
199 | 346 call read_eeprom ; He value |
0 | 347 movff EEDATA,lo |
348 output_8 | |
199 | 349 STRCAT_PRINT "% " |
105 | 350 |
351 ; Show END in m | |
199 | 352 lfsr FSR2, letter |
353 WIN_LEFT .90 | |
354 OUTPUTTEXTH .298 ; END: | |
355 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG | |
105 | 356 mullw d'10' |
357 movff PRODL,xA+0 | |
199 | 358 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10 |
105 | 359 movf divemins+0,W |
360 addlw 0x06 | |
361 movwf EEADR | |
199 | 362 call read_eeprom ; O2 value |
105 | 363 movff EEDATA,xB+0 |
364 clrf xB+1 | |
199 | 365 call div16x16 ; xA/xB=xC with xA as remainder |
105 | 366 movlw d'10' |
199 | 367 subwf xC+0,F ; Subtract 10m... |
105 | 368 movff xC+0,lo |
369 movlw d'0' | |
370 subwfb xC+1,F | |
199 | 371 movff xC+1,hi ; lo:hi holding MOD in meters |
105 | 372 movlw d'10' |
373 addwf lo,F | |
374 movlw d'0' | |
199 | 375 addwfc hi,F ; lo:hi holding MOD+10m |
105 | 376 |
377 movf divemins+0,W | |
378 addlw 0x07 | |
379 movwf EEADR | |
199 | 380 call read_eeprom ; He value in % -> EEDATA |
105 | 381 movlw d'100' |
382 movwf xA+0 | |
199 | 383 movf EEDATA,W ; He value in % -> EEDATA |
384 subwf xA+0,F ; xA+0 = 100 - He Value in % | |
105 | 385 clrf xA+1 |
386 movff lo,xB+0 | |
199 | 387 movff hi,xB+1 ; Copy MOD+10 |
388 call mult16x16 ; xA*xB=xC | |
105 | 389 movff xC+0,xA+0 |
390 movff xC+1,xA+1 | |
391 movlw d'100' | |
392 movwf xB+0 | |
393 clrf xB+1 | |
199 | 394 call div16x16 ; xA/xB=xC with xA as remainder |
105 | 395 ; xC:2 = ((MOD+10) * 100 - HE Value in %) / 100 |
396 movlw d'10' | |
199 | 397 subwf xC+0,F ; Subtract 10m... |
105 | 398 movff xC+0,lo |
399 movlw d'0' | |
400 subwfb xC+1,F | |
401 movff xC+1,hi | |
402 output_16 | |
199 | 403 STRCAT_PRINT "m " |
0 | 404 |
199 | 405 WIN_LEFT .20 |
0 | 406 WIN_TOP .125 |
123 | 407 STRCPY "+/-: " |
0 | 408 movlw '+' |
409 btfsc first_FA | |
410 movlw '-' | |
411 movwf POSTINC2 | |
412 call word_processor | |
413 | |
414 WIN_TOP .155 | |
415 lfsr FSR2,letter | |
199 | 416 OUTPUTTEXT .89 ; Default: |
0 | 417 movf divemins+0,W |
418 addlw 0x04 | |
419 movwf EEADR | |
199 | 420 call read_eeprom ; Default O2 value |
0 | 421 movff EEDATA,lo |
422 output_8 | |
123 | 423 PUTC '/' |
0 | 424 movf divemins+0,W |
425 addlw 0x05 | |
426 movwf EEADR | |
199 | 427 call read_eeprom ; Default He value |
0 | 428 movff EEDATA,lo |
429 output_8 | |
123 | 430 STRCAT_PRINT " " |
0 | 431 |
432 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
433 call PLED_menu_cursor | |
434 | |
435 gassetup_loop: | |
436 call check_switches_logbook | |
437 | |
438 btfsc menubit3 | |
439 bra gassetup2 ; move cursor | |
440 | |
441 btfsc menubit2 | |
442 bra do_gassetup ; call submenu | |
443 | |
444 btfsc divemode | |
445 goto restart ; dive started! | |
446 | |
447 btfsc onesecupdate | |
448 call timeout_surfmode | |
449 | |
450 btfsc onesecupdate | |
451 call set_dive_modes | |
452 | |
453 bcf onesecupdate ; 1 sec. functions done | |
454 | |
455 btfsc sleepmode | |
456 bra exit_gassetup | |
457 | |
458 bra gassetup_loop | |
459 | |
460 gassetup2: | |
461 incf menupos,F | |
462 movlw d'7' | |
463 cpfseq menupos ; =7? | |
464 bra gassetup3 ; No | |
465 movlw d'1' | |
466 movwf menupos | |
467 | |
468 gassetup3: | |
469 | |
470 clrf timeout_counter2 | |
471 call PLED_menu_cursor | |
472 | |
473 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
474 | |
475 bcf menubit3 ; clear flag | |
476 bra gassetup_loop | |
477 | |
478 do_gassetup: | |
479 dcfsnz menupos,F | |
480 bra next_gas_page | |
481 dcfsnz menupos,F | |
482 bra adjust_o2 | |
483 dcfsnz menupos,F | |
484 bra adjust_he | |
485 dcfsnz menupos,F | |
486 bra toggle_plus_minus_gassetup | |
487 dcfsnz menupos,F | |
488 bra restore_gas | |
489 exit_gassetup: ; exit... | |
490 movff decodata+0,menupos | |
491 incf menupos,F | |
492 bra menu_gassetup_prelist | |
493 | |
494 toggle_plus_minus_gassetup: | |
495 btg first_FA | |
496 movlw d'4' | |
497 movwf menupos | |
498 bra menu_gassetup1 ; return | |
499 | |
500 next_gas: | |
501 movlw d'1' | |
502 movwf menupos | |
503 bra menu_gassetup0 ; incl. clear screen | |
504 | |
505 adjust_o2: | |
506 movf divemins+0,W ; read current value | |
507 addlw 0x06 | |
508 movwf EEADR | |
509 call read_eeprom ; Low-value | |
510 movff EEDATA,lo | |
511 | |
512 btfsc first_FA ; Minus? | |
513 bra adjust_o2_1 ; yes, minus! | |
514 | |
515 incf lo,F ; increase O2 | |
516 movlw d'101' | |
517 cpfseq lo | |
518 bra adjust_o2_2 | |
519 movlw d'4' ; LOWER O2 Limit | |
520 movwf lo | |
521 bra adjust_o2_2 | |
522 | |
523 adjust_o2_1: | |
524 decf lo,F ; decrease O2 | |
525 movlw d'3' | |
526 cpfseq lo | |
527 bra adjust_o2_2 | |
528 | |
529 movf divemins+0,W | |
530 addlw 0x07 | |
531 movwf EEADR | |
532 call read_eeprom ; read He value | |
533 | |
534 movlw d'100' | |
535 movwf lo | |
536 movf EEDATA,W ; He value | |
537 subwf lo,F ; lo=100% - He% | |
538 | |
539 adjust_o2_2: ; test if O2+He>100... | |
540 movf divemins+0,W | |
541 addlw 0x07 | |
542 movwf EEADR | |
543 call read_eeprom ; read He value | |
544 movf EEDATA,W ; He value | |
545 addwf lo,W ; add O2 value | |
546 movwf hi ; store in temp | |
547 movlw d'101' | |
548 cpfseq hi ; O2 and He > 100? | |
549 bra adjust_o2_3 ; No! | |
550 | |
551 movlw d'4' ; LOWER O2 Limit | |
552 movwf lo | |
553 | |
554 adjust_o2_3: | |
555 movf divemins+0,W ; save current value | |
556 addlw 0x06 | |
557 movwf EEADR | |
558 movff lo,EEDATA | |
559 call write_eeprom ; Low-value | |
560 | |
561 movlw d'2' | |
562 movwf menupos | |
563 bra menu_gassetup1 | |
564 | |
565 adjust_he: | |
566 movf divemins+0,W ; read current value | |
567 addlw 0x07 | |
568 movwf EEADR | |
569 call read_eeprom ; Low-value | |
570 movff EEDATA,lo | |
571 | |
572 btfsc first_FA ; Minus? | |
573 bra adjust_he_1 ; yes, minus! | |
574 | |
575 incf lo,F | |
576 movlw d'92' ; He limited to (useless) 90% | |
577 cpfseq lo | |
578 bra adjust_he_2 | |
579 clrf lo | |
580 bra adjust_he_2 | |
581 | |
582 adjust_he_1: | |
583 decf lo,F ; decrease He | |
584 movlw d'255' | |
585 cpfseq lo | |
586 bra adjust_he_2 | |
587 clrf lo | |
588 | |
589 adjust_he_2: ; test if O2+He>100... | |
590 movf divemins+0,W | |
591 addlw 0x06 | |
592 movwf EEADR | |
593 call read_eeprom ; read He value | |
594 movf EEDATA,W ; He value | |
595 addwf lo,W ; add O2 value | |
596 movwf hi ; store in temp | |
597 movlw d'101' | |
598 cpfseq hi ; O2 and He > 100? | |
599 bra adjust_he_3 ; No! | |
600 ; clrf lo ; Yes, clear He to zero | |
601 decf lo,F ; reduce He again = unchanged after operation | |
602 | |
603 adjust_he_3: | |
604 movf divemins+0,W ; save current value | |
605 addlw 0x07 | |
606 movwf EEADR | |
607 movff lo,EEDATA | |
608 call write_eeprom ; Low-value | |
609 | |
610 movlw d'3' | |
611 movwf menupos | |
612 bra menu_gassetup1 ; | |
613 | |
614 restore_gas: | |
615 movf divemins+0,W ; read Default value | |
616 addlw 0x04 | |
617 movwf EEADR | |
618 call read_eeprom ; Low-value | |
619 movff EEDATA,lo | |
620 movf divemins+0,W | |
621 addlw 0x05 | |
622 movwf EEADR | |
623 call read_eeprom ; High-value | |
624 movff EEDATA,hi | |
625 | |
626 movf divemins+0,W ; save Default value | |
627 addlw 0x06 | |
628 movwf EEADR | |
629 movff lo,EEDATA | |
630 call write_eeprom ; Low-value | |
631 movf divemins+0,W | |
632 addlw 0x07 | |
633 movwf EEADR | |
634 movff hi,EEDATA | |
635 call write_eeprom ; High-value | |
636 | |
637 movlw d'5' | |
638 movwf menupos | |
639 bra menu_gassetup1 ; | |
640 | |
641 | |
642 next_gas_page: | |
643 call PLED_ClearScreen | |
644 movlw d'1' | |
645 movwf menupos | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
646 bcf first_FA ; Here: =1: -, =0: + |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
647 bcf second_FA ; Here: =1: Is first gas |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
648 DISPLAYTEXT .107 ; Depth +/- |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
649 DISPLAYTEXT .108 ; Change: |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
650 DISPLAYTEXT .109 ; Default: |
0 | 651 DISPLAYTEXT .11 ; Exit |
652 | |
653 next_gas_page1: | |
654 clrf timeout_counter2 | |
655 bcf menubit2 | |
656 bcf menubit3 | |
657 | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
658 WIN_TOP .65 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
659 WIN_LEFT .20 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
660 lfsr FSR2,letter |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
661 OUTPUTTEXT .88 ; First Gas? |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
662 PUTC ' ' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
663 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
664 movlw d'33' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
665 movwf EEADR |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
666 call read_eeprom ; Get current startgas 1-5 # into EEDATA |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
667 decf EEDATA,W ; 0-4 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
668 cpfseq decodata+0 ; =current displayed gas #? |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
669 bra menu_firstgas0 ; no, display three spaces |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
670 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
671 OUTPUTTEXT .96 ; Yes |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
672 bsf second_FA ; Is first gas |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
673 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
674 movf decodata+0,W ; read current value |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
675 addlw d'28' ; offset in memory |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
676 movwf EEADR |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
677 call read_eeprom ; Low-value |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
678 clrf EEDATA ; Set change depth to zero |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
679 call write_eeprom ; save result in EEPROM |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
680 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
681 bra menu_firstgas1 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
682 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
683 menu_firstgas0: |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
684 bcf second_FA ; Is not first gas |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
685 STRCAT " " ; 3 spaces. |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
686 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
687 menu_firstgas1: |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
688 call word_processor |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
689 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
690 |
0 | 691 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
692 WIN_TOP .125 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
693 WIN_LEFT .70 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
694 lfsr FSR2,letter |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
695 ; lo still holds change depth |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
696 bsf leftbind |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
697 output_8 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
698 STRCAT_PRINT "m " |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
699 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
700 WIN_TOP .125 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
701 WIN_LEFT .100 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
702 lfsr FSR2,letter |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
703 |
0 | 704 rcall gassetup_show_ppO2 ; Display the ppO2 of the change depth with the current gas |
705 | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
706 movff xC+0,sub_a+0 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
707 movff xC+1,sub_a+1 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
708 GETCUSTOM8 d'46' ; color-code ppO2 warning [cBar] |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
709 mullw d'1' ; ppo2_warning_high*1 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
710 movff PRODL,sub_b+0 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
711 movff PRODH,sub_b+1 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
712 call sub16 ; sub_c = sub_a - sub_b |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
713 btfss neg_flag |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
714 bra gassetup_color_code_ppo2_1; too high -> Warning Color! |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
715 call PLED_standard_color |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
716 bra gassetup_color_code_ppo2_2 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
717 gassetup_color_code_ppo2_1: |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
718 call PLED_warnings_color |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
719 gassetup_color_code_ppo2_2: |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
720 call word_processor |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
721 call PLED_standard_color |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
722 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
723 WIN_TOP .95 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
724 WIN_LEFT .95 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
725 lfsr FSR2,letter |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
726 movlw '+' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
727 btfsc first_FA |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
728 movlw '-' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
729 movwf POSTINC2 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
730 call word_processor |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
731 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
732 ; Show MOD as "default" |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
733 WIN_TOP .155 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
734 WIN_LEFT .78 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
735 lfsr FSR2, letter |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
736 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
737 mullw d'10' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
738 movff PRODL,xA+0 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
739 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
740 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
741 movf divemins+0,W |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
742 addlw 0x06 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
743 movwf EEADR |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
744 call read_eeprom ; O2 value |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
745 movff EEDATA,xB+0 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
746 clrf xB+1 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
747 call div16x16 ; xA/xB=xC with xA as remainder |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
748 movlw d'10' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
749 subwf xC+0,F ; Subtract 10m... |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
750 movff xC+0,lo |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
751 movlw d'0' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
752 subwfb xC+1,F |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
753 movff xC+1,hi |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
754 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
755 btfsc second_FA ; Is first gas? |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
756 clrf lo ; Yes, display 0m |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
757 btfsc second_FA ; Is first gas? |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
758 clrf hi ; Yes, display 0m |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
759 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
760 output_16 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
761 STRCAT_PRINT "m " |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
762 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
763 WIN_TOP .35 |
0 | 764 WIN_LEFT .20 |
765 lfsr FSR2,letter | |
766 OUTPUTTEXT .105 ; "Active Gas? " | |
767 | |
287 | 768 ; Active gas flags in BIT0:4 .... |
0 | 769 movff decodata+0,lo ; Gas 0-4 |
770 incf lo,F ; Gas 1-5 | |
771 | |
287 | 772 read_int_eeprom d'27' ; read flag register |
0 | 773 active_gas_display: |
774 rrcf EEDATA ; roll flags into carry | |
775 decfsz lo,F ; max. 5 times... | |
776 bra active_gas_display | |
777 | |
778 btfss STATUS,C ; test carry | |
779 bra active_gas_display_no | |
780 | |
781 OUTPUTTEXT .96 ; Yes | |
782 bra active_gas_display_end | |
783 | |
784 active_gas_display_no: | |
123 | 785 STRCAT " " ; three spaces instead of "Yes" |
0 | 786 |
787 active_gas_display_end: | |
788 call word_processor | |
789 | |
790 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
791 call PLED_menu_cursor | |
792 | |
793 next_gas_page_loop: | |
794 call check_switches_logbook | |
795 | |
796 btfsc menubit3 | |
797 bra next_gas_page2 ; move cursor | |
798 | |
799 btfsc menubit2 | |
800 bra do_next_gas_page ; call submenu | |
801 | |
802 btfsc divemode | |
803 goto restart ; dive started! | |
804 | |
805 btfsc onesecupdate | |
806 call timeout_surfmode | |
807 | |
808 btfsc onesecupdate | |
809 call set_dive_modes | |
810 | |
811 bcf onesecupdate ; 1 sec. functions done | |
812 | |
813 btfsc sleepmode | |
814 bra exit_gassetup | |
815 | |
816 bra next_gas_page_loop | |
817 | |
818 next_gas_page2: | |
819 incf menupos,F | |
820 | |
821 movlw d'7' | |
822 cpfseq menupos ; =7? | |
823 bra next_gas_page3 ; No | |
824 movlw d'1' | |
825 movwf menupos | |
826 | |
827 next_gas_page3: | |
828 clrf timeout_counter2 | |
829 call PLED_menu_cursor | |
830 | |
831 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
832 | |
833 bcf menubit3 ; clear flag | |
834 bra next_gas_page_loop | |
835 | |
836 do_next_gas_page: | |
837 dcfsnz menupos,F | |
838 bra toggle_active_gas | |
839 dcfsnz menupos,F | |
840 bra make_first_gas | |
841 dcfsnz menupos,F | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
842 bra change_gas_depth_plus_minus |
0 | 843 dcfsnz menupos,F |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
844 bra change_gas_depth_apply |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
845 dcfsnz menupos,F |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
846 bra change_gas_depth_default |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
847 bra next_gas |
0 | 848 |
849 make_first_gas: | |
850 movff decodata+0,EEDATA ; current gas (0-4) into EEDATA | |
851 incf EEDATA,F ; current gas (1-5) into EEDATA | |
852 movlw d'33' | |
853 movwf EEADR | |
854 call write_eeprom ; store in internal EEPROM | |
115 | 855 |
856 ; Set First gas to "Active" | |
857 read_int_eeprom d'27' ; read flag register | |
858 movff decodata+0,lo ; selected gas 0-4 | |
859 incf lo,F | |
860 dcfsnz lo,F | |
861 bsf EEDATA,0 | |
862 dcfsnz lo,F | |
863 bsf EEDATA,1 | |
864 dcfsnz lo,F | |
865 bsf EEDATA,2 | |
866 dcfsnz lo,F | |
867 bsf EEDATA,3 | |
868 dcfsnz lo,F | |
869 bsf EEDATA,4 | |
870 write_int_eeprom d'27' ; write flag register | |
871 | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
872 movlw d'2' |
0 | 873 movwf menupos |
874 bra next_gas_page1 | |
875 | |
876 toggle_active_gas: | |
877 read_int_eeprom d'27' ; read flag register | |
878 movff decodata+0,lo ; selected gas 0-4 | |
879 incf lo,F | |
880 dcfsnz lo,F | |
881 btg EEDATA,0 | |
882 dcfsnz lo,F | |
883 btg EEDATA,1 | |
884 dcfsnz lo,F | |
885 btg EEDATA,2 | |
886 dcfsnz lo,F | |
887 btg EEDATA,3 | |
888 dcfsnz lo,F | |
889 btg EEDATA,4 | |
890 write_int_eeprom d'27' ; write flag register | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
891 movlw d'1' |
0 | 892 movwf menupos |
893 bra next_gas_page1 | |
894 | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
895 change_gas_depth_apply: ; Apply +1 or -1m |
0 | 896 movf decodata+0,W ; read current value |
897 addlw d'28' ; offset in memory | |
898 movwf EEADR | |
899 call read_eeprom ; Low-value | |
900 movff EEDATA,lo | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
901 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
902 btfsc first_FA ; Minus? |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
903 bra change_gas_depth_minus ; yes, minus! |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
904 ; +1m |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
905 |
0 | 906 incf lo,F ; increase depth |
907 movlw d'100' ; Change depth limit + 1 | |
908 cpfseq lo | |
909 bra change_gas_depth_plus2 | |
910 movlw d'99' ; Change depth limit | |
911 movwf lo | |
912 change_gas_depth_plus2: | |
913 movff lo,EEDATA ; write result | |
914 call write_eeprom ; save result in EEPROM | |
915 | |
916 movlw d'4' | |
917 movwf menupos | |
918 bra next_gas_page1 | |
919 | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
920 change_gas_depth_minus: |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
921 decf lo,F ; decrease depth |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
922 btfss lo,7 ; 255? |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
923 bra change_gas_depth_plus2 ; no, exit |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
924 clrf lo |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
925 bra change_gas_depth_plus2 ; exit |
0 | 926 |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
927 change_gas_depth_plus_minus: |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
928 btg first_FA |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
929 movlw d'3' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
930 movwf menupos |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
931 bra next_gas_page1 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
932 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
933 change_gas_depth_default: |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
934 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
935 mullw d'10' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
936 movff PRODL,xA+0 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
937 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
938 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
939 movf divemins+0,W |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
940 addlw 0x06 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
941 movwf EEADR |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
942 call read_eeprom ; O2 value |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
943 movff EEDATA,xB+0 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
944 clrf xB+1 |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
945 call div16x16 ; xA/xB=xC with xA as remainder |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
946 movlw d'10' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
947 subwf xC+0,F ; Subtract 10m... |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
948 movff xC+0,lo |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
949 movlw d'0' |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
950 subwfb xC+1,F |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
951 movff xC+1,hi |
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
952 |
0 | 953 movf decodata+0,W ; read current value |
954 addlw d'28' ; offset in memory | |
955 movwf EEADR | |
956 call read_eeprom ; Low-value | |
957 movff lo,EEDATA ; write result | |
958 call write_eeprom ; save result in EEPROM | |
959 | |
960 movlw d'5' | |
961 movwf menupos | |
962 bra next_gas_page1 | |
963 | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
964 |
0 | 965 ; Changed v1.44se |
966 gassetup_title_bar2: | |
967 call PLED_topline_box | |
968 WIN_INVERT .1 ; Init new Wordprocessor | |
969 WIN_TOP .2 | |
970 WIN_LEFT .0 | |
971 lfsr FSR2,letter | |
972 OUTPUTTEXT .95 ; Gas# | |
973 movff decodata+0,lo | |
974 incf lo,F | |
975 bsf leftbind | |
976 output_99 | |
123 | 977 STRCAT_PRINT ": " |
0 | 978 |
979 WIN_TOP .2 | |
980 WIN_LEFT .50 | |
981 lfsr FSR2,letter | |
982 | |
983 ;He check | |
984 movf divemins+0,W | |
985 addlw 0x07 | |
986 movwf EEADR | |
987 call read_eeprom ; He value | |
988 movff EEDATA,lo ; Move EEData -> lo | |
989 movf lo,f ; Move lo -> f | |
990 movlw d'0' ; Move 0 -> WREG | |
991 cpfsgt lo ; He > 0? | |
992 bra gassetup_title_bar3 ; NO check o2 | |
993 | |
994 ; YES Write TX 15/55 | |
995 call gassetup_write_Tx ; Write TX | |
996 movf divemins+0,W | |
997 addlw 0x06 | |
998 movwf EEADR | |
999 call read_eeprom ; O2 value | |
1000 movff EEDATA,lo | |
1001 output_8 ; Write O2 | |
123 | 1002 PUTC '/' |
0 | 1003 movf divemins+0,W |
1004 addlw 0x07 | |
1005 movwf EEADR | |
1006 call read_eeprom ; He value | |
1007 movff EEDATA,lo | |
1008 output_8 ; Write He | |
1009 bra gassetup_title_bar7 | |
1010 | |
1011 ; New v1.44se | |
1012 gassetup_title_bar3: ; O2 Check | |
1013 movf divemins+0,W | |
1014 addlw 0x06 | |
1015 movwf EEADR | |
1016 call read_eeprom ; O2 value | |
1017 movff EEDATA,lo | |
1018 movf lo,f ; Move lo -> f | |
1019 movlw d'21' ; Move 21 -> WREG | |
1020 cpfseq lo ; o2 = 21 | |
1021 cpfsgt lo ; o2 > 21% | |
1022 bra gassetup_title_bar5 ; NO AIR | |
1023 movlw d'100' ; Move 100 -> WREG | |
1024 cpfslt lo ; o2 < 100% | |
1025 bra gassetup_title_bar4 ; NO write O2 | |
1026 | |
1027 ; YES Write NX 32 | |
1028 call gassetup_write_Nx | |
1029 output_8 | |
1030 bra gassetup_title_bar7 | |
1031 | |
1032 ; New v1.44se | |
1033 gassetup_title_bar4: | |
123 | 1034 STRCAT "O2 " |
0 | 1035 output_8 |
1036 bra gassetup_title_bar7 | |
1037 | |
1038 ; New v1.44se | |
1039 gassetup_title_bar5: | |
1040 cpfseq lo ; o2 = 21% | |
1041 bra gassetup_title_bar6 | |
1042 | |
123 | 1043 STRCAT "AIR " |
0 | 1044 output_8 |
1045 bra gassetup_title_bar7 | |
1046 | |
1047 ; New v1.44se | |
1048 gassetup_title_bar6: ; ERROR | |
123 | 1049 STRCAT "ERR " |
0 | 1050 output_8 |
1051 bra gassetup_title_bar7 | |
1052 | |
1053 gassetup_title_bar7: | |
123 | 1054 STRCAT " in " |
0 | 1055 movf decodata+0,W ; read current value |
1056 addlw d'28' ; offset in memory | |
1057 movwf EEADR | |
1058 call read_eeprom ; Low-value | |
1059 movff EEDATA,lo | |
1060 output_8 | |
123 | 1061 STRCAT_PRINT "m " |
0 | 1062 |
1063 WIN_INVERT .0 ; Init new Wordprocessor | |
1064 return | |
1065 | |
1066 ; New v1.44se | |
1067 gassetup_write_Nx: | |
123 | 1068 STRCAT "NX " |
0 | 1069 return |
1070 | |
1071 ; New v1.44se | |
1072 gassetup_write_Tx: | |
123 | 1073 STRCAT "TX " |
0 | 1074 return |
1075 | |
1076 gassetup_show_ppO2: | |
1077 movf divemins+0,W | |
1078 addlw 0x06 | |
1079 movwf EEADR | |
1080 call read_eeprom ; O2 value | |
1081 movff EEDATA,hi | |
1082 | |
1083 movf decodata+0,W ; read current value | |
1084 addlw d'28' ; offset in memory | |
1085 movwf EEADR | |
1086 call read_eeprom ; Change depth in m | |
1087 movff EEDATA,lo | |
1088 movlw d'10' | |
1089 addwf lo,F ; Depth+10m=lo | |
1090 movf hi,W | |
1091 mulwf lo ; (Depth+10m)*O2 | |
1092 movff PRODL,xA+0 | |
1093 movff PRODH,xA+1 | |
1094 movlw d'10' | |
1095 movwf xB+0 | |
1096 clrf xB+1 | |
1097 call div16x16 ;xA/xB=xC with xA as remainder | |
1098 movff xC+0,lo ; ((Depth+10m)*O2)/10 = [0.01Bar] ppO2 | |
1099 movff xC+1,hi | |
1100 output_16dp d'3' | |
297
ceedf078b2d8
Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents:
290
diff
changeset
|
1101 OUTPUTTEXT d'150' ; bar: |
35 | 1102 return |
1103 | |
227 | 1104 ;============================================================================= |
287 | 1105 ; Make sure first gas is marked active. |
1106 ; Note: - Gas are not soted anymore. | |
1107 ; - Gas with a depth>0 should not be forced active, or it is impossible | |
1108 ; to de-activate them. | |
1109 gassetup_sort_gaslist: | |
286 | 1110 |
287 | 1111 clrf EEADRH ; Select EEPROM lower page. |
1112 read_int_eeprom d'33' ; Get First gas (1-5) | |
1113 movff EEDATA,lo ; into register lo | |
286 | 1114 |
287 | 1115 read_int_eeprom d'27' ; Read selected gases |
286 | 1116 |
287 | 1117 dcfsnz lo,F ; If lo==1 |
1118 bsf EEDATA,0 ; Select Gas1 | |
1119 dcfsnz lo,F ; If lo==2 | |
1120 bsf EEDATA,1 ; Select Gas2 | |
1121 dcfsnz lo,F | |
1122 bsf EEDATA,2 | |
1123 dcfsnz lo,F | |
1124 bsf EEDATA,3 | |
1125 dcfsnz lo,F | |
1126 bsf EEDATA,4 | |
1127 | |
1128 ; Copy result to register: | |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
287
diff
changeset
|
1129 movff EEDATA,gaslist_active |
287 | 1130 |
1131 ; And write to EEPROM too, to survive next reboot: | |
1132 write_int_eeprom d'27' | |
286 | 1133 |
1134 return | |
281 | 1135 |
287 | 1136 ;============================================================================= |
35 | 1137 ; EEPROM Locations of Gaslist |
1138 ; Gas1: | |
1139 ; O2 Default:4 | |
1140 ; He Default:5 | |
1141 ; O2 Current:6 | |
1142 ; He Current:7 | |
1143 ; Change: 28 | |
1144 ; Active: 27,0 | |
1145 | |
1146 ; Gas2: | |
1147 ; O2 Default:8 | |
1148 ; He Default:9 | |
1149 ; O2 Current:10 | |
1150 ; He Current:11 | |
1151 ; Change: 29 | |
1152 ; Active: 27,1 | |
1153 | |
1154 ; Gas3: | |
1155 ; O2 Default:12 | |
1156 ; He Default:13 | |
1157 ; O2 Current:14 | |
1158 ; He Current:15 | |
1159 ; Change: 30 | |
1160 ; Active: 27,2 | |
1161 | |
1162 ; Gas4: | |
1163 ; O2 Default:16 | |
1164 ; He Default:17 | |
1165 ; O2 Current:18 | |
1166 ; He Current:19 | |
1167 ; Change: 31 | |
1168 ; Active: 27,3 | |
1169 | |
1170 ; Gas5: | |
1171 ; O2 Default:20 | |
1172 ; He Default:21 | |
1173 ; O2 Current:22 | |
1174 ; He Current:23 | |
1175 ; Change: 32 | |
1176 ; Active: 27,4 |