comparison src/tft_outputs.asm @ 405:08fea401be24

BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= ) BUGFIX: Minor layout fix in divemode (Dynamic gaslist)
author heinrichsweikamp
date Mon, 01 Feb 2016 20:44:01 +0100
parents db25f2028074
children ec362cef2d52
comparison
equal deleted inserted replaced
404:8759a37361a5 405:08fea401be24
1090 WIN_TINY dm_custom_dyn_gas_mask_column,dm_custom_dyn_gas_mask_row 1090 WIN_TINY dm_custom_dyn_gas_mask_column,dm_custom_dyn_gas_mask_row
1091 STRCPY_TEXT_PRINT tGaslist 1091 STRCPY_TEXT_PRINT tGaslist
1092 ; call TFT_standard_color 1092 ; call TFT_standard_color
1093 1093
1094 WIN_SMALL dm_custom_dyn_gas_column1,dm_custom_dyn_gas_row1 1094 WIN_SMALL dm_custom_dyn_gas_column1,dm_custom_dyn_gas_row1
1095 movlw .1
1096 movwf uart1_temp
1097 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint 1095 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
1096 clrf uart1_temp
1098 rcall TFT_dyn_gaslist_common 1097 rcall TFT_dyn_gaslist_common
1099 WIN_SMALL dm_custom_dyn_gas_column1,dm_custom_dyn_gas_row2 1098 WIN_SMALL dm_custom_dyn_gas_column1,dm_custom_dyn_gas_row2
1099 rcall TFT_dyn_gaslist_common
1100 WIN_SMALL dm_custom_dyn_gas_column2,dm_custom_dyn_gas_row1
1101 rcall TFT_dyn_gaslist_common
1102 WIN_SMALL dm_custom_dyn_gas_column2,dm_custom_dyn_gas_row2
1103 rcall TFT_dyn_gaslist_common
1104 call TFT_standard_color
1105 return
1106
1107 TFT_dyn_gaslist_common:
1100 incf uart1_temp,F ; +1 1108 incf uart1_temp,F ; +1
1101 movf uart1_temp,W ; into W 1109 movf uart1_temp,W ; into W
1102 rcall TFT_dyn_gaslist_common
1103 WIN_SMALL dm_custom_dyn_gas_column2,dm_custom_dyn_gas_row1
1104 incf uart1_temp,F ; +1
1105 movf uart1_temp,W ; into W
1106 rcall TFT_dyn_gaslist_common
1107 WIN_SMALL dm_custom_dyn_gas_column2,dm_custom_dyn_gas_row2
1108 incf uart1_temp,F ; +1
1109 movf uart1_temp,W ; into W
1110 rcall TFT_dyn_gaslist_common
1111 call TFT_standard_color
1112 return
1113
1114 TFT_dyn_gaslist_common:
1115 cpfseq active_gas ;1-5 1110 cpfseq active_gas ;1-5
1116 bra TFT_dyn_gaslist_common2 1111 bra TFT_dyn_gaslist_common2
1117 incf uart1_temp,F ; +1 1112 incf uart1_temp,F ; +1
1118 TFT_dyn_gaslist_common2: 1113 TFT_dyn_gaslist_common2:
1119 movff uart1_temp,lo ; gas number 1-5 1114 movff uart1_temp,lo ; gas number 1-5
1126 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string 1121 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
1127 PUTC " " ; Clearing space 1122 PUTC " " ; Clearing space
1128 movlw 0x00 1123 movlw 0x00
1129 movff WREG,buffer+.11 ; limit to 11 chars 1124 movff WREG,buffer+.11 ; limit to 11 chars
1130 STRCAT_PRINT "" 1125 STRCAT_PRINT ""
1126 bcf win_invert
1131 return 1127 return
1132 1128
1133 1129
1134 global TFT_update_avr_stopwatch ; Update average depth and stopwatch 1130 global TFT_update_avr_stopwatch ; Update average depth and stopwatch
1135 TFT_update_avr_stopwatch: 1131 TFT_update_avr_stopwatch:
2722 ;============================================================================= 2718 ;=============================================================================
2723 global TFT_divemins 2719 global TFT_divemins
2724 TFT_divemins: 2720 TFT_divemins:
2725 movff divemins+0,lo 2721 movff divemins+0,lo
2726 movff divemins+1,hi 2722 movff divemins+1,hi
2723
2724 ; movlw .99
2725 ; addwf lo,F
2726 ; movlw .0
2727 ; addwfc hi,F
2727 2728
2728 ; Already showing divemins > 99min 2729 ; Already showing divemins > 99min
2729 btfsc no_more_divesecs ; Ignore seconds? 2730 btfsc no_more_divesecs ; Ignore seconds?
2730 bra TFT_divemins2 ; Show minutes only 2731 bra TFT_divemins2 ; Show minutes only
2731 2732
2732 ; check if divemins has hi, definitely > 99min 2733 tstfsz hi ; hi = 0?
2733 movlw .1 2734 bra TFT_divemins_clr ; No, show mins only
2734 cpfslt hi ; HI less than 1? 2735
2735 bra TFT_divemins_clr ; No, show mins only
2736
2737 ; check if divemins (when HI is zero) > 99min
2738 movlw .99 2736 movlw .99
2739 cpfsgt lo ; bigger than 99? 2737 cpfsgt lo ; bigger than 99?
2740 bra TFT_divemins1 ; No show mins:secs 2738 bra TFT_divemins1 ; No show mins:secs
2741 2739
2742 TFT_divemins_clr: 2740 TFT_divemins_clr:
2743 ; Yes, remove second display for the rest of the dive and clear seconds 2741 ; Yes, remove second display for the rest of the dive and clear seconds
2744 bsf no_more_divesecs ; Set flag 2742 bsf no_more_divesecs ; Set flag
2745 ; Clear rest of seconds 2743 ; Clear rest of seconds
2746 WIN_BOX_BLACK dm_divetime_row, dm_divetime_bot, dm_divetime_column, dm_divetime_rgt ;top, bottom, left, right 2744 WIN_BOX_BLACK dm_divetime_row, dm_divetime_bot, dm_divetime_column, dm_divetime_rgt ;top, bottom, left, right
2747 bra TFT_divemins2 ; Show minutes only 2745 bra TFT_divemins2 ; Show minutes only
2748 2746
2749 TFT_divemins1: 2747 TFT_divemins1:
2750 ; Print out the minutes, up to 99min, only 2chars ! 2748 ; Print out the minutes, up to 99min, only 2chars !
2751 call TFT_standard_color 2749 call TFT_standard_color
2752 WIN_MEDIUM dm_divetime_column, dm_divetime_row 2750 WIN_MEDIUM dm_divetime_column, dm_divetime_row
2753 2751 bcf leftbind
2754 movlw .9 2752 output_99 ; displays only last two figures from a 8Bit value (0-99)
2755 cpfsgt lo ; bigger then 9?
2756 bra TFT_divemins1_pad ; No, need padding
2757 ; Yes, just print out the value
2758 bsf leftbind
2759 movff divemins+0,lo
2760 output_99x ; displays only last two figures from a 8Bit value (00-99)
2761 bcf leftbind 2753 bcf leftbind
2762 STRCAT_PRINT "" ; Show minutes in large font 2754 STRCAT_PRINT "" ; Show minutes in large font
2763 bra TFT_divemins1_sec 2755
2764
2765 TFT_divemins1_pad:
2766 bcf leftbind
2767 PUTC " " ; Add a padding space
2768 bsf leftbind
2769 movff divemins+0,lo
2770 output_99 ; displays only last two figures from a 8Bit value (0-99)
2771 bcf leftbind
2772 STRCAT_PRINT "" ; Show minutes in large font
2773
2774 TFT_divemins1_sec:
2775 ; Print out the seconds 2756 ; Print out the seconds
2776 WIN_SMALL dm_divetime_secs_column, dm_divetime_secs_row ; left position for two sec figures 2757 WIN_SMALL dm_divetime_secs_column, dm_divetime_secs_row ; left position for two sec figures
2777 PUTC ':' 2758 PUTC ':'
2778 bsf leftbind 2759 bsf leftbind
2779 movff divesecs,lo 2760 movff divesecs,lo
2780 output_99x 2761 output_99x ; displays only last two figures from a 8Bit value with leading zero (00-99)
2781 bcf leftbind 2762 bcf leftbind
2782 STRCAT_PRINT "" ; Show seconds in small font 2763 STRCAT_PRINT "" ; Show seconds in small font
2783 return 2764 return
2784 2765
2785 TFT_divemins2: 2766 TFT_divemins2:
2767 ; Full minutes only
2786 call TFT_standard_color 2768 call TFT_standard_color
2787 WIN_MEDIUM dm_divetime_minsonly_column, dm_divetime_row 2769 WIN_MEDIUM dm_divetime_minsonly_column, dm_divetime_row
2788 bcf leftbind 2770 bcf leftbind
2789 2771 output_16_4
2790 ; if we are at or over the limit, do a WARNIGN color 2772 STRCAT_PRINT "" ; Show minutes in large font
2791 ; 9999 = 27 0F = [39][15] 2773 return
2792 movlw .38
2793 cpfsgt hi ; hi > 38 ?
2794 bra TFT_divemins2_out ; No, hi <= 38, no need to warn
2795
2796 movlw .40
2797 cpfslt hi ; hi < 40 ?
2798 bra TFT_divemins2_warn ; No, hi >= 40, need to warn
2799
2800 ; hi = 39, check lo. check 14 as 9999 should be already WARN!
2801 movlw .14
2802 cpfsgt lo
2803 bra TFT_divemins2_out ; No, lo <= 14, no need to warn
2804 ; Yes, lo > 14, need to warn
2805
2806 TFT_divemins2_warn:
2807 call TFT_warnings_color
2808 bsf win_invert
2809
2810 TFT_divemins2_out:
2811 output_16_4
2812 STRCAT_PRINT "" ; Show minutes in large font
2813 bcf win_invert
2814 return
2815 2774
2816 ;============================================================================= 2775 ;=============================================================================
2817 global TFT_display_apnoe_surface 2776 global TFT_display_apnoe_surface
2818 TFT_display_apnoe_surface: 2777 TFT_display_apnoe_surface:
2819 call TFT_divemask_color 2778 call TFT_divemask_color