comparison code_part1/OSTC_code_asm_part1/menu_logbook.asm @ 452:05ec97e106da

Minor changes: Tp? curve in orange. Ceilling stippled area.
author JeanDo
date Fri, 19 Aug 2011 00:56:27 +0200
parents f6f818edf333
children 993e681e89cf
comparison
equal deleted inserted replaced
451:f6f818edf333 452:05ec97e106da
482 movff SSPBUF,lo 482 movff SSPBUF,lo
483 call I2CREAD2 483 call I2CREAD2
484 movff SSPBUF,hi ; Read min. Temperature 484 movff SSPBUF,hi ; Read min. Temperature
485 movff lo,logbook_min_tp+0 ; Backup min Tp° too. 485 movff lo,logbook_min_tp+0 ; Backup min Tp° too.
486 movff hi,logbook_min_tp+1 486 movff hi,logbook_min_tp+1
487 movlw color_pink ; Use same color as tp° curve 487 movlw color_orange ; Use same color as tp° curve
488 call PLED_set_color 488 call PLED_set_color
489 489
490 call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required 490 call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
491 movlw d'3' 491 movlw d'3'
492 movwf ignore_digits 492 movwf ignore_digits
648 bra profile_display_loop_done ; Yes, skip all remaining pixels 648 bra profile_display_loop_done ; Yes, skip all remaining pixels
649 649
650 ;---- Draw Ceiling curve, if any --------------------------------------------- 650 ;---- Draw Ceiling curve, if any ---------------------------------------------
651 movf divisor_deco,W 651 movf divisor_deco,W
652 bz profile_display_skip_deco 652 bz profile_display_skip_deco
653 653
654 movf logbook_ceiling,W ; Any deco ceiling ? 654 movf logbook_ceiling,W ; Any deco ceiling ?
655 bz profile_display_skip_deco 655 bz profile_display_skip_deco
656 656
657 mullw .100 ; Yes: convert to mbar 657 mullw .100 ; Yes: convert to mbar
658 movff PRODL,sub_a+0 658 movff PRODL,sub_a+0
669 movff PRODL,xA+0 669 movff PRODL,xA+0
670 movff PRODH,xA+1 670 movff PRODH,xA+1
671 movff sim_pressure+0,xB+0 ; devide pressure in mbar/quant for row offsett 671 movff sim_pressure+0,xB+0 ; devide pressure in mbar/quant for row offsett
672 movff sim_pressure+1,xB+1 672 movff sim_pressure+1,xB+1
673 call div16x16 ; xA/xB=xC 673 call div16x16 ; xA/xB=xC
674 674
675 movlw d'76' ; Starts right after the top blue line. 675 movlw d'76' ; Starts right after the top blue line.
676 movff WREG,win_top 676 movff WREG,win_top
677 movff timeout_counter3,win_leftx2 ; Left border (0-159) 677 movff timeout_counter3,win_leftx2 ; Left border (0-159)
678 movff xC+0,win_height 678 movff xC+0,win_height
679 call half_vertical_line ; Inputs: win_top, win_leftx2, win_height, win_color1, win_color2 679 call half_vertical_line ; Inputs: win_top, win_leftx2, win_height, win_color1, win_color2
680
681 ; Horizontal bar: jaggy line, so don't keep it.
682 ; movlw d'75'
683 ; addwf xC+0,F ; add 75 pixel offset to result
684 ; PIXEL_WRITE timeout_counter3,xC+0 ; Set col(0..159) x row (0..239), put a current color pixel.
685
680 profile_display_skip_deco: 686 profile_display_skip_deco:
681 687
682 ;---- Draw Tp° curve, if any --------------------------------------------- 688 ;---- Draw Tp° curve, if any ---------------------------------------------
683 movf divisor_temperature,W 689 movf divisor_temperature,W
684 bz profile_display_skip_temp 690 bz profile_display_skip_temp
686 movf logbook_cur_tp+0,W ; Did we had already a valid Tp°C record ? 692 movf logbook_cur_tp+0,W ; Did we had already a valid Tp°C record ?
687 andwf logbook_cur_tp+1,W 693 andwf logbook_cur_tp+1,W
688 incf WREG 694 incf WREG
689 bz profile_display_skip_temp ; No: just skip drawing. 695 bz profile_display_skip_temp ; No: just skip drawing.
690 696
691 movlw LOW((.153*.256)/.370) ; fixed tp° scale: (-2 .. +35°C * scaleé56 )/153pix 697 movlw LOW((.153*.256)/.370) ; fixed tp° scale: (-2 .. +35°C * scale256 )/153pix
692 movwf xB+0 698 movwf xB+0
693 movlw HIGH((.153*.256)/.370) 699 movlw HIGH((.153*.256)/.370)
694 movwf xB+1 700 movwf xB+1
695 701
696 movf logbook_cur_tp+0,W ; Current Tp° - (-2.0°C) == Tp° + 20. 702 movf logbook_cur_tp+0,W ; Current Tp° - (-2.0°C) == Tp° + 20.
711 movlw d'75' 717 movlw d'75'
712 movwf xC+1 718 movwf xC+1
713 cpfsgt xC+0 719 cpfsgt xC+0
714 movff xC+1,xC+0 720 movff xC+1,xC+0
715 721
716 movlw color_pink 722 movlw color_orange
717 call PLED_set_color 723 call PLED_set_color
718 724
719 movf logbook_last_tp,W ; do we have a valid previous value ? 725 movf logbook_last_tp,W ; do we have a valid previous value ?
720 bz profile_display_temp_1 ; No: skip the vertical line. 726 bz profile_display_temp_1 ; No: skip the vertical line.
721 movwf xC+1 727 movwf xC+1