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