annotate code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 639:2ab9e9a8a189

New CCR Setup Menu (In work)
author heinrichsweikamp
date Thu, 20 Sep 2012 10:06:19 +0200
parents ab2686087bce
children 50ba6255f53e
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
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
114 PUTC TXT_GAS_C
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
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
197
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
198 menu_diluentsetup_loop:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
199 call check_switches_logbook
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
200
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
201 btfsc menubit3
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
202 bra menu_diluentsetup_list2 ; move cursor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
203
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
204 btfsc menubit2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
205 bra do_diluentsetup_list ; call gas-specific submenu
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 btfsc onesecupdate
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
208 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
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 bcf onesecupdate ; 1 sec. functions done
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
211
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
212 btfsc sleepmode
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
213 bra menu_const_ppO2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
214
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
215 bra menu_diluentsetup_loop
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
216
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
217 menu_diluentsetup_list2:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
218 incf menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
219 movlw d'7'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
220 cpfseq menupos ; =7?
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
221 bra menu_diluentsetup_list3 ; No
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
222 movlw d'1'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
223 movwf menupos
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
224
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
225 menu_diluentsetup_list3:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
226 clrf timeout_counter2
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
227 call PLED_menu_cursor
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
228
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
229 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
230
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
231 bcf menubit3 ; clear flag
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
232 bra menu_diluentsetup_loop
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
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
235 do_diluentsetup_list:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
236 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
237 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
238 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
239 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
240 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
241 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
242 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
243 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
244 dcfsnz menupos,F
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
245 bra diluent_list_edit_gas1
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
246 bra menu_const_ppO2 ; Exit List
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
247
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
248 diluent_list_edit_gas1:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
249 diluent_list_edit_gas2:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
250 diluent_list_edit_gas3:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
251 diluent_list_edit_gas4:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
252 diluent_list_edit_gas5:
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
253 bra menu_const_ppO2 ; Exit List
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
254
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 menu_const_ppO2_setpoints: ; Setpoint menu
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
264 movlw d'1'
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
265 movwf menupos
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 bcf menubit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 clrf decodata+0 ; Here: # of SP
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 bcf first_FA ; Here: =1: -, =0: +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 bcf second_FA ; Here: =1: 1, =0: 10 steps
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272 menu_const_ppO20:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 DISPLAYTEXT .111 ; Constant ppO2 Setup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281 menu_const_ppO21:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 WIN_TOP .35
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 OUTPUTTEXT .112 ; SP#
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 movff decodata+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
290 STRCAT " ("
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
291
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292 OUTPUTTEXT d'192' ; Dil.
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
293 PUTC ' '
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
295 read_int_eeprom d'33' ; Read byte (stored in EEDATA)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
296 movff EEDATA,active_gas ; Read start gas (1-5)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
297
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
298 decf active_gas,W ; Gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299 mullw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
300 movf PRODL,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
301 addlw d'6' ; = address for O2 ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
302 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
303 call read_eeprom ; Read O2 ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
304 movff EEDATA, lo ; O2 ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
305
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
308 output_99
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
309
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
310 PUTC '/'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
312 decf active_gas,W ; Gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313 mullw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314 movf PRODL,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
315 addlw d'7' ; = address for He ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317 call read_eeprom ; Read He ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318 movff EEDATA,lo ; And copy into hold register
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
322 STRCAT_PRINT ")"
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
323
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
325 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
326 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
327
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
328 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
329 OUTPUTTEXT .97 ; "Current: "
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
330 movf decodata+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331 addlw d'36' ; offset in eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
332 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333 call read_eeprom ; ppO2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
334 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335 clrf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
337 output_16dp d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
338 bcf leftbind
445
6e57b5bb98ce localisation part 1 from Sergei
heinrichsweikamp
parents: 398
diff changeset
339 STRCAT_PRINT TXT_BAR4
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
340
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
342 WIN_TOP .95
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 OUTPUTTEXT d'190' ; ppO2 +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
346 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
347
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
348 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
349 WIN_TOP .125
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
350
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
351 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
352 OUTPUTTEXT d'191' ; ppO2 -
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
353 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
354
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
355 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
356 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
359 OUTPUTTEXT .89 ; "Default: "
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 0
diff changeset
360 STRCAT_PRINT "1.00"
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
361
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363 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
364 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
366
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
367 menu_const_ppO2_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
368 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
369
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
370 btfsc menubit3
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
371 bra menu_const_ppO22 ; move cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
372
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
373 btfsc menubit2
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
374 bra do_menu_const_ppO2 ; call submenu
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376 btfsc onesecupdate
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
377 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
378
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
379 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
380
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381 btfsc sleepmode
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
382 bra exit_menu_const_ppO2
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
383
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 445
diff changeset
384 bra menu_const_ppO2_loop
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
386 menu_const_ppO22:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
387 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
388
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390 cpfseq menupos ; =2?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
391 bra menu_const_ppO22a ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
392 incf menupos,F ; Skip pos. 2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
393
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394 menu_const_ppO22a:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
396 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 bra menu_const_ppO23 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
398 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
399 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
400
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
401 menu_const_ppO23:
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
402 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
403 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404 bra menu_const_ppO2_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
405
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
406 do_menu_const_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
407 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
408 bra next_ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
409 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410 bra change_ppo2_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
411 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
412 bra change_ppo2_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
414 bra change_ppo2_minus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
415 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
416 bra change_ppo2_reset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
417 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
418 movwf menupos
639
2ab9e9a8a189 New CCR Setup Menu (In work)
heinrichsweikamp
parents: 576
diff changeset
419 bra menu_const_ppO2_return
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
420
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
421 change_ppo2_plus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
422 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
423 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
424 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
425 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
426 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
427
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
428 incf lo,F ; increase depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
429 movlw d'251'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
430 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
431 bra change_ppo2_plus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
432 movlw d'250'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
433 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
434 change_ppo2_plus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
435 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
436 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
437 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
438 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
439 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
440
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
441 change_ppo2_minus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
442 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
443 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
444 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
445 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
446 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
447
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
448 decf lo,F ; decrease depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
449 movlw d'255'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
450 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
451 bra change_ppo2_minus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
452 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
453 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
454
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
455 change_ppo2_minus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
456 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
457 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
458
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
459 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
460 movwf menupos
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
461 bra menu_const_ppO21
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
462
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
463 change_ppo2_reset: ; reset to 1.00Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
464 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
465 addlw d'36' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
466 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
467 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
468 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
469 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
470 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
471 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
472 bra menu_const_ppO21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
473
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
474 next_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
475 incf decodata+0,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
476 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
477 cpfseq decodata+0 ; =3?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
478 bra next_ppO22
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
479 clrf decodata+0 ; yes, so reset to zero
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
480 next_ppO22:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
481 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
482 movwf menupos
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
483 bra menu_const_ppO21