Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 398:ab962c4b19d6
Fixing issue 50, correct "Bar" to "bar" in texts and comments
author | heinrichsweikamp |
---|---|
date | Sun, 26 Jun 2011 12:24:54 +0200 |
parents | 0386c7e1374a |
children | 1677453fbbe3 |
comparison
equal
deleted
inserted
replaced
396:0386c7e1374a | 398:ab962c4b19d6 |
---|---|
86 call PLED_color_code1 | 86 call PLED_color_code1 |
87 endm | 87 endm |
88 | 88 |
89 PLED_color_code1: ; Color-codes the output, if required | 89 PLED_color_code1: ; Color-codes the output, if required |
90 dcfsnz WREG | 90 dcfsnz WREG |
91 bra PLED_color_code_depth ; CF43 [mBar], 16Bit | 91 bra PLED_color_code_depth ; CF43 [mbar], 16Bit |
92 dcfsnz WREG | 92 dcfsnz WREG |
93 bra PLED_color_code_cns ; CF44 [%] | 93 bra PLED_color_code_cns ; CF44 [%] |
94 dcfsnz WREG | 94 dcfsnz WREG |
95 bra PLED_color_code_gf ; CF45 [%] | 95 bra PLED_color_code_gf ; CF45 [%] |
96 dcfsnz WREG | 96 dcfsnz WREG |
97 bra PLED_color_code_ppo2 ; CF46 [cBar] | 97 bra PLED_color_code_ppo2 ; CF46 [cbar] |
98 dcfsnz WREG | 98 dcfsnz WREG |
99 bra PLED_color_code_velocity ; CF47 [m/min] | 99 bra PLED_color_code_velocity ; CF47 [m/min] |
100 dcfsnz WREG | 100 dcfsnz WREG |
101 bra PLED_color_code_ceiling ; Show warning if CF41=1 and current depth>shown ceiling | 101 bra PLED_color_code_ceiling ; Show warning if CF41=1 and current depth>shown ceiling |
102 dcfsnz WREG | 102 dcfsnz WREG |
114 movff xC+1,xA+1 | 114 movff xC+1,xA+1 |
115 movff EEDATA,xB+0 | 115 movff EEDATA,xB+0 |
116 clrf xB+1 | 116 clrf xB+1 |
117 call mult16x16 ; EEDATA * p_amb/10 | 117 call mult16x16 ; EEDATA * p_amb/10 |
118 | 118 |
119 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55Bar? | 119 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? |
120 bra PLED_color_code_gaslist1 ; Yes, warn in warning color | |
121 ; Check if ppO2>3,30bar | |
122 btfsc xC+1,7 | |
120 bra PLED_color_code_gaslist1 ; Yes, warn in warning color | 123 bra PLED_color_code_gaslist1 ; Yes, warn in warning color |
121 | 124 |
122 movff xC+0,sub_a+0 | 125 movff xC+0,sub_a+0 |
123 movff xC+1,sub_a+1 | 126 movff xC+1,sub_a+1 |
124 GETCUSTOM8 d'46' ; color-code ppO2 warning [cBar] | 127 GETCUSTOM8 d'46' ; color-code ppO2 warning [cbar] |
125 mullw d'100' ; ppo2_warning_high*100 | 128 mullw d'100' ; ppo2_warning_high*100 |
126 movff PRODL,sub_b+0 | 129 movff PRODL,sub_b+0 |
127 movff PRODH,sub_b+1 | 130 movff PRODH,sub_b+1 |
128 call sub16 ; sub_c = sub_a - sub_b | 131 call sub16 ; sub_c = sub_a - sub_b |
129 btfss neg_flag | 132 btfss neg_flag |
130 bra PLED_color_code_gaslist1; too high -> Warning Color! | 133 bra PLED_color_code_gaslist1; too high -> Warning Color! |
131 call PLED_standard_color | 134 call PLED_standard_color |
132 return | 135 return |
133 | 136 |
134 PLED_color_code_gaslist1: | 137 PLED_color_code_gaslist1: |
135 call PLED_warnings_color | 138 call PLED_warnings_color |
136 return | 139 return |
137 | 140 |
138 PLED_color_code_ceiling: | 141 PLED_color_code_ceiling: |
139 GETCUSTOM8 d'40' ; =1: Warn at all? | 142 GETCUSTOM8 d'40' ; =1: Warn at all? |
140 movwf lo | 143 movwf lo |
141 movlw d'1' | 144 movlw d'1' |
142 cpfseq lo ; =1? | 145 cpfseq lo ; =1? |
143 bra PLED_color_code_ceiling1 ; No, Set to default color | 146 bra PLED_color_code_ceiling1 ; No, Set to default color |
144 | 147 |
145 SAFE_2BYTE_COPY rel_pressure, lo | 148 SAFE_2BYTE_COPY rel_pressure, lo |
146 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 149 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
147 movff hi,xA+1 | 150 movff hi,xA+1 |
148 movff lo,xA+0 | 151 movff lo,xA+0 |
149 movff char_O_first_deco_depth,lo ; Ceiling in m | 152 movff char_O_first_deco_depth,lo ; Ceiling in m |
150 decf lo,F ; -1 | 153 decf lo,F ; -1 |
151 movlw LOW d'100' | 154 movlw LOW d'100' |
165 | 168 |
166 PLED_color_code_depth: | 169 PLED_color_code_depth: |
167 movff hi,hi_temp | 170 movff hi,hi_temp |
168 movff lo,lo_temp | 171 movff lo,lo_temp |
169 SAFE_2BYTE_COPY rel_pressure, lo | 172 SAFE_2BYTE_COPY rel_pressure, lo |
170 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 173 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
171 movff lo,sub_a+0 | 174 movff lo,sub_a+0 |
172 movff hi,sub_a+1 | 175 movff hi,sub_a+1 |
173 GETCUSTOM15 d'43' ; Depth warn [mBar] | 176 GETCUSTOM15 d'43' ; Depth warn [mbar] |
174 movff lo,sub_b+0 | 177 movff lo,sub_b+0 |
175 movff hi,sub_b+1 | 178 movff hi,sub_b+1 |
176 call sub16 ; sub_c = sub_a - sub_b | 179 call sub16 ; sub_c = sub_a - sub_b |
177 btfss neg_flag | 180 btfss neg_flag |
178 bra PLED_color_code_depth2; Set to warning color | 181 bra PLED_color_code_depth2; Set to warning color |
209 PLED_color_code_gf2: | 212 PLED_color_code_gf2: |
210 call PLED_warnings_color | 213 call PLED_warnings_color |
211 return | 214 return |
212 | 215 |
213 PLED_color_code_ppo2: | 216 PLED_color_code_ppo2: |
214 ; Check very high ppO2 manually | 217 ; Check if ppO2>6,55bar |
215 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55Bar? | 218 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? |
219 bra PLED_color_code_ppo22 ; Yes, warn in warning color | |
220 ; Check if ppO2>3,30bar | |
221 btfsc xC+1,7 | |
216 bra PLED_color_code_ppo22 ; Yes, warn in warning color | 222 bra PLED_color_code_ppo22 ; Yes, warn in warning color |
217 | 223 |
218 movff xC+0,sub_a+0 | 224 movff xC+0,sub_a+0 |
219 movff xC+1,sub_a+1 | 225 movff xC+1,sub_a+1 |
220 GETCUSTOM8 d'46' ; color-code ppO2 warning [cBar] | 226 GETCUSTOM8 d'46' ; color-code ppO2 warning [cbar] |
221 mullw d'100' | 227 mullw d'100' |
222 movff PRODL,sub_b+0 | 228 movff PRODL,sub_b+0 |
223 movff PRODH,sub_b+1 | 229 movff PRODH,sub_b+1 |
224 call sub16 ; sub_c = sub_a - sub_b | 230 call sub16 ; sub_c = sub_a - sub_b |
225 btfss neg_flag | 231 btfss neg_flag |
226 bra PLED_color_code_ppo22; Set to warning color | 232 bra PLED_color_code_ppo22; Set to warning color |
227 call PLED_standard_color | 233 call PLED_standard_color |
228 return | 234 return |
229 PLED_color_code_ppo22: | 235 PLED_color_code_ppo22: |
1017 ostc_debug 't' ; Sends debug-information to screen if debugmode active | 1023 ostc_debug 't' ; Sends debug-information to screen if debugmode active |
1018 WIN_TOP .119 | 1024 WIN_TOP .119 |
1019 WIN_LEFT .0 | 1025 WIN_LEFT .0 |
1020 WIN_FONT FT_SMALL | 1026 WIN_FONT FT_SMALL |
1021 PLED_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) | 1027 PLED_color_code warn_ppo2 ; Color-code output (ppO2 stored in xC) |
1022 | |
1023 STRCPY "ppO2:" | 1028 STRCPY "ppO2:" |
1024 | 1029 |
1025 ; Check very high ppO2 manually | 1030 ; Check very high ppO2 manually |
1026 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55Bar? | 1031 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? |
1027 bra PLED_show_ppO2_3 ; Yes, display fixed Value! | 1032 bra PLED_show_ppO2_3 ; Yes, display fixed Value! |
1028 | 1033 |
1029 movff xC+0,lo | 1034 movff xC+0,lo |
1030 movff xC+1,hi | 1035 movff xC+1,hi |
1031 bsf ignore_digit4 | 1036 bsf ignore_digit4 |
1403 movff EEDATA,lo ; copy to lo | 1408 movff EEDATA,lo ; copy to lo |
1404 clrf hi | 1409 clrf hi |
1405 output_16dp d'3' ; outputs into Postinc2! | 1410 output_16dp d'3' ; outputs into Postinc2! |
1406 bcf leftbind | 1411 bcf leftbind |
1407 | 1412 |
1408 STRCAT_PRINT "Bar" | 1413 STRCAT_PRINT "bar" |
1409 bra PLED_active_gas_surfmode_exit | 1414 bra PLED_active_gas_surfmode_exit |
1410 | 1415 |
1411 PLED_active_gas_surfmode2: | 1416 PLED_active_gas_surfmode2: |
1412 WIN_TOP .130 | 1417 WIN_TOP .130 |
1413 WIN_LEFT .100 | 1418 WIN_LEFT .100 |
1558 | 1563 |
1559 | 1564 |
1560 PLED_depth: | 1565 PLED_depth: |
1561 ostc_debug 'r' ; Sends debug-information to screen if debugmode active | 1566 ostc_debug 'r' ; Sends debug-information to screen if debugmode active |
1562 SAFE_2BYTE_COPY rel_pressure, lo | 1567 SAFE_2BYTE_COPY rel_pressure, lo |
1563 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 1568 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
1564 | 1569 |
1565 movlw .039 | 1570 movlw .039 |
1566 cpfslt hi | 1571 cpfslt hi |
1567 bra depth_greater_99_84mtr | 1572 bra depth_greater_99_84mtr |
1568 | 1573 |
1578 movwf sub_a+0 | 1583 movwf sub_a+0 |
1579 movff hi,sub_b+1 | 1584 movff hi,sub_b+1 |
1580 movff lo,sub_b+0 | 1585 movff lo,sub_b+0 |
1581 incf sub_b+0,F | 1586 incf sub_b+0,F |
1582 movlw d'0' | 1587 movlw d'0' |
1583 addwfc sub_b+1,F ; Add 1mBar offset | 1588 addwfc sub_b+1,F ; Add 1mbar offset |
1584 call sub16 ; sub_c = sub_a - sub_b | 1589 call sub16 ; sub_c = sub_a - sub_b |
1585 btfss neg_flag ; Depth lower then 10m? | 1590 btfss neg_flag ; Depth lower then 10m? |
1586 rcall depth_less_10mtr ; Yes, add extra space | 1591 rcall depth_less_10mtr ; Yes, add extra space |
1587 | 1592 |
1588 WIN_TOP .24 | 1593 WIN_TOP .24 |
1618 WIN_TOP .50 | 1623 WIN_TOP .50 |
1619 WIN_LEFT .40 | 1624 WIN_LEFT .40 |
1620 PLED_color_code warn_depth ; Color-code the output | 1625 PLED_color_code warn_depth ; Color-code the output |
1621 | 1626 |
1622 SAFE_2BYTE_COPY rel_pressure, lo | 1627 SAFE_2BYTE_COPY rel_pressure, lo |
1623 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 1628 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
1624 | 1629 |
1625 STRCPY "." | 1630 STRCPY "." |
1626 | 1631 |
1627 movlw HIGH d'20' ; Display 0.0m if lower then 20cm | 1632 movlw HIGH d'20' ; Display 0.0m if lower then 20cm |
1628 movwf sub_a+1 | 1633 movwf sub_a+1 |
2009 | 2014 |
2010 PLED_max_pressure: | 2015 PLED_max_pressure: |
2011 ostc_debug 'p' ; Sends debug-information to screen if debugmode active | 2016 ostc_debug 'p' ; Sends debug-information to screen if debugmode active |
2012 movff max_pressure+0,lo | 2017 movff max_pressure+0,lo |
2013 movff max_pressure+1,hi | 2018 movff max_pressure+1,hi |
2014 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 2019 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
2015 | 2020 |
2016 movlw .039 | 2021 movlw .039 |
2017 cpfslt hi | 2022 cpfslt hi |
2018 bra maxdepth_greater_99_84mtr | 2023 bra maxdepth_greater_99_84mtr |
2019 | 2024 |
2213 call PLED_standard_color | 2218 call PLED_standard_color |
2214 | 2219 |
2215 lfsr FSR2,letter | 2220 lfsr FSR2,letter |
2216 movff avr_rel_pressure+0,lo | 2221 movff avr_rel_pressure+0,lo |
2217 movff avr_rel_pressure+1,hi | 2222 movff avr_rel_pressure+1,hi |
2218 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 2223 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
2219 bsf ignore_digit5 ; do not display 1cm depth | 2224 bsf ignore_digit5 ; do not display 1cm depth |
2220 output_16dp d'3' | 2225 output_16dp d'3' |
2221 bcf leftbind | 2226 bcf leftbind |
2222 STRCAT_PRINT "m" | 2227 STRCAT_PRINT "m" |
2223 return | 2228 return |
2262 WIN_FONT FT_MEDIUM | 2267 WIN_FONT FT_MEDIUM |
2263 call PLED_standard_color | 2268 call PLED_standard_color |
2264 lfsr FSR2,letter | 2269 lfsr FSR2,letter |
2265 movff avr_rel_pressure+0,lo | 2270 movff avr_rel_pressure+0,lo |
2266 movff avr_rel_pressure+1,hi | 2271 movff avr_rel_pressure+1,hi |
2267 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 2272 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
2268 bsf ignore_digit5 ; do not display 1cm depth | 2273 bsf ignore_digit5 ; do not display 1cm depth |
2269 output_16dp d'3' | 2274 output_16dp d'3' |
2270 bcf leftbind | 2275 bcf leftbind |
2271 STRCAT_PRINT "m" | 2276 STRCAT_PRINT "m" |
2272 WIN_FONT FT_SMALL ; Reset... | 2277 WIN_FONT FT_SMALL ; Reset... |
2285 call PLED_standard_color | 2290 call PLED_standard_color |
2286 | 2291 |
2287 lfsr FSR2,letter | 2292 lfsr FSR2,letter |
2288 movff avr_rel_pressure_total+0,lo | 2293 movff avr_rel_pressure_total+0,lo |
2289 movff avr_rel_pressure_total+1,hi | 2294 movff avr_rel_pressure_total+1,hi |
2290 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 2295 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] |
2291 bsf ignore_digit5 ; do not display 1cm depth | 2296 bsf ignore_digit5 ; do not display 1cm depth |
2292 bcf leftbind | 2297 bcf leftbind |
2293 output_16dp d'3' | 2298 output_16dp d'3' |
2294 STRCAT_PRINT "m" | 2299 STRCAT_PRINT "m" |
2295 return | 2300 return |
3104 movwf xB+0 | 3109 movwf xB+0 |
3105 clrf xB+1 | 3110 clrf xB+1 |
3106 call div16x16 ;xA/xB=xC with xA as remainder | 3111 call div16x16 ;xA/xB=xC with xA as remainder |
3107 | 3112 |
3108 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | 3113 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value |
3109 movff xC+1,hi ; For test if ppO2>2,55Bar | 3114 movff xC+1,hi ; For test if ppO2>2,55bar |
3110 | 3115 |
3111 GETCUSTOM8 d'39' ; Adjust fixed SP? | 3116 GETCUSTOM8 d'39' ; Adjust fixed SP? |
3112 dcfsnz WREG,F | 3117 dcfsnz WREG,F |
3113 bra PLED_const_ppO2_value1a ; Yes! | 3118 bra PLED_const_ppO2_value1a ; Yes! |
3114 ; Do not adjust -> restore original SetPoint | 3119 ; Do not adjust -> restore original SetPoint |
3578 bcf leftbind | 3583 bcf leftbind |
3579 return ; Return (CC Mode) | 3584 return ; Return (CC Mode) |
3580 | 3585 |
3581 | 3586 |
3582 | 3587 |
3583 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mBar] | 3588 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mbar] |
3584 | 3589 |
3585 btfsc simulatormode_active ; Do apply salinity in Simulatormode | 3590 btfsc simulatormode_active ; Do apply salinity in Simulatormode |
3586 return | 3591 return |
3587 | 3592 |
3588 read_int_eeprom d'26' ; Read Salinity from EEPROM | 3593 read_int_eeprom d'26' ; Read Salinity from EEPROM |