annotate code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 61:f254a568e73d

cleanup
author heinrichsweikamp
date Thu, 05 Aug 2010 09:50:24 +0200
parents 96a35aeda5f2
children 6a94f96e9cea
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
22 ; last updated: 080904
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
23 ; known bugs:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
24 ; ToDo:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
25
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
26 menu_const_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
27 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
28 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
29
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
30 bcf menubit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
31 bcf cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
32 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
33 clrf decodata+0 ; Here: # of SP
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
34 bcf first_FA ; Here: =1: -, =0: +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
35 bcf second_FA ; Here: =1: 1, =0: 10 steps
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
36
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
37 menu_const_ppO20:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
38 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
39 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
40
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
42 DISPLAYTEXT .111 ; Constant ppO2 Setup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
43 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
44
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
45
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
46 menu_const_ppO21:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
47 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
48 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
49 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
50
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
51 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
52 WIN_TOP .35
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
53 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
54 OUTPUTTEXT .112 ; SP#
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
55 movff decodata+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
56 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
58 output_99
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
59 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
61 movlw '('
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
63
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
64 OUTPUTTEXT d'192' ; Dil.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
65 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
66 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
68 read_int_eeprom d'33' ; Read byte (stored in EEDATA)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 movff EEDATA,active_gas ; Read start gas (1-5)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
71 decf active_gas,W ; Gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72 mullw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73 movf PRODL,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
74 addlw d'6' ; = address for O2 ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76 call read_eeprom ; Read O2 ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 movff EEDATA, lo ; O2 ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
79
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
81 output_99
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
82
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
83 movlw '/'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
84 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
86 decf active_gas,W ; Gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
87 mullw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 movf PRODL,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 addlw d'7' ; = address for He ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
91 call read_eeprom ; Read He ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 movff EEDATA,lo ; And copy into hold register
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 output_99
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 movlw ')'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 OUTPUTTEXT .97 ; "Current: "
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 movf decodata+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107 addlw d'36' ; offset in eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 call read_eeprom ; ppO2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 clrf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113 output_16dp d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 bcf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 movlw 'B'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 movlw 'a'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 movlw 'r'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
120 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126 WIN_TOP .95
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
129 OUTPUTTEXT d'190' ; ppO2 +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 WIN_TOP .125
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 OUTPUTTEXT d'191' ; ppO2 -
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
143 OUTPUTTEXT .89 ; "Default: "
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144 movlw '1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146 movlw '.'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
147 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
148 movlw '0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
149 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
150 movlw '0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
154 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
155 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 menu_const_ppO2_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
159 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
160
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161 btfsc menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
162 bra menu_const_ppO22 ; move cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
163
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
165 bra do_menu_const_ppO2 ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168 goto restart ; dive started!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
172
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
175
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
176 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
177
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 bra exit_menu_const_ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181 bra menu_const_ppO2_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 menu_const_ppO22:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187 cpfseq menupos ; =2?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188 bra menu_const_ppO22a ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189 incf menupos,F ; Skip pos. 2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191 menu_const_ppO22a:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
192 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194 bra menu_const_ppO23 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 menu_const_ppO23:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
202 ; debounce switches
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 bcf menubit3 ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205 bra menu_const_ppO2_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
206
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207 do_menu_const_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209 bra next_ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 bra change_ppo2_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213 bra change_ppo2_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 bra change_ppo2_minus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217 bra change_ppo2_reset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218 exit_menu_const_ppO2: ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 goto more_menu2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 change_ppo2_plus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 incf lo,F ; increase depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231 movlw d'251'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233 bra change_ppo2_plus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
234 movlw d'250'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236 change_ppo2_plus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
240 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243 change_ppo2_minus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
244 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 decf lo,F ; decrease depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251 movlw d'255'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 bra change_ppo2_minus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257 change_ppo2_minus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265 change_ppo2_reset: ; reset to 1.00Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 next_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 incf decodata+0,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 cpfseq decodata+0 ; =3?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280 bra next_ppO22
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281 clrf decodata+0 ; yes, so reset to zero
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 next_ppO22:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 bra menu_const_ppO21