annotate code_part1/OSTC_code_asm_part1/menu.asm @ 697:53e41fa1e3f0

BUGFIX Vault low_depth too.
author JeanDo
date Wed, 06 Mar 2013 14:21:48 +0100
parents 8ffbd5cb4b42
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 ; Main Menu and 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: 11/1/05
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
22 ; last updated: 05/15/80
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
23 ; known bugs:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
24 ; ToDo:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
25
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
26 wait_switches:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
27 bcf switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
28 bcf switch_right
41
3ab1188651af 1.63 in work...
heinrichsweikamp
parents: 35
diff changeset
29 return
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
30
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
31 menu:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
32 bcf deco_mode_changed ; Clear flag (Description is only showed once)
41
3ab1188651af 1.63 in work...
heinrichsweikamp
parents: 35
diff changeset
33 bcf LED_blue
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
34 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
35 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
36 menu2:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
37 call DISP_ClearScreen
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
38 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
39 call DISP_menu_mask
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
40 call DISP_menu_cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
42 menu_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
43 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
44
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
45 btfsc menubit2
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 188
diff changeset
46 bra do_menu ; call submenu
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
47
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
48 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
49 goto restart ; exit menu, restart
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
50
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
51 btfsc onesecupdate
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
52 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
53
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
54 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
55
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
56 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 goto restart
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
58
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
59 bra menu_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60
337
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
61 check_switches_menu: ; checks switches
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
62 btfsc uart_dump_screen ; Asked to dump screen contains ?
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
63 call dump_screen ; Yes!
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
64
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
65 btfss switch_right
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 188
diff changeset
66 bra check_switches_menu2
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67 bsf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
68 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 movlw d'6'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70 cpfsgt menupos
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
71 bra refresh_cursor ; Returns
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73 movwf menupos
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
74 bra refresh_cursor ; Returns
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75 check_switches_menu2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76 btfsc switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 bsf menubit2 ; Enter!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
79
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
81 do_menu: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
82 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
83 goto menu_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
84 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85 goto menu_gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
86 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
87 goto menu_reset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 goto setup_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
91 goto more_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93 goto restart ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 refresh_cursor:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 clrf timeout_counter2
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
97 call DISP_menu_cursor
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
98 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 more_menu:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 more_menu2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 bcf leftbind
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
106 call DISP_ClearScreen
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107 more_menu3:
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
108 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
109 call DISP_more_menu_mask
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
110 call DISP_menu_cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 more_menu_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113
125
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
114 ; movlw d'5' ; 5 items in "More Menu"
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
115 ; cpfseq menupos
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
116 ; bra more_menu_loop2
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
117 ; movlw d'6'
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
118 ; movwf menupos
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
119 ; call DISP_menu_cursor
125
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
120
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
121 ;more_menu_loop2:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 bra do_more_menu ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126 bra menu ; exit setup menu and return to main menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 btfsc onesecupdate
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
129 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134 bra menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 bra more_menu_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 do_more_menu: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 goto menu_settime
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142 goto menu_const_ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
143 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144 goto menu_battery_state
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146 goto menu_simulator
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
147 dcfsnz menupos,F
125
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
148 goto altimeter_menu
686
8ffbd5cb4b42 Hard-coded min. Values for CF00 and CF01
heinrichsweikamp
parents: 681
diff changeset
149 movlw d'6'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
150 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151 bra menu2 ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153 setup_menu:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
154 bcf deco_mode_changed ; Clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
155 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157 setup_menu2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 bcf leftbind
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
159 call DISP_ClearScreen
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
160 call DISP_setup_menu_mask
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161 setup_menu3a:
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
162 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
163 call show_decotype
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
164 call DISP_menu_cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
165
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166 setup_menu_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170 bra do_setup_menu ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
172 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173 goto restart ; exit menu, restart and enter surfmode
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
174
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
175 btfsc onesecupdate
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
176 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
177
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181 goto restart ; exit menu, restart and enter surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 bra setup_menu_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 do_setup_menu: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188 goto menu_custom_functions
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190 goto menu_custom_functions_page2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191 dcfsnz menupos,F
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 499
diff changeset
192 bra menu_custom_functions_page3
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194 bra toggle_decotype
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 bra more_setup_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197 bra exit_setup_menu ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 toggle_decotype:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200 bsf deco_mode_changed ; Set flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201 read_int_eeprom d'34' ; Read deco data
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
202 incf EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 toggle_decotype0:
592
cda5b45b953f NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents: 578
diff changeset
205 movlw d'7' ; number of different modes
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
206 cpfseq EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207 bra toggle_decotype1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210 toggle_decotype1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 call write_eeprom ; save new mode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 bra setup_menu3a ; return to manu loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217 show_decotype:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218 read_int_eeprom d'34' ; Read deco data
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219 tstfsz EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 bra show_decotype2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 DISPLAYTEXT .101 ; ZH-L16 OC =0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 show_decotype2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225 bra show_decotype3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226 DISPLAYTEXT .102 ; Gauge =1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228 show_decotype3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 bra show_decotype4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231 DISPLAYTEXT .104 ; ZH-L16 CC =2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233 show_decotype4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
234 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 bra show_decotype5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236 DISPLAYTEXT .138 ; Apnoe =3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 show_decotype5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
240 bra show_decotype6
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241 DISPLAYTEXT .152 ; L16-GF OC =4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243 show_decotype6:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
244 decfsz EEDATA,F
592
cda5b45b953f NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents: 578
diff changeset
245 bra show_decotype7
cda5b45b953f NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents: 578
diff changeset
246 DISPLAYTEXT .236 ; L16-GF CC =5
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 return
592
cda5b45b953f NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents: 578
diff changeset
248 show_decotype7:
cda5b45b953f NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents: 578
diff changeset
249 decfsz EEDATA,F
cda5b45b953f NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents: 578
diff changeset
250 return
cda5b45b953f NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents: 578
diff changeset
251 DISPLAYTEXT .226 ; pSCR-GF =6
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 exit_setup_menu:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255 btfss deco_mode_changed ; Was the decomode changed in Setup menu?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 goto restart ; No, restart to surfacemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
258 call DISP_ClearScreen
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260 deco_info_screen1:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
261 call DISP_topline_box
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263 DISPLAYTEXT .235 ;Decomode changed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266 read_int_eeprom d'34' ; Read deco data
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 movlw d'7' ; length of description text
592
cda5b45b953f NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents: 578
diff changeset
269 mulwf EEDATA ; Multiply with Decomode 0-6
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 movf PRODL,W
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 499
diff changeset
272 addlw .314-.256 ; Description text offset
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 movwf menupos ; Used as loop counter temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 movwf temp1 ; Loop 7 times
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 menu0:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 movf menupos,W
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 499
diff changeset
280 call displaytext_1_high ; Display text!
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 decfsz temp1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 bra menu0 ; loop 7 times
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 movlw d'30'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 call startup_screen3a
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 goto restart ; Restart to surfacemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290 more_setup_menu:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
291 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293 more_setup_menu2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294 bcf leftbind
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
295 call DISP_ClearScreen
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
296 call DISP_more_setup_menu_mask
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
297 more_setup_menu3a:
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
298 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299 call show_debugstate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
300 call show_dateformat
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 499
diff changeset
301 call show_salinity_value
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
302 call DISP_menu_cursor
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
303 call toggle_brightness_show
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
304
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
305 more_setup_menu_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
308 ; movlw d'5' ; x-1 menu entries
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
309 ; cpfseq menupos
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
310 ; bra more_setup_menu_loop2
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
311 ; movlw d'6'
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
312 ; movwf menupos
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
313 ; call DISP_menu_cursor
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
314 ;more_setup_menu_loop2:
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
315 ;
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317 bra do_more_setup_menu ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320 goto restart ; exit menu, restart and enter surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
322 btfsc onesecupdate
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
323 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
325 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
326
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
327 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
328 goto setup_menu ; exit menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
329
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
330 bra more_setup_menu_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
332 do_more_setup_menu: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
334 bra toggle_datemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336 bra toggle_debugmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
337 dcfsnz menupos,F
12
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
338 bra show_license
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
339 dcfsnz menupos,F
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 499
diff changeset
340 bra toggle_salinity
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341 dcfsnz menupos,F
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
342 bra toggle_brightness ; toggle between ECO and HIGH
686
8ffbd5cb4b42 Hard-coded min. Values for CF00 and CF01
heinrichsweikamp
parents: 681
diff changeset
343 movlw d'6' ; set cursor to "More again"
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 bra setup_menu2 ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
346
12
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
347 show_license:
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
348 call startup_screen1 ;1/2
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
349 call startup_screen2 ;1/2
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
350 movlw d'3'
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
351 movwf menupos
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
352 bcf switch_right
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
353 bra more_setup_menu2 ; return to "more menu" loop
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
354
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
355 toggle_salinity:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
356 ; Toggles between 1.00 and 1.04
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357 read_int_eeprom d'26' ; Read Salinity from EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 incf EEDATA,F ; Increase value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
359
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
360 movlw d'99' ; 99% ?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
361 cpfsgt EEDATA ; Salinity lower limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362 bra toggle_salinity_reset ; Out of limit, reset value to 1.00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363 movlw d'105' ; 105% ?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
364 cpfslt EEDATA ; Salinity higher limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365 bra toggle_salinity_reset ; Out of limit, reset value to 1.00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
366
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
367 toggle_salinity2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
368 write_int_eeprom d'26' ; Store salinity
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 499
diff changeset
369 movlw d'4'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
370 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
371 bcf switch_right
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 499
diff changeset
372 bra more_setup_menu3a ; return to manu loop
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
373
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
374 toggle_salinity_reset:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
377 bra toggle_salinity2 ; back
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
378
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
379 show_salinity_value:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
380 read_int_eeprom d'26' ; Read Salinity from EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381 movlw d'99' ; 99% ?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
382 cpfsgt EEDATA ; Salinity lower limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
383 rcall toggle_salinity_reset2 ; Reset before display!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
384 movlw d'105' ; 105% ?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385 cpfslt EEDATA ; Salinity higher limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
386 rcall toggle_salinity_reset2 ; Reset before display!
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 499
diff changeset
387 WIN_TOP .125
183
f720ce017244 Spanish special chars.
JeanDo
parents: 174
diff changeset
388 WIN_LEFT .90 ; +7 for spanish
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389 WIN_FONT FT_SMALL
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
391 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
392 clrf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
393 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394 output_16dp d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395 bcf leftbind
445
6e57b5bb98ce localisation part 1 from Sergei
heinrichsweikamp
parents: 444
diff changeset
396 STRCAT_PRINT TXT_KGL4
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
398
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
399 toggle_salinity_reset2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
400 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
401 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
402 write_int_eeprom d'26' ; Store salinity
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
403 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
405 toggle_datemode:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
406 ; Toggles setting for
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
407 ; MM/DD/YY =0, Default
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
408 ; DD/MM/YY =1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
409 ; YY/MM/DD =2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410 read_int_eeprom d'91' ; Read date format
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
411 incf EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
412 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413 cpfsgt EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
414 bra toggle_datemode1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
415 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
416 toggle_datemode1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
417 write_int_eeprom d'91' ; Store date format
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
418 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
419 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
420 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
421 bra more_setup_menu3a ; return to manu loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
422
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
423 show_dateformat:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
424 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
425 tstfsz EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
426 bra show_dateformat2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
427 DISPLAYTEXTH .259 ; MM/DD/YY = 0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
428 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
429 show_dateformat2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
430 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
431 bra show_dateformat3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
432 DISPLAYTEXTH .260 ; DD/MM/YY = 1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
433 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
434 show_dateformat3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
435 DISPLAYTEXTH .261 ; YY/MM/DD = 2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
436 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
437
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
438 toggle_brightness:
578
fbd5e2b75a63 adding access to CF64-CF95
heinrichsweikamp
parents: 576
diff changeset
439 movlw LOW 0x103
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
440 movwf EEADR
578
fbd5e2b75a63 adding access to CF64-CF95
heinrichsweikamp
parents: 576
diff changeset
441 movlw HIGH 0x103
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
442 movwf EEADRH ; DISPLAY brightness (=0: Eco, =1: High)
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
443 call read_eeprom ; read byte
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
444 bcf DISPLAY_brightness_high ; Eco mode
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
445 movlw .0
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
446 cpfseq EEDATA ; High?
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
447 bsf DISPLAY_brightness_high ; Yes!
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
448
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
449 ; Value loaded, now toggle it...
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
450 btg DISPLAY_brightness_high
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
451
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
452 ; ...Display it...
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
453 rcall toggle_brightness_show
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
454 call DISP_brightness_full ; Set DISPLAY
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
455
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
456 ; ...and write it again to EEPROM
578
fbd5e2b75a63 adding access to CF64-CF95
heinrichsweikamp
parents: 576
diff changeset
457 movlw LOW 0x103
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
458 movwf EEADR
578
fbd5e2b75a63 adding access to CF64-CF95
heinrichsweikamp
parents: 576
diff changeset
459 movlw HIGH 0x103
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
460 movwf EEADRH ; DISPLAY brightness (=0: Eco, =1: High)
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
461 movlw .0
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
462 btfsc DISPLAY_brightness_high
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
463 movlw .1
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
464 movwf EEDATA
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
465 call write_eeprom ; write byte
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
466 clrf EEADRH ; Reset EEADRH
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
467
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
468 movlw d'5'
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
469 movwf menupos
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
470 bcf switch_right
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
471 bra more_setup_menu3a ; return to menu loop
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
472
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
473 toggle_brightness_show:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 592
diff changeset
474 btfsc DISPLAY_brightness_high
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
475 bra toggle_brightness_show2
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
476 DISPLAYTEXTH .312 ; Eco
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
477 return
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
478 toggle_brightness_show2:
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
479 DISPLAYTEXTH .313 ; High
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
480 return
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
481
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
482
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
483 toggle_debugmode:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
484 read_int_eeprom d'39' ; Read status
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
485 incf EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
486 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
487 cpfsgt EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
488 bra toggle_debugmode1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
489 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
490 toggle_debugmode1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
491 write_int_eeprom d'39' ; Store status
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
492 bsf debug_mode ; set flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
493 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
494 cpfseq EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
495 bcf debug_mode ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
496 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
497 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
498 bcf switch_right
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
499 bra more_setup_menu3a ; return to menu loop
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
500
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
501 show_debugstate:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
502 read_int_eeprom d'39'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
503 tstfsz EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
504 bra show_debugstate2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
505 DISPLAYTEXT .131 ; OFF
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
506 show_debugstate2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
507 decf EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
508 tstfsz EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
509 bra show_decotype3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
510 DISPLAYTEXT .130 ; ON
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
511 return
575
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
512
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
513 menu_check_dive_and_timeout:
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
514 call set_dive_modes ; Check thresholds
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
515 call timeout_surfmode ; Sets sleepmode flag if timeout
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
516 btfsc divemode
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
517 goto restart ; dive started!
cbdcbbc91877 some code cleaning
heinrichsweikamp
parents: 574
diff changeset
518 return
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
519
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
520 menu_pre_loop_common: ; Clear some menu flags and the timeout
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
521 clrf timeout_counter2
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
522 bcf leftbind
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
523 bcf sleepmode
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
524 bcf menubit2
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
525 bcf menubit3
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
526 bsf menubit
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
527 bcf switch_left
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
528 bcf switch_right
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 575
diff changeset
529 return