Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/menu.asm @ 842:454ef5c2e6aa default tip
Bugfix: Auto-SP did not show >9m for some 2C hardware versions in German language firmware
Make year settings until 2040 possible (This is likely the final release for this model)
| author | heinrichsweikamp |
|---|---|
| date | Sat, 29 Nov 2025 14:11:07 +0100 |
| parents | 2a0e5d884fc3 |
| children |
| rev | line source |
|---|---|
| 0 | 1 |
| 815 | 2 ; OSTC Mk.2, 2N and 2C - diving computer code |
|
807
c50296c3059e
BUGFIX: Divetime had unwanted "." behind the minutes
heinrichsweikamp
parents:
717
diff
changeset
|
3 ; Copyright (C) 2015 HeinrichsWeikamp GbR |
| 0 | 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 |
| 717 | 259 call DISP_divemask_color |
| 260 DISPLAYTEXT .235 ;Decomode changed! | |
| 261 call DISP_standard_color | |
| 0 | 262 |
| 263 read_int_eeprom d'34' ; Read deco data | |
| 264 | |
| 265 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
|
266 mulwf EEDATA ; Multiply with Decomode 0-6 |
| 0 | 267 |
| 268 movf PRODL,W | |
| 574 | 269 addlw .314-.256 ; Description text offset |
| 0 | 270 movwf menupos ; Used as loop counter temp |
| 271 | |
| 272 movlw d'7' | |
| 273 movwf temp1 ; Loop 7 times | |
| 274 | |
| 275 menu0: | |
| 276 movf menupos,W | |
| 574 | 277 call displaytext_1_high ; Display text! |
| 0 | 278 incf menupos,F |
| 279 | |
| 280 decfsz temp1,F | |
| 281 bra menu0 ; loop 7 times | |
| 282 | |
| 283 movlw d'30' | |
| 284 call startup_screen3a | |
| 285 goto restart ; Restart to surfacemode | |
| 286 | |
| 287 more_setup_menu: | |
| 288 movlw d'1' | |
| 289 movwf menupos | |
| 290 more_setup_menu2: | |
| 291 bcf leftbind | |
| 681 | 292 call DISP_ClearScreen |
| 293 call DISP_more_setup_menu_mask | |
| 0 | 294 more_setup_menu3a: |
| 576 | 295 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
| 0 | 296 call show_debugstate |
| 297 call show_dateformat | |
| 574 | 298 call show_salinity_value |
| 681 | 299 call DISP_menu_cursor |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
300 call toggle_brightness_show |
| 0 | 301 |
| 302 more_setup_menu_loop: | |
| 303 call check_switches_menu | |
| 304 | |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
305 ; movlw d'5' ; x-1 menu entries |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
306 ; cpfseq menupos |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
307 ; bra more_setup_menu_loop2 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
308 ; movlw d'6' |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
309 ; movwf menupos |
| 681 | 310 ; call DISP_menu_cursor |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
311 ;more_setup_menu_loop2: |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
312 ; |
| 0 | 313 btfsc menubit2 |
| 314 bra do_more_setup_menu ; call submenu | |
| 315 | |
| 316 btfss menubit | |
| 317 goto restart ; exit menu, restart and enter surfmode | |
| 318 | |
| 319 btfsc onesecupdate | |
| 575 | 320 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag |
| 0 | 321 |
| 322 bcf onesecupdate ; End of one second tasks | |
| 323 | |
| 324 btfsc sleepmode | |
| 325 goto setup_menu ; exit menu | |
| 326 | |
| 327 bra more_setup_menu_loop | |
| 328 | |
| 329 do_more_setup_menu: ; calls submenu | |
| 330 dcfsnz menupos,F | |
| 331 bra toggle_datemode | |
| 332 dcfsnz menupos,F | |
| 333 bra toggle_debugmode | |
| 334 dcfsnz menupos,F | |
| 12 | 335 bra show_license |
| 0 | 336 dcfsnz menupos,F |
| 574 | 337 bra toggle_salinity |
| 0 | 338 dcfsnz menupos,F |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
339 bra toggle_brightness ; toggle between ECO and HIGH |
| 686 | 340 movlw d'6' ; set cursor to "More again" |
| 0 | 341 movwf menupos |
| 342 bra setup_menu2 ; exit... | |
| 343 | |
| 12 | 344 show_license: |
| 345 call startup_screen1 ;1/2 | |
| 346 call startup_screen2 ;1/2 | |
| 347 movlw d'3' | |
| 348 movwf menupos | |
| 349 bcf switch_right | |
| 350 bra more_setup_menu2 ; return to "more menu" loop | |
| 351 | |
| 0 | 352 toggle_salinity: |
| 353 ; Toggles between 1.00 and 1.04 | |
| 354 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
| 355 incf EEDATA,F ; Increase value | |
| 356 | |
| 357 movlw d'99' ; 99% ? | |
| 358 cpfsgt EEDATA ; Salinity lower limit | |
| 359 bra toggle_salinity_reset ; Out of limit, reset value to 1.00 | |
| 360 movlw d'105' ; 105% ? | |
| 361 cpfslt EEDATA ; Salinity higher limit | |
| 362 bra toggle_salinity_reset ; Out of limit, reset value to 1.00 | |
| 363 | |
| 364 toggle_salinity2: | |
| 365 write_int_eeprom d'26' ; Store salinity | |
| 574 | 366 movlw d'4' |
| 0 | 367 movwf menupos |
| 368 bcf switch_right | |
| 574 | 369 bra more_setup_menu3a ; return to manu loop |
| 0 | 370 |
| 371 toggle_salinity_reset: | |
| 372 movlw d'100' | |
| 373 movwf EEDATA | |
| 374 bra toggle_salinity2 ; back | |
| 375 | |
| 376 show_salinity_value: | |
| 377 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
| 378 movlw d'99' ; 99% ? | |
| 379 cpfsgt EEDATA ; Salinity lower limit | |
| 380 rcall toggle_salinity_reset2 ; Reset before display! | |
| 381 movlw d'105' ; 105% ? | |
| 382 cpfslt EEDATA ; Salinity higher limit | |
| 383 rcall toggle_salinity_reset2 ; Reset before display! | |
| 574 | 384 WIN_TOP .125 |
| 183 | 385 WIN_LEFT .90 ; +7 for spanish |
| 0 | 386 WIN_FONT FT_SMALL |
| 387 lfsr FSR2,letter | |
| 388 movff EEDATA,lo | |
| 389 clrf hi | |
| 390 bsf leftbind | |
| 391 output_16dp d'3' | |
| 392 bcf leftbind | |
| 445 | 393 STRCAT_PRINT TXT_KGL4 |
| 0 | 394 return |
| 395 | |
| 396 toggle_salinity_reset2: | |
| 397 movlw d'100' | |
| 398 movwf EEDATA | |
| 399 write_int_eeprom d'26' ; Store salinity | |
| 400 return | |
| 401 | |
| 402 toggle_datemode: | |
| 403 ; Toggles setting for | |
| 404 ; MM/DD/YY =0, Default | |
| 405 ; DD/MM/YY =1 | |
| 406 ; YY/MM/DD =2 | |
| 407 read_int_eeprom d'91' ; Read date format | |
| 408 incf EEDATA,F | |
| 409 movlw d'2' | |
| 410 cpfsgt EEDATA | |
| 411 bra toggle_datemode1 | |
| 412 clrf EEDATA | |
| 413 toggle_datemode1: | |
| 414 write_int_eeprom d'91' ; Store date format | |
| 415 movlw d'1' | |
| 416 movwf menupos | |
| 417 bcf switch_right | |
| 418 bra more_setup_menu3a ; return to manu loop | |
| 419 | |
| 420 show_dateformat: | |
| 421 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
| 422 tstfsz EEDATA | |
| 423 bra show_dateformat2 | |
| 424 DISPLAYTEXTH .259 ; MM/DD/YY = 0 | |
| 425 return | |
| 426 show_dateformat2: | |
| 427 decfsz EEDATA,F | |
| 428 bra show_dateformat3 | |
| 429 DISPLAYTEXTH .260 ; DD/MM/YY = 1 | |
| 430 return | |
| 431 show_dateformat3: | |
| 432 DISPLAYTEXTH .261 ; YY/MM/DD = 2 | |
| 433 return | |
| 434 | |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
435 toggle_brightness: |
| 578 | 436 movlw LOW 0x103 |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
437 movwf EEADR |
| 578 | 438 movlw HIGH 0x103 |
| 681 | 439 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
|
440 call read_eeprom ; read byte |
| 681 | 441 bcf DISPLAY_brightness_high ; Eco mode |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
442 movlw .0 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
443 cpfseq EEDATA ; High? |
| 681 | 444 bsf DISPLAY_brightness_high ; Yes! |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
445 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
446 ; Value loaded, now toggle it... |
| 681 | 447 btg DISPLAY_brightness_high |
|
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 ; ...Display it... |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
450 rcall toggle_brightness_show |
| 681 | 451 call DISP_brightness_full ; Set DISPLAY |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
452 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
453 ; ...and write it again to EEPROM |
| 578 | 454 movlw LOW 0x103 |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
455 movwf EEADR |
| 578 | 456 movlw HIGH 0x103 |
| 681 | 457 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
|
458 movlw .0 |
| 681 | 459 btfsc DISPLAY_brightness_high |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
460 movlw .1 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
461 movwf EEDATA |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
462 call write_eeprom ; write byte |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
463 clrf EEADRH ; Reset EEADRH |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
464 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
465 movlw d'5' |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
466 movwf menupos |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
467 bcf switch_right |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
468 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
|
469 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
470 toggle_brightness_show: |
| 681 | 471 btfsc DISPLAY_brightness_high |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
472 bra toggle_brightness_show2 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
473 DISPLAYTEXTH .312 ; Eco |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
474 return |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
475 toggle_brightness_show2: |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
476 DISPLAYTEXTH .313 ; High |
|
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 |
|
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
479 |
| 0 | 480 toggle_debugmode: |
| 481 read_int_eeprom d'39' ; Read status | |
| 482 incf EEDATA,F | |
| 483 movlw d'1' | |
| 484 cpfsgt EEDATA | |
| 485 bra toggle_debugmode1 | |
| 486 clrf EEDATA | |
| 487 toggle_debugmode1: | |
| 488 write_int_eeprom d'39' ; Store status | |
| 489 bsf debug_mode ; set flag | |
| 490 movlw d'1' | |
| 491 cpfseq EEDATA | |
| 492 bcf debug_mode ; clear flag | |
| 493 movlw d'2' | |
| 494 movwf menupos | |
| 495 bcf switch_right | |
|
499
2ac77db9c150
Added OLED brightness setting, texts 280, 312 and 313 need update
heinrichsweikamp
parents:
445
diff
changeset
|
496 bra more_setup_menu3a ; return to menu loop |
| 0 | 497 |
| 498 show_debugstate: | |
| 499 read_int_eeprom d'39' | |
| 500 tstfsz EEDATA | |
| 501 bra show_debugstate2 | |
| 502 DISPLAYTEXT .131 ; OFF | |
| 503 show_debugstate2: | |
| 504 decf EEDATA,F | |
| 505 tstfsz EEDATA | |
| 506 bra show_decotype3 | |
| 507 DISPLAYTEXT .130 ; ON | |
| 508 return | |
| 575 | 509 |
| 510 menu_check_dive_and_timeout: | |
| 511 call set_dive_modes ; Check thresholds | |
| 512 call timeout_surfmode ; Sets sleepmode flag if timeout | |
| 513 btfsc divemode | |
| 514 goto restart ; dive started! | |
| 515 return | |
| 576 | 516 |
| 517 menu_pre_loop_common: ; Clear some menu flags and the timeout | |
| 518 clrf timeout_counter2 | |
| 519 bcf leftbind | |
| 520 bcf sleepmode | |
| 521 bcf menubit2 | |
| 522 bcf menubit3 | |
| 523 bsf menubit | |
| 524 bcf switch_left | |
| 525 bcf switch_right | |
| 526 return |
