annotate code_part1/OSTC_code_asm_part1/menu.asm @ 575:cbdcbbc91877

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