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