Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/menu.asm @ 686:8ffbd5cb4b42
Hard-coded min. Values for CF00 and CF01
Set cursor to "Exit" when leaving sub-menus
author | heinrichsweikamp |
---|---|
date | Sat, 26 Jan 2013 14:36:26 +0100 |
parents | 6e456a6398e0 |
children | 91ae251d379f |
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: | |
681 | 37 call DISP_ClearScreen |
576 | 38 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
681 | 39 call DISP_menu_mask |
40 call DISP_menu_cursor | |
0 | 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 | |
681 | 97 call DISP_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 | |
681 | 106 call DISP_ClearScreen |
0 | 107 more_menu3: |
576 | 108 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
681 | 109 call DISP_more_menu_mask |
110 call DISP_menu_cursor | |
0 | 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 | |
681 | 119 ; call DISP_menu_cursor |
125 | 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 |
686 | 149 movlw d'6' |
0 | 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 | |
681 | 159 call DISP_ClearScreen |
160 call DISP_setup_menu_mask | |
0 | 161 setup_menu3a: |
576 | 162 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
0 | 163 call show_decotype |
681 | 164 call DISP_menu_cursor |
0 | 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: | |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
578
diff
changeset
|
205 movlw d'7' ; number of different modes |
0 | 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 | |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
578
diff
changeset
|
245 bra show_decotype7 |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
578
diff
changeset
|
246 DISPLAYTEXT .236 ; L16-GF CC =5 |
0 | 247 return |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
578
diff
changeset
|
248 show_decotype7: |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
578
diff
changeset
|
249 decfsz EEDATA,F |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
578
diff
changeset
|
250 return |
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
578
diff
changeset
|
251 DISPLAYTEXT .226 ; pSCR-GF =6 |
0 | 252 return |
253 | |
254 exit_setup_menu: | |
255 btfss deco_mode_changed ; Was the decomode changed in Setup menu? | |
256 goto restart ; No, restart to surfacemode | |
257 | |
681 | 258 call DISP_ClearScreen |
0 | 259 |
260 deco_info_screen1: | |
681 | 261 call DISP_topline_box |
0 | 262 WIN_INVERT .1 ; Init new Wordprocessor |
263 DISPLAYTEXT .235 ;Decomode changed! | |
264 WIN_INVERT .0 ; Init new Wordprocessor | |
265 | |
266 read_int_eeprom d'34' ; Read deco data | |
267 | |
268 movlw d'7' ; length of description text | |
592
cda5b45b953f
NEW: Deco mode "pSCR-GF": Computes deco and CNS based on pSCR parameters (CF62/63)
heinrichsweikamp
parents:
578
diff
changeset
|
269 mulwf EEDATA ; Multiply with Decomode 0-6 |
0 | 270 |
271 movf PRODL,W | |
574 | 272 addlw .314-.256 ; Description text offset |
0 | 273 movwf menupos ; Used as loop counter temp |
274 | |
275 movlw d'7' | |
276 movwf temp1 ; Loop 7 times | |
277 | |
278 menu0: | |
279 movf menupos,W | |
574 | 280 call displaytext_1_high ; Display text! |
0 | 281 incf menupos,F |
282 | |
283 decfsz temp1,F | |
284 bra menu0 ; loop 7 times | |
285 | |
286 movlw d'30' | |
287 call startup_screen3a | |
288 goto restart ; Restart to surfacemode | |
289 | |
290 more_setup_menu: | |
291 movlw d'1' | |
292 movwf menupos | |
293 more_setup_menu2: | |
294 bcf leftbind | |
681 | 295 call DISP_ClearScreen |
296 call DISP_more_setup_menu_mask | |
0 | 297 more_setup_menu3a: |
576 | 298 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
0 | 299 call show_debugstate |
300 call show_dateformat | |
574 | 301 call show_salinity_value |
681 | 302 call DISP_menu_cursor |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
303 call toggle_brightness_show |
0 | 304 |
305 more_setup_menu_loop: | |
306 call check_switches_menu | |
307 | |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
308 ; movlw d'5' ; x-1 menu entries |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
309 ; cpfseq menupos |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
310 ; bra more_setup_menu_loop2 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
311 ; movlw d'6' |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
312 ; movwf menupos |
681 | 313 ; call DISP_menu_cursor |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
314 ;more_setup_menu_loop2: |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
315 ; |
0 | 316 btfsc menubit2 |
317 bra do_more_setup_menu ; call submenu | |
318 | |
319 btfss menubit | |
320 goto restart ; exit menu, restart and enter surfmode | |
321 | |
322 btfsc onesecupdate | |
575 | 323 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag |
0 | 324 |
325 bcf onesecupdate ; End of one second tasks | |
326 | |
327 btfsc sleepmode | |
328 goto setup_menu ; exit menu | |
329 | |
330 bra more_setup_menu_loop | |
331 | |
332 do_more_setup_menu: ; calls submenu | |
333 dcfsnz menupos,F | |
334 bra toggle_datemode | |
335 dcfsnz menupos,F | |
336 bra toggle_debugmode | |
337 dcfsnz menupos,F | |
12 | 338 bra show_license |
0 | 339 dcfsnz menupos,F |
574 | 340 bra toggle_salinity |
0 | 341 dcfsnz menupos,F |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
342 bra toggle_brightness ; toggle between ECO and HIGH |
686 | 343 movlw d'6' ; set cursor to "More again" |
0 | 344 movwf menupos |
345 bra setup_menu2 ; exit... | |
346 | |
12 | 347 show_license: |
348 call startup_screen1 ;1/2 | |
349 call startup_screen2 ;1/2 | |
350 movlw d'3' | |
351 movwf menupos | |
352 bcf switch_right | |
353 bra more_setup_menu2 ; return to "more menu" loop | |
354 | |
0 | 355 toggle_salinity: |
356 ; Toggles between 1.00 and 1.04 | |
357 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
358 incf EEDATA,F ; Increase value | |
359 | |
360 movlw d'99' ; 99% ? | |
361 cpfsgt EEDATA ; Salinity lower limit | |
362 bra toggle_salinity_reset ; Out of limit, reset value to 1.00 | |
363 movlw d'105' ; 105% ? | |
364 cpfslt EEDATA ; Salinity higher limit | |
365 bra toggle_salinity_reset ; Out of limit, reset value to 1.00 | |
366 | |
367 toggle_salinity2: | |
368 write_int_eeprom d'26' ; Store salinity | |
574 | 369 movlw d'4' |
0 | 370 movwf menupos |
371 bcf switch_right | |
574 | 372 bra more_setup_menu3a ; return to manu loop |
0 | 373 |
374 toggle_salinity_reset: | |
375 movlw d'100' | |
376 movwf EEDATA | |
377 bra toggle_salinity2 ; back | |
378 | |
379 show_salinity_value: | |
380 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
381 movlw d'99' ; 99% ? | |
382 cpfsgt EEDATA ; Salinity lower limit | |
383 rcall toggle_salinity_reset2 ; Reset before display! | |
384 movlw d'105' ; 105% ? | |
385 cpfslt EEDATA ; Salinity higher limit | |
386 rcall toggle_salinity_reset2 ; Reset before display! | |
574 | 387 WIN_TOP .125 |
183 | 388 WIN_LEFT .90 ; +7 for spanish |
0 | 389 WIN_FONT FT_SMALL |
390 lfsr FSR2,letter | |
391 movff EEDATA,lo | |
392 clrf hi | |
393 bsf leftbind | |
394 output_16dp d'3' | |
395 bcf leftbind | |
445 | 396 STRCAT_PRINT TXT_KGL4 |
0 | 397 return |
398 | |
399 toggle_salinity_reset2: | |
400 movlw d'100' | |
401 movwf EEDATA | |
402 write_int_eeprom d'26' ; Store salinity | |
403 return | |
404 | |
405 toggle_datemode: | |
406 ; Toggles setting for | |
407 ; MM/DD/YY =0, Default | |
408 ; DD/MM/YY =1 | |
409 ; YY/MM/DD =2 | |
410 read_int_eeprom d'91' ; Read date format | |
411 incf EEDATA,F | |
412 movlw d'2' | |
413 cpfsgt EEDATA | |
414 bra toggle_datemode1 | |
415 clrf EEDATA | |
416 toggle_datemode1: | |
417 write_int_eeprom d'91' ; Store date format | |
418 movlw d'1' | |
419 movwf menupos | |
420 bcf switch_right | |
421 bra more_setup_menu3a ; return to manu loop | |
422 | |
423 show_dateformat: | |
424 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
425 tstfsz EEDATA | |
426 bra show_dateformat2 | |
427 DISPLAYTEXTH .259 ; MM/DD/YY = 0 | |
428 return | |
429 show_dateformat2: | |
430 decfsz EEDATA,F | |
431 bra show_dateformat3 | |
432 DISPLAYTEXTH .260 ; DD/MM/YY = 1 | |
433 return | |
434 show_dateformat3: | |
435 DISPLAYTEXTH .261 ; YY/MM/DD = 2 | |
436 return | |
437 | |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
438 toggle_brightness: |
578 | 439 movlw LOW 0x103 |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
440 movwf EEADR |
578 | 441 movlw HIGH 0x103 |
681 | 442 movwf EEADRH ; DISPLAY brightness (=0: Eco, =1: High) |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
443 call read_eeprom ; read byte |
681 | 444 bcf DISPLAY_brightness_high ; Eco mode |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
445 movlw .0 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
446 cpfseq EEDATA ; High? |
681 | 447 bsf DISPLAY_brightness_high ; Yes! |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
448 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
449 ; Value loaded, now toggle it... |
681 | 450 btg DISPLAY_brightness_high |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
451 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
452 ; ...Display it... |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
453 rcall toggle_brightness_show |
681 | 454 call DISP_brightness_full ; Set DISPLAY |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
455 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
456 ; ...and write it again to EEPROM |
578 | 457 movlw LOW 0x103 |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
458 movwf EEADR |
578 | 459 movlw HIGH 0x103 |
681 | 460 movwf EEADRH ; DISPLAY brightness (=0: Eco, =1: High) |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
461 movlw .0 |
681 | 462 btfsc DISPLAY_brightness_high |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
463 movlw .1 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
464 movwf EEDATA |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
465 call write_eeprom ; write byte |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
466 clrf EEADRH ; Reset EEADRH |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
467 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
468 movlw d'5' |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
469 movwf menupos |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
470 bcf switch_right |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
471 bra more_setup_menu3a ; return to menu loop |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
472 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
473 toggle_brightness_show: |
681 | 474 btfsc DISPLAY_brightness_high |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
475 bra toggle_brightness_show2 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
476 DISPLAYTEXTH .312 ; Eco |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
477 return |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
478 toggle_brightness_show2: |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
479 DISPLAYTEXTH .313 ; High |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
480 return |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
481 |
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
482 |
0 | 483 toggle_debugmode: |
484 read_int_eeprom d'39' ; Read status | |
485 incf EEDATA,F | |
486 movlw d'1' | |
487 cpfsgt EEDATA | |
488 bra toggle_debugmode1 | |
489 clrf EEDATA | |
490 toggle_debugmode1: | |
491 write_int_eeprom d'39' ; Store status | |
492 bsf debug_mode ; set flag | |
493 movlw d'1' | |
494 cpfseq EEDATA | |
495 bcf debug_mode ; clear flag | |
496 movlw d'2' | |
497 movwf menupos | |
498 bcf switch_right | |
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
499 bra more_setup_menu3a ; return to menu loop |
0 | 500 |
501 show_debugstate: | |
502 read_int_eeprom d'39' | |
503 tstfsz EEDATA | |
504 bra show_debugstate2 | |
505 DISPLAYTEXT .131 ; OFF | |
506 show_debugstate2: | |
507 decf EEDATA,F | |
508 tstfsz EEDATA | |
509 bra show_decotype3 | |
510 DISPLAYTEXT .130 ; ON | |
511 return | |
575 | 512 |
513 menu_check_dive_and_timeout: | |
514 call set_dive_modes ; Check thresholds | |
515 call timeout_surfmode ; Sets sleepmode flag if timeout | |
516 btfsc divemode | |
517 goto restart ; dive started! | |
518 return | |
576 | 519 |
520 menu_pre_loop_common: ; Clear some menu flags and the timeout | |
521 clrf timeout_counter2 | |
522 bcf leftbind | |
523 bcf sleepmode | |
524 bcf menubit2 | |
525 bcf menubit3 | |
526 bsf menubit | |
527 bcf switch_left | |
528 bcf switch_right | |
529 return |