annotate code_part1/OSTC_code_asm_part1/menu.asm @ 561:57622cb0d80f bug_deco_clearing_missed_stops

Bad deco behaviour when missing a stop...
author JeanDo
date Fri, 24 Feb 2012 00:16:46 +0100
parents 2ac77db9c150
children 101fec6a6137
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
61
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
63 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
64
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
65 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
66 call test_charger ; check if charger IC is active
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
68 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 call get_battery_voltage ; get battery voltage
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
71 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
74 goto restart
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 goto restart ; exit menu, restart and enter divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
79 bra menu_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80
337
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
81 check_switches_menu: ; checks switches
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
82 btfsc uart_dump_screen ; Asked to dump screen contains ?
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
83 call dump_screen ; Yes!
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
84
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85 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
86 bra check_switches_menu2
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
87 bsf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 movlw d'6'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 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
91 bra refresh_cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93 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
94 bra refresh_cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 check_switches_menu2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 btfsc switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97 bsf menubit2 ; Enter!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 do_menu: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103 goto menu_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 goto menu_gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107 goto menu_reset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 goto setup_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 goto more_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113 goto restart ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 refresh_cursor:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 btfsc cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 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
120 bcf switch_left
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 more_menu:
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 more_menu2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127 bcf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
129 more_menu3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134 bsf menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135 bsf cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 call PLED_more_menu_mask
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 bcf switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 more_menu_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142
125
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
143 ; movlw d'5' ; 5 items in "More Menu"
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
144 ; cpfseq menupos
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
145 ; bra more_menu_loop2
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
146 ; movlw d'6'
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
147 ; movwf menupos
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
148 ; call PLED_menu_cursor
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
149
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
150 ;more_menu_loop2:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152 bra do_more_menu ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
154 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
155 bra menu ; exit setup menu and return to main menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
159
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
160 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
162
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
163 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164 call test_charger ; check if charger IC is active
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
165
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167 call get_battery_voltage ; get battery voltage
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
172 bra menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
175 goto restart ; exit menu, restart and enter divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
176
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
177 bra more_menu_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 do_more_menu: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181 goto menu_settime
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 goto menu_const_ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185 goto menu_battery_state
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187 goto menu_simulator
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188 dcfsnz menupos,F
125
2907b42c195b Altimeter:
JeanDo
parents: 123
diff changeset
189 goto altimeter_menu
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
192 bra menu2 ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194 setup_menu:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195 bcf deco_mode_changed ; Clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 setup_menu2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 bcf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201 call PLED_setup_menu_mask
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
202 setup_menu3a:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
206 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207 bsf menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208 bsf cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209 call show_decotype
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210 call show_salinity_value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 bcf switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 setup_menu_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219 bra do_setup_menu ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222 goto restart ; exit menu, restart and enter surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228 call test_charger ; check if charger IC is active
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 call get_battery_voltage ; get battery voltage
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
234 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 goto restart ; exit menu, restart and enter surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 goto restart ; exit menu, restart and enter divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
240 bra setup_menu_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243 do_setup_menu: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
244 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245 goto menu_custom_functions
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 goto menu_custom_functions_page2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249 bra toggle_salinity
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251 bra toggle_decotype
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 bra more_setup_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 bra exit_setup_menu ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 toggle_decotype:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257 bsf deco_mode_changed ; Set flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258 read_int_eeprom d'34' ; Read deco data
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 incf EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 toggle_decotype0:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 movlw d'6' ; number of different modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263 cpfseq EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264 bra toggle_decotype1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 toggle_decotype1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 call write_eeprom ; save new mode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272 bra setup_menu3a ; return to manu loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 show_decotype:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 read_int_eeprom d'34' ; Read deco data
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 tstfsz EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 bra show_decotype2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 DISPLAYTEXT .101 ; ZH-L16 OC =0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280 show_decotype2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 bra show_decotype3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 DISPLAYTEXT .102 ; Gauge =1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 show_decotype3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 bra show_decotype4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 DISPLAYTEXT .104 ; ZH-L16 CC =2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290 show_decotype4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
291 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292 bra show_decotype5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293 DISPLAYTEXT .138 ; Apnoe =3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
295 show_decotype5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
296 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
297 bra show_decotype6
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
298 DISPLAYTEXT .152 ; L16-GF OC =4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
300 show_decotype6:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
301 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
302 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
303 DISPLAYTEXT .236 ; L16-GF CC =5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
304 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
305
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 exit_setup_menu:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307 btfss deco_mode_changed ; Was the decomode changed in Setup menu?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
308 goto restart ; No, restart to surfacemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
309
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
310 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
312 deco_info_screen1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
315 DISPLAYTEXT .235 ;Decomode changed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318 read_int_eeprom d'34' ; Read deco data
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320 movlw d'7' ; length of description text
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 mulwf EEDATA ; Multiply with Decomode 0-5 (5=Spare)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
322
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
323 movf PRODL,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324 addlw d'193' ; Description text offset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
325 movwf menupos ; Used as loop counter temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
326
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
327 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
328 movwf temp1 ; Loop 7 times
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
329
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
330 menu0:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331 movf menupos,W
174
53b16a746166 Multi-lang
JeanDo
parents: 129
diff changeset
332 call displaytext_1_low ; Display text!
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
334
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335 decfsz temp1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336 bra menu0 ; loop 7 times
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
337
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
338 movlw d'30'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
339 call startup_screen3a
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
340 goto restart ; Restart to surfacemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
342 more_setup_menu:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 more_setup_menu2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
346 bcf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
347 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
348 call PLED_more_setup_menu_mask
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
349 more_setup_menu3a:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
350 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
351 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
352 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
353 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
354 bsf menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
355 bsf cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
356 call show_debugstate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357 call show_dateformat
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 call PLED_menu_cursor
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
359 call toggle_brightness_show
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
360 bcf switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
361 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363 more_setup_menu_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
364 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
366 ; movlw d'5' ; x-1 menu entries
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
367 ; cpfseq menupos
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
368 ; bra more_setup_menu_loop2
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
369 ; movlw d'6'
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
370 ; movwf menupos
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
371 ; call PLED_menu_cursor
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
372 ;more_setup_menu_loop2:
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
373 ;
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
374 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375 bra do_more_setup_menu ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
377 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
378 goto restart ; exit menu, restart and enter surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
379
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
380 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
382 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
383 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
384 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385 call test_charger ; check if charger IC is active
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
386 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
387 call get_battery_voltage ; get battery voltage
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
388
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
391 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
392 goto setup_menu ; exit menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
393
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395 goto restart ; exit menu, restart and enter divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
396
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 bra more_setup_menu_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
398
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
399 do_more_setup_menu: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
400 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
401 bra toggle_datemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
402 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
403 bra toggle_debugmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404 dcfsnz menupos,F
12
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
405 bra show_license
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
406 dcfsnz menupos,F
188
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
407 bra show_rawdata
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
408 dcfsnz menupos,F
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
409 bra toggle_brightness ; toggle between ECO and HIGH
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410 movlw d'5' ; set cursor to "More again"
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
411 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
412 bra setup_menu2 ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413
188
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
414 show_rawdata: ; Displays Sensor raw data
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
415 call PLED_ClearScreen
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
416 call PLED_topline_box
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
417 WIN_INVERT .1 ; Init new Wordprocessor
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
418 DISPLAYTEXTH .296 ; Raw Data:
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
419 WIN_INVERT .0 ; Init new Wordprocessor
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
420
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
421 call PLED_static_raw_data
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
422
432
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
423
188
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
424 clrf timeout_counter2
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
425 bcf sleepmode
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
426 bcf menubit3
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
427 bsf menubit
432
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
428
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
429 show_rawdata_loop:
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
430 rcall show_rawdata_wait
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
431
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
432 btfsc menubit2
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
433 bra show_rawdata_next
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
434
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
435 btfsc onesecupdate
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
436 call PLED_update_raw_data
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
437
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
438 bcf onesecupdate ; End of one second tasks, if any.
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
439
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
440 goto show_rawdata_loop
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
441
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
442 show_rawdata_wait:
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
443 bcf menubit2
188
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
444 bcf switch_left
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
445 bcf switch_right
432
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
446
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
447 show_rawdata_wait_1:
337
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
448 btfsc uart_dump_screen ; Asked to dump screen contains ?
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
449 call dump_screen ; Yes!
6bdf80d7276c Added screen dumps of general menus.
JeanDo
parents: 297
diff changeset
450
188
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
451 btfsc switch_left ; Ack?
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
452 bsf menubit2
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
453 btfsc switch_right ; Ack?
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
454 bsf menubit2
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
455
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
456 btfsc menubit2
432
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
457 return
188
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
458
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
459 btfss menubit
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
460 goto restart ; exit menu, restart and enter surfmode
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
461
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
462 btfsc onesecupdate
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
463 call timeout_surfmode
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
464
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
465 btfsc onesecupdate
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
466 call set_dive_modes
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
467
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
468 btfsc sleepmode
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
469 bra show_rawdata_exit ; Exit
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
470
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
471 btfsc divemode
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
472 goto restart ; exit menu, restart and enter divemode
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
473
432
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
474 btfsc onesecupdate
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
475 return
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
476
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
477 bra show_rawdata_wait_1
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
478
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
479 ; Display blank/red/green/blue screens until click, to test OLED ageing.
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
480 show_rawdata_next:
444
f6cdd0079c36 compiler switch for display tester
heinrichsweikamp
parents: 432
diff changeset
481 ; display test draws more power then allowed -> potential hardware risk!
f6cdd0079c36 compiler switch for display tester
heinrichsweikamp
parents: 432
diff changeset
482 #ifndef DISPLAY_TEST
f6cdd0079c36 compiler switch for display tester
heinrichsweikamp
parents: 432
diff changeset
483 bra show_rawdata_exit
f6cdd0079c36 compiler switch for display tester
heinrichsweikamp
parents: 432
diff changeset
484 #endif
f6cdd0079c36 compiler switch for display tester
heinrichsweikamp
parents: 432
diff changeset
485
432
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
486 setf WREG
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
487 WIN_BOX_COLOR .0,.240,.0,.160
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
488 rcall show_rawdata_screen_wait
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
489 movlw color_red
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
490 WIN_BOX_COLOR .0,.240,.0,.160
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
491 rcall show_rawdata_screen_wait
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
492 movlw color_green
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
493 WIN_BOX_COLOR .0,.240,.0,.160
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
494 rcall show_rawdata_screen_wait
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
495 movlw color_blue
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
496 WIN_BOX_COLOR .0,.240,.0,.160
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
497 rcall show_rawdata_screen_wait
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
498 bra show_rawdata_exit
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
499
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
500 show_rawdata_screen_wait:
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
501 rcall show_rawdata_wait
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
502 bcf onesecupdate ; No dynamic update here...
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
503
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
504 btfsc menubit2
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
505 return
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
506
efe06a146773 Added Screen test sequence (raw data menu).
JeanDo
parents: 337
diff changeset
507 bra show_rawdata_screen_wait
188
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
508
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
509 show_rawdata_exit:
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
510 movlw d'4'
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
511 movwf menupos
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
512 bcf switch_right
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
513 bra more_setup_menu2 ; return to "more menu" loop
caf6153b26cb new sensor raw data menu
heinrichsweikamp
parents: 183
diff changeset
514
12
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
515 show_license:
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
516 call startup_screen1 ;1/2
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
517 call startup_screen2 ;1/2
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
518 movlw d'3'
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
519 movwf menupos
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
520 bcf switch_right
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
521 bra more_setup_menu2 ; return to "more menu" loop
588a969a0cae 1.53 beta rc
heinrichsweikamp
parents: 0
diff changeset
522
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
523 toggle_salinity:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
524 ; Toggles between 1.00 and 1.04
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
525 read_int_eeprom d'26' ; Read Salinity from EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
526 incf EEDATA,F ; Increase value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
527
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
528 movlw d'99' ; 99% ?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
529 cpfsgt EEDATA ; Salinity lower limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
530 bra toggle_salinity_reset ; Out of limit, reset value to 1.00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
531 movlw d'105' ; 105% ?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
532 cpfslt EEDATA ; Salinity higher limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
533 bra toggle_salinity_reset ; Out of limit, reset value to 1.00
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
534
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
535 toggle_salinity2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
536 write_int_eeprom d'26' ; Store salinity
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
537 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
538 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
539 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
540 bra setup_menu3a ; return to manu loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
541
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
542 toggle_salinity_reset:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
543 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
544 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
545 bra toggle_salinity2 ; back
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
546
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
547 show_salinity_value:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
548 read_int_eeprom d'26' ; Read Salinity from EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
549 movlw d'99' ; 99% ?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
550 cpfsgt EEDATA ; Salinity lower limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
551 rcall toggle_salinity_reset2 ; Reset before display!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
552 movlw d'105' ; 105% ?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
553 cpfslt EEDATA ; Salinity higher limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
554 rcall toggle_salinity_reset2 ; Reset before display!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
555 WIN_TOP .95
183
f720ce017244 Spanish special chars.
JeanDo
parents: 174
diff changeset
556 WIN_LEFT .90 ; +7 for spanish
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
557 WIN_FONT FT_SMALL
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
558 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
559 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
560 clrf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
561 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
562 output_16dp d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
563 bcf leftbind
445
6e57b5bb98ce localisation part 1 from Sergei
heinrichsweikamp
parents: 444
diff changeset
564 STRCAT_PRINT TXT_KGL4
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
565 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
566
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
567 toggle_salinity_reset2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
568 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
569 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
570 write_int_eeprom d'26' ; Store salinity
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
571 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
572
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
573 toggle_datemode:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
574 ; Toggles setting for
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
575 ; MM/DD/YY =0, Default
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
576 ; DD/MM/YY =1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
577 ; YY/MM/DD =2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
578 read_int_eeprom d'91' ; Read date format
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
579 incf EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
580 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
581 cpfsgt EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
582 bra toggle_datemode1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
583 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
584 toggle_datemode1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
585 write_int_eeprom d'91' ; Store date format
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
586 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
587 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
588 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
589 bra more_setup_menu3a ; return to manu loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
590
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
591 show_dateformat:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
592 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
593 tstfsz EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
594 bra show_dateformat2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
595 DISPLAYTEXTH .259 ; MM/DD/YY = 0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
596 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
597 show_dateformat2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
598 decfsz EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
599 bra show_dateformat3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
600 DISPLAYTEXTH .260 ; DD/MM/YY = 1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
601 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
602 show_dateformat3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
603 DISPLAYTEXTH .261 ; YY/MM/DD = 2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
604 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
605
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
606 toggle_brightness:
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
607 movlw LOW 0x104
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
608 movwf EEADR
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
609 movlw HIGH 0x104
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
610 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
611 call read_eeprom ; read byte
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
612 bcf oled_brightness_high ; Eco mode
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
613 movlw .0
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
614 cpfseq EEDATA ; High?
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
615 bsf oled_brightness_high ; Yes!
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
616
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
617 ; Value loaded, now toggle it...
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
618 btg oled_brightness_high
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
619
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
620 ; ...Display it...
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
621 rcall toggle_brightness_show
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
622 call PLED_brightness_full ; Set OLED
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
623
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
624 ; ...and write it again to EEPROM
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
625 movlw LOW 0x104
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
626 movwf EEADR
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
627 movlw HIGH 0x104
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
628 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
629 movlw .0
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
630 btfsc oled_brightness_high
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
631 movlw .1
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
632 movwf EEDATA
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
633 call write_eeprom ; write byte
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
634 clrf EEADRH ; Reset EEADRH
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
635
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
636 movlw d'5'
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
637 movwf menupos
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
638 bcf switch_right
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
639 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
640
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
641 toggle_brightness_show:
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
642 btfsc oled_brightness_high
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
643 bra toggle_brightness_show2
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
644 DISPLAYTEXTH .312 ; Eco
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
645 return
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
646 toggle_brightness_show2:
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
647 DISPLAYTEXTH .313 ; High
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
648 return
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
649
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
650
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
651 toggle_debugmode:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
652 read_int_eeprom d'39' ; Read status
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
653 incf EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
654 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
655 cpfsgt EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
656 bra toggle_debugmode1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
657 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
658 toggle_debugmode1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
659 write_int_eeprom d'39' ; Store status
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
660 bsf debug_mode ; set flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
661 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
662 cpfseq EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
663 bcf debug_mode ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
664 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
665 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
666 bcf switch_right
499
2ac77db9c150 Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents: 445
diff changeset
667 bra more_setup_menu3a ; return to menu loop
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
668
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
669 show_debugstate:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
670 read_int_eeprom d'39'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
671 tstfsz EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
672 bra show_debugstate2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
673 DISPLAYTEXT .131 ; OFF
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
674 show_debugstate2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
675 decf EEDATA,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
676 tstfsz EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
677 bra show_decotype3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
678 DISPLAYTEXT .130 ; ON
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
679 return