annotate code_part1/OSTC_code_asm_part1/menu.asm @ 52:4f6d6f00e685

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