comparison code_part1/OSTC_code_asm_part1/outputs.asm @ 719:ad5ab9910820

decoplan bargraph
author heinrichsweikamp
date Thu, 23 May 2013 21:43:08 +0200
parents 91ae251d379f
children 4452837aff37
comparison
equal deleted inserted replaced
718:e633a1aa6b09 719:ad5ab9910820
2097 WIN_BOX_STD .181, .187, .32, .34 ; Battery nose 2097 WIN_BOX_STD .181, .187, .32, .34 ; Battery nose
2098 2098
2099 update_batt_voltage3: 2099 update_batt_voltage3:
2100 GETCUSTOM8 d'34' ; Color battery 2100 GETCUSTOM8 d'34' ; Color battery
2101 btfsc cc_active 2101 btfsc cc_active
2102 movlw color_yellow ; CC active 2102 ; movlw color_yellow ; CC active
2103 movlw color_orange ; CC active
2103 btfsc charge_done 2104 btfsc charge_done
2104 movlw color_green ; Charge done. 2105 movlw color_green ; Charge done.
2105 call DISP_set_color 2106 call DISP_set_color
2106 2107
2107 movlw .175 2108 movlw .175
2712 bsf leftbind 2713 bsf leftbind
2713 output_8 ; outputs into Postinc2! 2714 output_8 ; outputs into Postinc2!
2714 STRCAT_PRINT TXT_METER2 2715 STRCAT_PRINT TXT_METER2
2715 2716
2716 ;---- Print duration ------------------------------------------------- 2717 ;---- Print duration -------------------------------------------------
2717 WIN_LEFT .140 2718 WIN_LEFT .139
2718 lfsr FSR2,letter 2719 lfsr FSR2,letter
2719 2720
2720 movf lo,W ; Swap hi & lo 2721 movf lo,W ; Swap hi & lo
2721 movff hi,lo 2722 movff hi,lo
2722 movwf hi 2723 movwf hi
2723 2724
2724 output_8 ; Allow up to 240' 2725 bsf leftbind
2725 STRCAT_PRINT "' " ; 1 to 3 chars for depth. 2726 output_99 ; Allow up to 99'
2727 STRCAT_PRINT "'" ; 1 to 3 chars for depth.
2726 2728
2727 movf lo,W ; Swap back hi & lo 2729 movf lo,W ; Swap back hi & lo
2728 movff hi,lo 2730 movff hi,lo
2729 movwf hi 2731 movwf hi
2730 2732
2742 2744
2743 ; Draw used area (hi = minutes): 2745 ; Draw used area (hi = minutes):
2744 movlw d'16' ; Limit length (16min) 2746 movlw d'16' ; Limit length (16min)
2745 cpfslt hi 2747 cpfslt hi
2746 movwf hi 2748 movwf hi
2747 movff hi,win_bargraph ; Active width, the rest is cleared. 2749 movff hi,win_bargraph ; Active width, the rest is cleared.
2750
2751 call DISP_standard_color
2748 call DISP_box 2752 call DISP_box
2749 2753
2750 ; Restore win_top 2754 ; Restore win_top
2751 call DISP_standard_color 2755 call DISP_standard_color
2752 movff win_top,WREG ; decf win_top (BANK SAFE) 2756 movff win_top,WREG ; decf win_top (BANK SAFE)
2753 decf WREG 2757 decf WREG
2754 movff WREG,win_top 2758 movff WREG,win_top
2755 return 2759 return
2756 2760
2757 ;----------------------------------------------------------------------------- 2761 ;-----------------------------------------------------------------------------
2758 ; Clear unused area belw last stop 2762 ; Clear unused area below last stop
2759 ; Inputs: win_top : last used area... 2763 ; Inputs: win_top : last used area...
2760 DISP_decoplan_clear_bottom: 2764 DISP_decoplan_clear_bottom:
2761 movff win_top,WREG ; Get back from bank0 2765 movff win_top,WREG ; Get back from bank0
2762 btfsc divemode ; In dive mode ? 2766 btfsc divemode ; In dive mode ?
2763 sublw .168 ; Yes: bottom row in divemode 2767 sublw .168 ; Yes: bottom row in divemode