comparison src/tft_outputs.asm @ 11:04794990b619

Show Max. Depth with 0.1m precision
author heinrichsweikamp
date Sun, 26 May 2013 10:24:50 +0200
parents 11d4fc797f74
children 2af021c66b0d
comparison
equal deleted inserted replaced
10:55dfc8f6093f 11:04794990b619
1649 movlw .039 1649 movlw .039
1650 cpfslt hi 1650 cpfslt hi
1651 bra depth_greater_99_84mtr 1651 bra depth_greater_99_84mtr
1652 1652
1653 btfsc depth_greater_100m ; Was depth>100m during last call 1653 btfsc depth_greater_100m ; Was depth>100m during last call
1654 call TFT_clear_depth ; Yes, clear depth area 1654 rcall TFT_clear_depth ; Yes, clear depth area
1655 bcf depth_greater_100m ; Do this once only... 1655 bcf depth_greater_100m ; Do this once only...
1656
1657 movlw .039
1658 cpfslt hi
1659 bra depth_greater_99_84mtr
1656 1660
1657 lfsr FSR2,buffer 1661 lfsr FSR2,buffer
1658 movlw HIGH d'1000' 1662 movlw HIGH d'1000'
1659 movwf sub_a+1 1663 movwf sub_a+1
1660 movlw LOW d'1000' 1664 movlw LOW d'1000'
2078 output_16_3 2082 output_16_3
2079 STRCAT_PRINT "" 2083 STRCAT_PRINT ""
2080 return 2084 return
2081 2085
2082 TFT_max_pressure2_metric: 2086 TFT_max_pressure2_metric:
2087 WIN_MEDIUM max_depth_column,max_depth_row
2088
2089 movlw .039
2090 cpfslt hi
2091 bra max_depth_greater_99_84mtr
2092
2093 btfsc max_depth_greater_100m ; Was depth>100m during last call
2094 rcall TFT_clear_max_depth ; Yes, clear depth area
2095 bcf max_depth_greater_100m ; Do this once only...
2096
2097 movlw .039
2098 cpfslt hi
2099 bra max_depth_greater_99_84mtr
2100
2101 lfsr FSR2,buffer
2102 movlw HIGH d'1000'
2103 movwf sub_a+1
2104 movlw LOW d'1000'
2105 movwf sub_a+0
2106 movff hi,sub_b+1
2107 movff lo,sub_b+0
2108 incf sub_b+0,F
2109 movlw d'0'
2110 addwfc sub_b+1,F ; Add 1mbar offset
2111 call sub16 ; sub_c = sub_a - sub_b
2112 movlw ' '
2113 btfss neg_flag ; Depth lower then 10m?
2114 movwf POSTINC2 ; Yes, add extra space
2115
2116 clrf sub_a+1
2117 movlw d'99'
2118 movwf sub_a+0
2119 movff hi,sub_b+1
2120 movff lo,sub_b+0
2121 call subU16 ; sub_c = sub_a - sub_b
2122 btfss neg_flag ; Depth lower then 1m?
2123 bra tft_max_depth2 ; Yes, display manual Zero
2124
2125 bsf ignore_digit4 ; no 0.1m
2126 bsf leftbind
2127 output_16
2128 bra tft_max_depth3
2129
2130 tft_max_depth2:
2083 WIN_MEDIUM max_depth_column,max_depth_row 2131 WIN_MEDIUM max_depth_column,max_depth_row
2084 lfsr FSR2,buffer 2132 STRCAT "0"
2085 call TFT_standard_color 2133
2086 bsf ignore_digit4 ; no 0.1m 2134 tft_max_depth3:
2135 call TFT_standard_color
2136 STRCAT_PRINT "" ; Display full meters
2137 bcf leftbind
2138
2139 ; .1m in SMALL font
2140 WIN_SMALL max_depth_dm_column,max_depth_dm_row
2141
2142 SAFE_2BYTE_COPY max_pressure, lo
2143 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
2144
2145 lfsr FSR2,buffer
2146 PUTC "."
2147
2148 movlw d'4'
2149 movwf ignore_digits
2150 bsf ignore_digit5
2151 bsf leftbind
2152 output_16dp d'0'
2153 STRCAT_PRINT "" ; Display decimeters
2154 bcf leftbind
2155 return
2156
2157 max_depth_greater_99_84mtr: ; Display only in full meters
2158 btfss max_depth_greater_100m ; Is max depth>100m already?
2159 rcall TFT_clear_max_depth ; No, clear max depth area and set flag
2160 ; Max. Depth is already in hi:lo
2161 ; Show max. depth in Full meters
2162 ; That means ignore figure 4 and 5
2163 lfsr FSR2,buffer
2164 bsf ignore_digit4
2165 bsf leftbind
2087 output_16 2166 output_16
2088 STRCAT_PRINT "" 2167 bcf leftbind
2089 return 2168 STRCAT_PRINT "" ; Display full meters only
2169 WIN_FONT FT_SMALL
2170 return
2171
2172 TFT_clear_max_depth: ; No, clear max. depth area and set flag
2173 WIN_BOX_BLACK max_depth_row,.49,max_depth_column, max_depth_dm_column+.13 ;top, bottom, left, right
2174 bsf max_depth_greater_100m ; Set Flag
2175 return
2176
2090 2177
2091 TFT_max_pressure_apnoe: 2178 TFT_max_pressure_apnoe:
2092 btfss FLAG_active_descent ; Are we descending? 2179 btfss FLAG_active_descent ; Are we descending?
2093 bra TFT_max_pressure2 ; Yes, show normal max. 2180 bra TFT_max_pressure2 ; Yes, show normal max.
2094 SAFE_2BYTE_COPY apnoe_max_pressure, lo 2181 SAFE_2BYTE_COPY apnoe_max_pressure, lo