comparison 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
comparison
equal deleted inserted replaced
573:77c8ff191cd7 574:101fec6a6137
205 bcf menubit2 205 bcf menubit2
206 bcf menubit3 206 bcf menubit3
207 bsf menubit 207 bsf menubit
208 bsf cursor 208 bsf cursor
209 call show_decotype 209 call show_decotype
210 call show_salinity_value
211 call PLED_menu_cursor 210 call PLED_menu_cursor
212 bcf switch_left 211 bcf switch_left
213 bcf switch_right 212 bcf switch_right
214 213
215 setup_menu_loop: 214 setup_menu_loop:
244 dcfsnz menupos,F 243 dcfsnz menupos,F
245 goto menu_custom_functions 244 goto menu_custom_functions
246 dcfsnz menupos,F 245 dcfsnz menupos,F
247 goto menu_custom_functions_page2 246 goto menu_custom_functions_page2
248 dcfsnz menupos,F 247 dcfsnz menupos,F
249 bra toggle_salinity 248 bra menu_custom_functions_page3
250 dcfsnz menupos,F 249 dcfsnz menupos,F
251 bra toggle_decotype 250 bra toggle_decotype
252 dcfsnz menupos,F 251 dcfsnz menupos,F
253 bra more_setup_menu 252 bra more_setup_menu
254 bra exit_setup_menu ; exit... 253 bra exit_setup_menu ; exit...
319 318
320 movlw d'7' ; length of description text 319 movlw d'7' ; length of description text
321 mulwf EEDATA ; Multiply with Decomode 0-5 (5=Spare) 320 mulwf EEDATA ; Multiply with Decomode 0-5 (5=Spare)
322 321
323 movf PRODL,W 322 movf PRODL,W
324 addlw d'193' ; Description text offset 323 addlw .314-.256 ; Description text offset
325 movwf menupos ; Used as loop counter temp 324 movwf menupos ; Used as loop counter temp
326 325
327 movlw d'7' 326 movlw d'7'
328 movwf temp1 ; Loop 7 times 327 movwf temp1 ; Loop 7 times
329 328
330 menu0: 329 menu0:
331 movf menupos,W 330 movf menupos,W
332 call displaytext_1_low ; Display text! 331 call displaytext_1_high ; Display text!
333 incf menupos,F 332 incf menupos,F
334 333
335 decfsz temp1,F 334 decfsz temp1,F
336 bra menu0 ; loop 7 times 335 bra menu0 ; loop 7 times
337 336
353 bcf menubit3 352 bcf menubit3
354 bsf menubit 353 bsf menubit
355 bsf cursor 354 bsf cursor
356 call show_debugstate 355 call show_debugstate
357 call show_dateformat 356 call show_dateformat
357 call show_salinity_value
358 call PLED_menu_cursor 358 call PLED_menu_cursor
359 call toggle_brightness_show 359 call toggle_brightness_show
360 bcf switch_left 360 bcf switch_left
361 bcf switch_right 361 bcf switch_right
362 362
402 dcfsnz menupos,F 402 dcfsnz menupos,F
403 bra toggle_debugmode 403 bra toggle_debugmode
404 dcfsnz menupos,F 404 dcfsnz menupos,F
405 bra show_license 405 bra show_license
406 dcfsnz menupos,F 406 dcfsnz menupos,F
407 bra show_rawdata 407 bra toggle_salinity
408 dcfsnz menupos,F 408 dcfsnz menupos,F
409 bra toggle_brightness ; toggle between ECO and HIGH 409 bra toggle_brightness ; toggle between ECO and HIGH
410 movlw d'5' ; set cursor to "More again" 410 movlw d'5' ; set cursor to "More again"
411 movwf menupos 411 movwf menupos
412 bra setup_menu2 ; exit... 412 bra setup_menu2 ; exit...
413
414 show_rawdata: ; Displays Sensor raw data
415 call PLED_ClearScreen
416 call PLED_topline_box
417 WIN_INVERT .1 ; Init new Wordprocessor
418 DISPLAYTEXTH .296 ; Raw Data:
419 WIN_INVERT .0 ; Init new Wordprocessor
420
421 call PLED_static_raw_data
422
423
424 clrf timeout_counter2
425 bcf sleepmode
426 bcf menubit3
427 bsf menubit
428
429 show_rawdata_loop:
430 rcall show_rawdata_wait
431
432 btfsc menubit2
433 bra show_rawdata_next
434
435 btfsc onesecupdate
436 call PLED_update_raw_data
437
438 bcf onesecupdate ; End of one second tasks, if any.
439
440 goto show_rawdata_loop
441
442 show_rawdata_wait:
443 bcf menubit2
444 bcf switch_left
445 bcf switch_right
446
447 show_rawdata_wait_1:
448 btfsc uart_dump_screen ; Asked to dump screen contains ?
449 call dump_screen ; Yes!
450
451 btfsc switch_left ; Ack?
452 bsf menubit2
453 btfsc switch_right ; Ack?
454 bsf menubit2
455
456 btfsc menubit2
457 return
458
459 btfss menubit
460 goto restart ; exit menu, restart and enter surfmode
461
462 btfsc onesecupdate
463 call timeout_surfmode
464
465 btfsc onesecupdate
466 call set_dive_modes
467
468 btfsc sleepmode
469 bra show_rawdata_exit ; Exit
470
471 btfsc divemode
472 goto restart ; exit menu, restart and enter divemode
473
474 btfsc onesecupdate
475 return
476
477 bra show_rawdata_wait_1
478
479 ; Display blank/red/green/blue screens until click, to test OLED ageing.
480 show_rawdata_next:
481 ; display test draws more power then allowed -> potential hardware risk!
482 #ifndef DISPLAY_TEST
483 bra show_rawdata_exit
484 #endif
485
486 setf WREG
487 WIN_BOX_COLOR .0,.240,.0,.160
488 rcall show_rawdata_screen_wait
489 movlw color_red
490 WIN_BOX_COLOR .0,.240,.0,.160
491 rcall show_rawdata_screen_wait
492 movlw color_green
493 WIN_BOX_COLOR .0,.240,.0,.160
494 rcall show_rawdata_screen_wait
495 movlw color_blue
496 WIN_BOX_COLOR .0,.240,.0,.160
497 rcall show_rawdata_screen_wait
498 bra show_rawdata_exit
499
500 show_rawdata_screen_wait:
501 rcall show_rawdata_wait
502 bcf onesecupdate ; No dynamic update here...
503
504 btfsc menubit2
505 return
506
507 bra show_rawdata_screen_wait
508
509 show_rawdata_exit:
510 movlw d'4'
511 movwf menupos
512 bcf switch_right
513 bra more_setup_menu2 ; return to "more menu" loop
514 413
515 show_license: 414 show_license:
516 call startup_screen1 ;1/2 415 call startup_screen1 ;1/2
517 call startup_screen2 ;1/2 416 call startup_screen2 ;1/2
518 movlw d'3' 417 movlw d'3'
532 cpfslt EEDATA ; Salinity higher limit 431 cpfslt EEDATA ; Salinity higher limit
533 bra toggle_salinity_reset ; Out of limit, reset value to 1.00 432 bra toggle_salinity_reset ; Out of limit, reset value to 1.00
534 433
535 toggle_salinity2: 434 toggle_salinity2:
536 write_int_eeprom d'26' ; Store salinity 435 write_int_eeprom d'26' ; Store salinity
537 movlw d'3' 436 movlw d'4'
538 movwf menupos 437 movwf menupos
539 bcf switch_right 438 bcf switch_right
540 bra setup_menu3a ; return to manu loop 439 bra more_setup_menu3a ; return to manu loop
541 440
542 toggle_salinity_reset: 441 toggle_salinity_reset:
543 movlw d'100' 442 movlw d'100'
544 movwf EEDATA 443 movwf EEDATA
545 bra toggle_salinity2 ; back 444 bra toggle_salinity2 ; back
550 cpfsgt EEDATA ; Salinity lower limit 449 cpfsgt EEDATA ; Salinity lower limit
551 rcall toggle_salinity_reset2 ; Reset before display! 450 rcall toggle_salinity_reset2 ; Reset before display!
552 movlw d'105' ; 105% ? 451 movlw d'105' ; 105% ?
553 cpfslt EEDATA ; Salinity higher limit 452 cpfslt EEDATA ; Salinity higher limit
554 rcall toggle_salinity_reset2 ; Reset before display! 453 rcall toggle_salinity_reset2 ; Reset before display!
555 WIN_TOP .95 454 WIN_TOP .125
556 WIN_LEFT .90 ; +7 for spanish 455 WIN_LEFT .90 ; +7 for spanish
557 WIN_FONT FT_SMALL 456 WIN_FONT FT_SMALL
558 lfsr FSR2,letter 457 lfsr FSR2,letter
559 movff EEDATA,lo 458 movff EEDATA,lo
560 clrf hi 459 clrf hi