annotate code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 643:3b50c9949b84

gas6 setup simplified
author heinrichsweikamp
date Wed, 03 Oct 2012 12:40:00 +0200
parents 2cecac640202
children e6ac142e82b0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
2 ; OSTC - diving computer code
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
5 ; This program is free software: you can redistribute it and/or modify
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
6 ; it under the terms of the GNU General Public License as published by
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
7 ; the Free Software Foundation, either version 3 of the License, or
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
8 ; (at your option) any later version.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
9
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
10 ; This program is distributed in the hope that it will be useful,
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
13 ; GNU General Public License for more details.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
14
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
15 ; You should have received a copy of the GNU General Public License
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
17
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
18
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
19 ; Constant ppO2 Setup menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
21 ; written: 08/04/04
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
22 ; last updated: 120920
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
23 ; known bugs:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
24 ; ToDo:
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
25 ;
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
26 ; New in 2.52 Diluents stored seperately in EEPROM Bank1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
27 ; EEPROM BANK1 Byte96-97:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
28 ; Diluent 1 (%O2,%He)
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
29 ; EEPROM BANK1 Byte98-99:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
30 ; Diluent 2 (%O2,%He)
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
31 ; EEPROM BANK1 Byte100-101:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
32 ; Diluent 3 (%O2,%He)
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
33 ; EEPROM BANK1 Byte102-103:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
34 ; Diluent 4 (%O2,%He)
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
35 ; EEPROM BANK1 Byte104-105:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
36 ; Diluent 5 (%O2,%He)
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
37
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
38
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
39 menu_const_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
40 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41 movwf menupos
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
42 menu_const_ppO2_return:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
43 call PLED_ClearScreen
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
44 call PLED_ccr_setup_menu_mask
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
45 call refresh_cursor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
46 call menu_pre_loop_common
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
47
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
48 menu_const_ppO2_preloop:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
49 call check_switches_menu
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
50 movlw d'3'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
51 cpfseq menupos
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
52 bra menu_const_ppO2_preloop2 ; Returns
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
53 movlw d'6'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
54 movwf menupos
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
55 call PLED_menu_cursor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
56
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
57 menu_const_ppO2_preloop2:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
58 btfsc menubit2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
59 bra do_ccr_pre_menu ; call submenu
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
60 btfss menubit
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
61 goto restart ; exit menu, restart
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
62 btfsc onesecupdate
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
63 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
64 bcf onesecupdate ; End of one second tasks
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
65 btfsc sleepmode
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
66 goto restart
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
67 bra menu_const_ppO2_preloop
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
68
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
69 do_ccr_pre_menu:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
70 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
71 goto menu_diluentsetup
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
72 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
73 goto menu_const_ppO2_setpoints
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
74 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
75 goto exit_menu_const_ppO2 ; exit...
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
76 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
77 goto exit_menu_const_ppO2 ; exit...
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
78 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
79 goto exit_menu_const_ppO2 ; exit...
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
80 exit_menu_const_ppO2: ; exit...
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
81 movlw d'2'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
82 movwf menupos
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
83 goto more_menu2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
84
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
85 menu_diluentsetup:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
86 movlw d'1'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
87 movwf menupos
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
88
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
89 menu_diluentsetup_prelist:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
90 call PLED_ClearScreen
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
91 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
92 call PLED_topline_box
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
93 WIN_INVERT .1 ; Init new Wordprocessor
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
94 DISPLAYTEXT .231 ; Dil. Setup - Gaslist
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
95 WIN_INVERT .0 ; Init new Wordprocessor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
96 clrf decodata+0 ; Here: # of gas 0-4
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
97 clrf divemins+0 ; Here: # of Gas * 4
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
98 movlw d'5'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
99 movwf waitms_temp ; here: stores row for gas list
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
100 movlw d'94'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
101 movwf wait_temp ; here: stores eeprom address for gas list
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
102 movlw .1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
103 movwf EEADRH
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
104
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
105 menu_diluentsetup_list:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
106 WIN_LEFT .20
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
107 movlw d'2'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
108 addwf wait_temp,F ; Increase eeprom address for gas list
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
109 movlw d'30'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
110 addwf waitms_temp,F ; Increase row
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
111 movf waitms_temp,W ; Load row into WREG
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
112 movff WREG,win_top
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
113 lfsr FSR2,letter
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
114 PUTC TXT_DIL_C
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
115 movff decodata+0,lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
116 incf lo,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
117 bsf leftbind
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
118 output_99
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
119 PUTC ':'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
120
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
121 menu_diluentsetup_Tx:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
122 call word_processor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
123
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
124 WIN_LEFT .48
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
125 movf waitms_temp,W ; Load row into WREG
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
126 movff WREG,win_top
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
127 lfsr FSR2,letter
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
128
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
129 incf wait_temp, W ; Gas %O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
130 movwf EEADR ; Gas %He - Set address in internal EEPROM
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
131 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
132 movwf EEADRH
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
133 call read_eeprom ; Read He value from EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
134 movff EEDATA,lo ; Move EEDATA -> lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
135 movf lo,f ; Move lo -> f
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
136 movlw d'0' ; Move 0 -> WREG
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
137 cpfsgt lo ; He > 0?
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
138 bra menu_diluentsetup_Nx ; NO check o2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
139
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
140 ; YES Write TX 15/55
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
141 STRCAT TXT_TX3
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
142 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
143 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
144 movwf EEADRH
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
145 call read_eeprom ; O2 value
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
146 movff EEDATA,lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
147 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
148 PUTC '/'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
149 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
150 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
151 movwf EEADRH
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
152 call read_eeprom ; He value
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
153 movff EEDATA,lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
154 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
155 bra menu_diluentsetup_list0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
156
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
157 ; New v1.44se
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
158 menu_diluentsetup_Nx:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
159 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
160 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
161 movwf EEADRH
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
162 call read_eeprom ; Read O2 value from EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
163 movff EEDATA,lo ; Move EEDATA -> lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
164 movf lo,f ; Move lo -> f
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
165 movlw d'21' ; Move 21 -> WREG
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
166 cpfsgt lo ; o2 > 21%
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
167 bra menu_diluentsetup_Air ; NO AIR
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
168 movlw d'100' ; Move 100 -> WREG
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
169 cpfslt lo ; o2 < 100%
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
170 bra menu_diluentsetup_O2 ; NO write O2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
171
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
172 ; YES Write NX 32
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
173 STRCAT TXT_NX3
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
174 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
175 bra menu_diluentsetup_list0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
176
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
177 menu_diluentsetup_O2:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
178 STRCAT TXT_O2_3
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
179 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
180 bra menu_diluentsetup_list0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
181
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
182 menu_diluentsetup_Air:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
183 cpfseq lo ; o2 = 21%
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
184 bra menu_diluentsetup_Err
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
185
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
186 STRCAT TXT_AIR4
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
187 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
188 bra menu_diluentsetup_list0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
189
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
190 menu_diluentsetup_Err:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
191 STRCAT TXT_ERR4
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
192 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
193
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
194 menu_diluentsetup_list0:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
195 call word_processor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
196
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
197 incf decodata+0,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
198 movlw d'5'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
199 cpfseq decodata+0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
200 goto menu_diluentsetup_list
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
201
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
202 DISPLAYTEXT .11 ; Exit
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
203 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
204 call PLED_menu_cursor
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
205 clrf EEADRH
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
206
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
207 menu_diluentsetup_loop:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
208 call check_switches_logbook
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
209
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
210 btfsc menubit3
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
211 bra menu_diluentsetup_list2 ; move cursor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
212
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
213 btfsc menubit2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
214 bra do_diluentsetup_list ; call gas-specific submenu
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
215
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
216 btfsc onesecupdate
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
217 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
218
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
219 bcf onesecupdate ; 1 sec. functions done
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
220
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
221 btfsc sleepmode
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
222 bra menu_const_ppO2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
223
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
224 bra menu_diluentsetup_loop
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
225
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
226 menu_diluentsetup_list2:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
227 incf menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
228 movlw d'7'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
229 cpfseq menupos ; =7?
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
230 bra menu_diluentsetup_list3 ; No
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
231 movlw d'1'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
232 movwf menupos
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
233
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
234 menu_diluentsetup_list3:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
235 clrf timeout_counter2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
236 call PLED_menu_cursor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
237
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
238 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
239
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
240 bcf menubit3 ; clear flag
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
241 bra menu_diluentsetup_loop
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
242
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
243
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
244 do_diluentsetup_list:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
245 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
246 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
247 dcfsnz menupos,F
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
248 bra diluent_list_edit_gas2
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
249 dcfsnz menupos,F
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
250 bra diluent_list_edit_gas3
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
251 dcfsnz menupos,F
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
252 bra diluent_list_edit_gas4
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
253 dcfsnz menupos,F
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
254 bra diluent_list_edit_gas5
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
255 bra menu_const_ppO2 ; Exit List
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
256
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
257 diluent_list_edit_gas1:
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
258 movlw d'0' ; Diluent Number 0-4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
259 movwf decodata+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
260 movlw d'96' ; EEPROM address of %O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
261 movwf divemins+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
262 bra menu_diluentgas
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
263 diluent_list_edit_gas2:
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
264 movlw d'1' ; Diluent Number 0-4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
265 movwf decodata+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
266 movlw d'98' ; EEPROM address of %O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
267 movwf divemins+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
268 bra menu_diluentgas
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
269 diluent_list_edit_gas3:
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
270 movlw d'2' ; Diluent Number 0-4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
271 movwf decodata+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
272 movlw d'100' ; EEPROM address of %O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
273 movwf divemins+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
274 bra menu_diluentgas
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
275 diluent_list_edit_gas4:
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
276 movlw d'3' ; Diluent Number 0-4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
277 movwf decodata+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
278 movlw d'102' ; EEPROM address of %O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
279 movwf divemins+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
280 bra menu_diluentgas
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
281 diluent_list_edit_gas5:
642
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
282 movlw d'4' ; Diluent Number 0-4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
283 movwf decodata+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
284 movlw d'104' ; EEPROM address of %O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
285 movwf divemins+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
286 ; bra menu_diluentgas
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
287 menu_diluentgas:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
288 movlw d'1'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
289 movwf menupos
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
290 bcf menubit4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
291 bcf first_FA ; Here: =1: -, =0: +
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
292
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
293 menu_diluentgas0:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
294 call PLED_ClearScreen
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
295 WIN_LEFT .20
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
296 WIN_TOP .155
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
297 lfsr FSR2, letter
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
298 OUTPUTTEXT .11 ; Exit
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
299 STRCAT_PRINT ""
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
300
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
301 menu_diluentgas1:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
302 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
303
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
304 call diluent_title_bar2 ; Displays the title bar with the current Gas info
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
305
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
306 WIN_LEFT .20
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
307 WIN_TOP .35
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
308 STRCPY TXT_O2_4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
309 movff divemins+0,EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
310 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
311 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
312 call read_eeprom ; O2 value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
313 movff EEDATA,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
314 output_8
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
315 STRCAT_PRINT "% "
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
316
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
317 ; Show MOD in m
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
318 WIN_LEFT .90
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
319 lfsr FSR2, letter
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
320 OUTPUTTEXTH .297 ; MOD:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
321
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
322 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
323 mullw d'10'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
324 movff PRODL,xA+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
325 movff PRODH,xA+1 ; ppO2 in [0.01bar] * 10
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
326 movff divemins+0,EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
327 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
328 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
329 call read_eeprom ; O2 value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
330 movff EEDATA,xB+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
331 clrf xB+1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
332 call div16x16 ; xA/xB=xC with xA as remainder
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
333 movlw d'10'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
334 subwf xC+0,F ; Subtract 10m...
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
335 movff xC+0,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
336 movlw d'0'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
337 subwfb xC+1,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
338 movff xC+1,hi
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
339
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
340 output_16
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
341 STRCAT_PRINT TXT_METER3
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
342
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
343 WIN_LEFT .20
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
344 WIN_TOP .65
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
345 STRCPY TXT_HE4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
346 incf divemins+0,W
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
347 movwf EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
348 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
349 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
350 call read_eeprom ; He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
351 movff EEDATA,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
352 output_8
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
353 STRCAT_PRINT "% "
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
354
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
355 ; Show END in m
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
356 lfsr FSR2, letter
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
357 WIN_LEFT .90
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
358 OUTPUTTEXTH .298 ; END:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
359 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
360 mullw d'10'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
361 movff PRODL,xA+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
362 movff PRODH,xA+1 ; ppO2 in [0.01bar] * 10
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
363 movff divemins+0,EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
364 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
365 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
366 call read_eeprom ; O2 value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
367 movff EEDATA,xB+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
368 clrf xB+1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
369 call div16x16 ; xA/xB=xC with xA as remainder
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
370 movlw d'10'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
371 subwf xC+0,F ; Subtract 10m...
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
372 movff xC+0,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
373 movlw d'0'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
374 subwfb xC+1,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
375 movff xC+1,hi ; lo:hi holding MOD in meters
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
376 movlw d'10'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
377 addwf lo,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
378 movlw d'0'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
379 addwfc hi,F ; lo:hi holding MOD+10m
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
380
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
381 incf divemins+0,W
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
382 movwf EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
383 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
384 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
385 call read_eeprom ; He value in % -> EEDATA
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
386 movlw d'100'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
387 movwf xA+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
388 movf EEDATA,W ; He value in % -> EEDATA
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
389 subwf xA+0,F ; xA+0 = 100 - He Value in %
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
390 clrf xA+1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
391 movff lo,xB+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
392 movff hi,xB+1 ; Copy MOD+10
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
393 call mult16x16 ; xA*xB=xC
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
394 movff xC+0,xA+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
395 movff xC+1,xA+1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
396 movlw d'100'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
397 movwf xB+0
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
398 clrf xB+1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
399 call div16x16 ; xA/xB=xC with xA as remainder
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
400 ; xC:2 = ((MOD+10) * 100 - HE Value in %) / 100
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
401 movlw d'10'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
402 subwf xC+0,F ; Subtract 10m...
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
403 movff xC+0,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
404 movlw d'0'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
405 subwfb xC+1,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
406 movff xC+1,hi
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
407 output_16
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
408 STRCAT_PRINT TXT_METER3
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
409
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
410 WIN_LEFT .20
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
411 WIN_TOP .95
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
412 STRCPY "+/-: "
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
413 movlw '+'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
414 btfsc first_FA
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
415 movlw '-'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
416 movwf POSTINC2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
417 call word_processor
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
418
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
419 WIN_TOP .125
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
420 lfsr FSR2,letter
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
421 OUTPUTTEXT .89 ; Default:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
422 movlw .21
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
423 movwf lo ; Default always Air
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
424 output_8
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
425 PUTC '/'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
426 clrf lo ; Default He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
427 output_8
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
428 STRCAT_PRINT " "
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
429
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
430 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
431 call PLED_menu_cursor
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
432
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
433 diluentgassetup_loop:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
434 call check_switches_logbook
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
435
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
436 btfsc menubit3
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
437 bra diluentgassetup2 ; move cursor
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
438
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
439 btfsc menubit2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
440 bra do_diluentgassetup ; call submenu
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
441
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
442 btfsc onesecupdate
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
443 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
444
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
445 bcf onesecupdate ; 1 sec. functions done
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
446
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
447 btfsc sleepmode
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
448 bra exit_menu_const_ppO2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
449
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
450 bra diluentgassetup_loop
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
451
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
452 diluentgassetup2:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
453 incf menupos,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
454 movlw d'6'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
455 cpfseq menupos ; =6?
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
456 bra diluentgassetup3 ; No
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
457 movlw d'1'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
458 movwf menupos
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
459
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
460 diluentgassetup3:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
461 clrf timeout_counter2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
462 call PLED_menu_cursor
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
463
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
464 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
465
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
466 bcf menubit3 ; clear flag
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
467 bra diluentgassetup_loop
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
468
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
469 do_diluentgassetup:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
470 dcfsnz menupos,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
471 bra adjust_o2_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
472 dcfsnz menupos,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
473 bra adjust_he_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
474 dcfsnz menupos,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
475 bra toggle_plus_minus_diluentsetup
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
476 dcfsnz menupos,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
477 bra restore_gas_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
478 exit_diluentgassetup: ; exit...
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
479 movff decodata+0,menupos
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
480 incf menupos,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
481 bra menu_diluentsetup_prelist
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
482
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
483 toggle_plus_minus_diluentsetup:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
484 btg first_FA
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
485 movlw d'3'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
486 movwf menupos
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
487 bra menu_diluentgas1 ; return
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
488
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
489 adjust_o2_diluent:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
490 movff divemins+0,EEADR ; read current value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
491 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
492 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
493 call read_eeprom ; Low-value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
494 movff EEDATA,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
495
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
496 btfsc first_FA ; Minus?
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
497 bra adjust_o2_1_diluent ; yes, minus!
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
498
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
499 incf lo,F ; increase O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
500 movlw d'101'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
501 cpfseq lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
502 bra adjust_o2_2_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
503 movlw d'4' ; LOWER O2 Limit
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
504 movwf lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
505 bra adjust_o2_2_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
506
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
507 adjust_o2_1_diluent:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
508 decf lo,F ; decrease O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
509 movlw d'3'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
510 cpfseq lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
511 bra adjust_o2_2_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
512
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
513 incf divemins+0,W
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
514 movwf EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
515 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
516 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
517 call read_eeprom ; read He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
518
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
519 movlw d'100'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
520 movwf lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
521 movf EEDATA,W ; He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
522 subwf lo,F ; lo=100% - He%
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
523
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
524 adjust_o2_2_diluent: ; test if O2+He>100...
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
525 incf divemins+0,W
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
526 movwf EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
527 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
528 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
529 call read_eeprom ; read He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
530 movf EEDATA,W ; He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
531 addwf lo,W ; add O2 value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
532 movwf hi ; store in temp
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
533 movlw d'101'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
534 cpfseq hi ; O2 and He > 100?
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
535 bra adjust_o2_3_diluent ; No!
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
536
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
537 movlw d'4' ; LOWER O2 Limit
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
538 movwf lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
539
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
540 adjust_o2_3_diluent:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
541 movff divemins+0,EEADR ; save current value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
542 movff lo,EEDATA
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
543 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
544 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
545 call write_eeprom ; Low-value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
546
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
547 movlw d'1'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
548 movwf menupos
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
549 bra menu_diluentgas1 ; return
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
550
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
551 adjust_he_diluent:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
552 incf divemins+0,W
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
553 movwf EEADR ; read current value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
554 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
555 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
556 call read_eeprom ; Low-value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
557 movff EEDATA,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
558
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
559 btfsc first_FA ; Minus?
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
560 bra adjust_he_1_diluent ; yes, minus!
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
561
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
562 incf lo,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
563 movlw d'92' ; He limited to (useless) 90%
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
564 cpfseq lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
565 bra adjust_he_2_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
566 clrf lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
567 bra adjust_he_2_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
568
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
569 adjust_he_1_diluent:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
570 decf lo,F ; decrease He
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
571 movlw d'255'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
572 cpfseq lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
573 bra adjust_he_2_diluent
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
574 clrf lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
575
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
576 adjust_he_2_diluent: ; test if O2+He>100...
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
577 incf divemins+0,W
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
578 movwf EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
579 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
580 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
581 call read_eeprom ; read He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
582 movf EEDATA,W ; He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
583 addwf lo,W ; add O2 value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
584 movwf hi ; store in temp
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
585 movlw d'101'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
586 cpfseq hi ; O2 and He > 100?
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
587 bra adjust_he_3_diluent ; No!
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
588 ; clrf lo ; Yes, clear He to zero
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
589 decf lo,F ; reduce He again = unchanged after operation
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
590
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
591 adjust_he_3_diluent:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
592 incf divemins+0,W ; save current value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
593 movwf EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
594 movff lo,EEDATA
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
595 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
596 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
597 call write_eeprom ; Low-value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
598
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
599 movlw d'2'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
600 movwf menupos
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
601 bra menu_diluentgas1 ;
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
602
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
603 restore_gas_diluent:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
604 movff divemins+0,EEADR ; save Default value (O2)
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
605 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
606 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
607 movlw .21 ; Always Air
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
608 movwf EEDATA
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
609 call write_eeprom
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
610 incf EEADR,F ; Point to He
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
611 clrf EEDATA
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
612 call write_eeprom
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
613 movlw d'4'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
614 movwf menupos
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
615 bra menu_diluentgas1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
616
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
617
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
618 diluent_title_bar2:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
619 call PLED_topline_box
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
620 WIN_INVERT .1 ; Init new Wordprocessor
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
621 WIN_TOP .2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
622 WIN_LEFT .30
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
623 lfsr FSR2,letter
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
624 STRCAT TXT_DIL5 ; Dil.#
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
625 movff decodata+0,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
626 incf lo,F
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
627 bsf leftbind
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
628 output_99
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
629 STRCAT_PRINT ": "
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
630
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
631 WIN_TOP .2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
632 WIN_LEFT .80
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
633 lfsr FSR2,letter
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
634
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
635 ;He check
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
636 incf divemins+0,W
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
637 movwf EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
638 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
639 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
640 call read_eeprom ; He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
641 movff EEDATA,lo ; Move EEData -> lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
642 movf lo,f ; Move lo -> f
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
643 movlw d'0' ; Move 0 -> WREG
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
644 cpfsgt lo ; He > 0?
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
645 bra diluent_title_bar3 ; NO check o2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
646
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
647 ; YES Write TX 15/55
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
648 STRCAT TXT_TX3
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
649 movff divemins+0,EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
650 movlw .1
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
651 movwf EEADRH
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
652 call read_eeprom ; O2 value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
653 movff EEDATA,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
654 output_8 ; Write O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
655 PUTC '/'
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
656 incf divemins+0,W
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
657 movwf EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
658 call read_eeprom ; He value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
659 movff EEDATA,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
660 output_8 ; Write He
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
661 bra diluent_title_bar7
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
662
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
663 ; New v1.44se
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
664 diluent_title_bar3: ; O2 Check
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
665 movff divemins+0,EEADR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
666 call read_eeprom ; O2 value
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
667 movff EEDATA,lo
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
668 movf lo,f ; Move lo -> f
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
669 movlw d'21' ; Move 21 -> WREG
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
670 cpfseq lo ; o2 = 21
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
671 cpfsgt lo ; o2 > 21%
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
672 bra diluent_title_bar5 ; NO AIR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
673 movlw d'100' ; Move 100 -> WREG
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
674 cpfslt lo ; o2 < 100%
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
675 bra diluent_title_bar4 ; NO write O2
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
676
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
677 ; YES Write NX 32
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
678 STRCAT TXT_NX3
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
679 output_8
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
680 bra diluent_title_bar7
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
681
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
682 ; New v1.44se
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
683 diluent_title_bar4:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
684 STRCAT TXT_O2_3
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
685 output_8
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
686 bra diluent_title_bar7
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
687
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
688 ; New v1.44se
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
689 diluent_title_bar5:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
690 cpfseq lo ; o2 = 21%
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
691 bra diluent_title_bar6
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
692
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
693 STRCAT TXT_AIR4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
694 output_8
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
695 bra diluent_title_bar7
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
696
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
697 ; New v1.44se
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
698 diluent_title_bar6: ; ERROR
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
699 STRCAT TXT_ERR4
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
700 output_8
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
701 ;bra diluent_title_bar7
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
702
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
703 diluent_title_bar7:
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
704 STRCAT_PRINT ""
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
705 WIN_INVERT .0 ; Init new Wordprocessor
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
706 return
2cecac640202 Diluent setup menu work
heinrichsweikamp
parents: 640
diff changeset
707
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
708
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
709 ; ***
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
710
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
711
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
712
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
713
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
714
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
715
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
716
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
717 menu_const_ppO2_setpoints: ; Setpoint menu
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
718 movlw d'1'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
719 movwf menupos
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
720
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
721 bcf menubit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
722 clrf decodata+0 ; Here: # of SP
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
723 bcf first_FA ; Here: =1: -, =0: +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
724 bcf second_FA ; Here: =1: 1, =0: 10 steps
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
725
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
726 menu_const_ppO20:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
727 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
728 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
729
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
730 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
731 DISPLAYTEXT .111 ; Constant ppO2 Setup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
732 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
733
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
734
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
735 menu_const_ppO21:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
736 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
737 WIN_TOP .35
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
738 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
739 OUTPUTTEXT .112 ; SP#
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
740 movff decodata+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
741 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
742 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
743 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
744 STRCAT " ("
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
745
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
746 OUTPUTTEXT d'192' ; Dil.
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
747 PUTC ' '
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
748
643
3b50c9949b84 gas6 setup simplified
heinrichsweikamp
parents: 642
diff changeset
749 movlw d'96' ; = address for O2 ratio
3b50c9949b84 gas6 setup simplified
heinrichsweikamp
parents: 642
diff changeset
750 movwf EEADR
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
751 movlw .1
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
752 movwf EEADRH
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
753 call read_eeprom ; Read O2 ratio
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
754 movff EEDATA, lo ; O2 ratio
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
755 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
756 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
757 PUTC '/'
643
3b50c9949b84 gas6 setup simplified
heinrichsweikamp
parents: 642
diff changeset
758 movlw d'97' ; = address for He ratio
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
759 movwf EEADR
643
3b50c9949b84 gas6 setup simplified
heinrichsweikamp
parents: 642
diff changeset
760 movlw .1
3b50c9949b84 gas6 setup simplified
heinrichsweikamp
parents: 642
diff changeset
761 movwf EEADRH
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
762 call read_eeprom ; Read He ratio
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
763 movff EEDATA,lo ; And copy into hold register
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
764 clrf EEADRH
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
765 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
766 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
767 STRCAT_PRINT ")"
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
768
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
769
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
770 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
771 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
772
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
773 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
774 OUTPUTTEXT .97 ; "Current: "
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
775 movf decodata+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
776 addlw d'36' ; offset in eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
777 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
778 call read_eeprom ; ppO2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
779 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
780 clrf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
781 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
782 output_16dp d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
783 bcf leftbind
445
6e57b5bb98ce localisation part 1 from Sergei
heinrichsweikamp
parents: 398
diff changeset
784 STRCAT_PRINT TXT_BAR4
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
785
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
786 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
787 WIN_TOP .95
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
788
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
789 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
790 OUTPUTTEXT d'190' ; ppO2 +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
791 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
792
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
793 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
794 WIN_TOP .125
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
795
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
796 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
797 OUTPUTTEXT d'191' ; ppO2 -
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
798 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
799
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
800 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
801 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
802
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
803 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
804 OUTPUTTEXT .89 ; "Default: "
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
805 STRCAT_PRINT "1.00"
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
806
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
807 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
808 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
809 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
810 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
811
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
812 menu_const_ppO2_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
813 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
814
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
815 btfsc menubit3
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
816 bra menu_const_ppO22 ; move cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
817
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
818 btfsc menubit2
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
819 bra do_menu_const_ppO2 ; call submenu
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
820
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
821 btfsc onesecupdate
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
822 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
823
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
824 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
825
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
826 btfsc sleepmode
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
827 bra exit_menu_const_ppO2
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
828
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
829 bra menu_const_ppO2_loop
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
830
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
831 menu_const_ppO22:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
832 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
833
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
834 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
835 cpfseq menupos ; =2?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
836 bra menu_const_ppO22a ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
837 incf menupos,F ; Skip pos. 2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
838
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
839 menu_const_ppO22a:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
840 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
841 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
842 bra menu_const_ppO23 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
843 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
844 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
845
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
846 menu_const_ppO23:
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
847 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
848 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
849 bra menu_const_ppO2_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
850
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
851 do_menu_const_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
852 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
853 bra next_ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
854 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
855 bra change_ppo2_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
856 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
857 bra change_ppo2_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
858 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
859 bra change_ppo2_minus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
860 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
861 bra change_ppo2_reset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
862 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
863 movwf menupos
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
864 bra menu_const_ppO2_return
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
865
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
866 change_ppo2_plus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
867 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
868 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
869 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
870 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
871 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
872
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
873 incf lo,F ; increase depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
874 movlw d'251'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
875 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
876 bra change_ppo2_plus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
877 movlw d'250'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
878 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
879 change_ppo2_plus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
880 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
881 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
882 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
883 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
884 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
885
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
886 change_ppo2_minus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
887 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
888 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
889 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
890 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
891 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
892
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
893 decf lo,F ; decrease depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
894 movlw d'255'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
895 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
896 bra change_ppo2_minus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
897 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
898 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
899
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
900 change_ppo2_minus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
901 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
902 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
903
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
904 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
905 movwf menupos
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
906 bra menu_const_ppO21
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
907
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
908 change_ppo2_reset: ; reset to 1.00Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
909 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
910 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
911 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
912 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
913 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
914 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
915 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
916 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
917 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
918
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
919 next_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
920 incf decodata+0,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
921 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
922 cpfseq decodata+0 ; =3?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
923 bra next_ppO22
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
924 clrf decodata+0 ; yes, so reset to zero
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
925 next_ppO22:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
926 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
927 movwf menupos
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
928 bra menu_const_ppO21