annotate code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 640:50ba6255f53e

ccr menu
author heinrichsweikamp
date Thu, 20 Sep 2012 14:29:58 +0200
parents 2ab9e9a8a189
children 2cecac640202
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
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
94 DISPLAYTEXT .106 ; Gas List
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
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
129 movff wait_temp, EEADR ; Gas %He - Set address in internal EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
130 incf EEADR,F ; Gas %He - Set address in internal EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
131 call read_eeprom ; Read He value from EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
132 movff EEDATA,lo ; Move EEDATA -> lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
133 movf lo,f ; Move lo -> f
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
134 movlw d'0' ; Move 0 -> WREG
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
135 cpfsgt lo ; He > 0?
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
136 bra menu_diluentsetup_Nx ; NO check o2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
137
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
138 ; YES Write TX 15/55
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
139 call gassetup_write_Tx
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
140 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
141 call read_eeprom ; O2 value
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
142 movff EEDATA,lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
143 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
144 PUTC '/'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
145 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
146 call read_eeprom ; He value
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
147 movff EEDATA,lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
148 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
149 bra menu_diluentsetup_list0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
150
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
151 ; New v1.44se
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
152 menu_diluentsetup_Nx:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
153 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
154 call read_eeprom ; Read O2 value from EEPROM
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
155 movff EEDATA,lo ; Move EEDATA -> lo
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
156 movf lo,f ; Move lo -> f
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
157 movlw d'21' ; Move 21 -> WREG
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
158 cpfsgt lo ; o2 > 21%
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
159 bra menu_diluentsetup_Air ; NO AIR
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
160 movlw d'100' ; Move 100 -> WREG
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
161 cpfslt lo ; o2 < 100%
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
162 bra menu_diluentsetup_O2 ; NO write O2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
163
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
164 ; YES Write NX 32
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
165 call gassetup_write_Nx
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
166 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
167 bra menu_diluentsetup_list0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
168
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
169 menu_diluentsetup_O2:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
170 STRCAT TXT_O2_3
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
171 output_8
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
172 bra menu_diluentsetup_list0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
173
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
174 menu_diluentsetup_Air:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
175 cpfseq lo ; o2 = 21%
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
176 call menu_gassetup_Err
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
177
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
178 STRCAT TXT_AIR4
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_Err:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
183 STRCAT TXT_ERR4
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
184 output_8
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 menu_diluentsetup_list0:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
187 call word_processor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
188
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
189 incf decodata+0,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
190 movlw d'5'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
191 cpfseq decodata+0
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
192 goto menu_diluentsetup_list
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 DISPLAYTEXT .11 ; Exit
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
195 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
196 call PLED_menu_cursor
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
197 clrf EEADRH
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
198
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
199 menu_diluentsetup_loop:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
200 call check_switches_logbook
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 btfsc menubit3
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
203 bra menu_diluentsetup_list2 ; move cursor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
204
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
205 btfsc menubit2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
206 bra do_diluentsetup_list ; call gas-specific submenu
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
207
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
208 btfsc onesecupdate
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
209 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
210
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
211 bcf onesecupdate ; 1 sec. functions done
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 sleepmode
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
214 bra menu_const_ppO2
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 bra menu_diluentsetup_loop
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
217
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
218 menu_diluentsetup_list2:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
219 incf menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
220 movlw d'7'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
221 cpfseq menupos ; =7?
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
222 bra menu_diluentsetup_list3 ; No
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
223 movlw d'1'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
224 movwf menupos
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_list3:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
227 clrf timeout_counter2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
228 call PLED_menu_cursor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
229
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
230 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
231
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
232 bcf menubit3 ; clear flag
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
233 bra menu_diluentsetup_loop
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
234
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
235
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
236 do_diluentsetup_list:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
237 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
238 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
239 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
240 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
241 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
242 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
243 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
244 bra diluent_list_edit_gas1
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 bra menu_const_ppO2 ; Exit List
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
248
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
249 diluent_list_edit_gas1:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
250 diluent_list_edit_gas2:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
251 diluent_list_edit_gas3:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
252 diluent_list_edit_gas4:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
253 diluent_list_edit_gas5:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
254 bra menu_const_ppO2 ; Exit List
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
255
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
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
258
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
259
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
260
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
261
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
262
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
263
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
264 menu_const_ppO2_setpoints: ; Setpoint menu
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
265 movlw d'1'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
266 movwf menupos
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 bcf menubit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 clrf decodata+0 ; Here: # of SP
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 bcf first_FA ; Here: =1: -, =0: +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 bcf second_FA ; Here: =1: 1, =0: 10 steps
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 menu_const_ppO20:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 DISPLAYTEXT .111 ; Constant ppO2 Setup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 menu_const_ppO21:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 WIN_TOP .35
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 OUTPUTTEXT .112 ; SP#
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 movff decodata+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
291 STRCAT " ("
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293 OUTPUTTEXT d'192' ; Dil.
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
294 PUTC ' '
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
295
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
296 movlw .1
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
297 movwf EEADRH
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
298 addlw d'96' ; = address for O2 ratio
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
300 call read_eeprom ; Read O2 ratio
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
301 movff EEDATA, lo ; O2 ratio
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
302 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
303 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
304 PUTC '/'
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
305 addlw d'97' ; = address for He ratio
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307 call read_eeprom ; Read He ratio
640
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
308 movff EEDATA,lo ; And copy into hold register
50ba6255f53e ccr menu
heinrichsweikamp
parents: 639
diff changeset
309 clrf EEADRH
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
310 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
312 STRCAT_PRINT ")"
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
315 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319 OUTPUTTEXT .97 ; "Current: "
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320 movf decodata+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 addlw d'36' ; offset in eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
322 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
323 call read_eeprom ; ppO2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
325 clrf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
326 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
327 output_16dp d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
328 bcf leftbind
445
6e57b5bb98ce localisation part 1 from Sergei
heinrichsweikamp
parents: 398
diff changeset
329 STRCAT_PRINT TXT_BAR4
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
330
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
332 WIN_TOP .95
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
334 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335 OUTPUTTEXT d'190' ; ppO2 +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
337
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
338 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
339 WIN_TOP .125
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
340
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
342 OUTPUTTEXT d'191' ; ppO2 -
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
346 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
347
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
348 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
349 OUTPUTTEXT .89 ; "Default: "
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
350 STRCAT_PRINT "1.00"
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
351
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
352 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
353 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
354 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
355 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
356
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357 menu_const_ppO2_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
359
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
360 btfsc menubit3
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
361 bra menu_const_ppO22 ; move cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363 btfsc menubit2
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
364 bra do_menu_const_ppO2 ; call submenu
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
366 btfsc onesecupdate
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
367 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
368
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
369 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
370
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
371 btfsc sleepmode
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
372 bra exit_menu_const_ppO2
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
373
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
374 bra menu_const_ppO2_loop
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376 menu_const_ppO22:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
377 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
378
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
379 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
380 cpfseq menupos ; =2?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381 bra menu_const_ppO22a ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
382 incf menupos,F ; Skip pos. 2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
383
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
384 menu_const_ppO22a:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
386 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
387 bra menu_const_ppO23 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
388 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
391 menu_const_ppO23:
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
392 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
393 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394 bra menu_const_ppO2_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
396 do_menu_const_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
398 bra next_ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
399 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
400 bra change_ppo2_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
401 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
402 bra change_ppo2_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
403 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404 bra change_ppo2_minus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
405 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
406 bra change_ppo2_reset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
407 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
408 movwf menupos
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
409 bra menu_const_ppO2_return
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
411 change_ppo2_plus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
412 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
414 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
415 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
416 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
417
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
418 incf lo,F ; increase depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
419 movlw d'251'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
420 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
421 bra change_ppo2_plus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
422 movlw d'250'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
423 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
424 change_ppo2_plus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
425 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
426 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
427 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
428 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
429 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
430
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
431 change_ppo2_minus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
432 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
433 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
434 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
435 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
436 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
437
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
438 decf lo,F ; decrease depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
439 movlw d'255'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
440 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
441 bra change_ppo2_minus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
442 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
443 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
444
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
445 change_ppo2_minus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
446 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
447 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
448
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
449 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
450 movwf menupos
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
451 bra menu_const_ppO21
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
452
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
453 change_ppo2_reset: ; reset to 1.00Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
454 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
455 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
456 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
457 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
458 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
459 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
460 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
461 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
462 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
463
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
464 next_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
465 incf decodata+0,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
466 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
467 cpfseq decodata+0 ; =3?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
468 bra next_ppO22
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
469 clrf decodata+0 ; yes, so reset to zero
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
470 next_ppO22:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
471 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
472 movwf menupos
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
473 bra menu_const_ppO21