annotate code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 709:74878be38d4c

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