Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 386:deced1cacff7 64kByte Logbook
Added velocity in divemode, BIG stopwatch in Gauge mode
author | heinrichsweikamp |
---|---|
date | Sat, 18 Jun 2011 20:17:39 +0200 |
parents | f2d5d93b4ca3 |
children | 0386c7e1374a |
comparison
equal
deleted
inserted
replaced
385:af703be9ead2 | 386:deced1cacff7 |
---|---|
1562 SAFE_2BYTE_COPY rel_pressure, lo | 1562 SAFE_2BYTE_COPY rel_pressure, lo |
1563 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 1563 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] |
1564 | 1564 |
1565 movlw .039 | 1565 movlw .039 |
1566 cpfslt hi | 1566 cpfslt hi |
1567 bra depth_greater_99_84mtr | 1567 bra depth_greater_99_84mtr |
1568 | 1568 |
1569 btfsc depth_greater_100m ; Was depth>100m during last call | 1569 btfsc depth_greater_100m ; Was depth>100m during last call |
1570 call PLED_clear_depth ; Yes, clear depth area | 1570 call PLED_clear_depth ; Yes, clear depth area |
1571 bcf depth_greater_100m ; Do this once only... | 1571 bcf depth_greater_100m ; Do this once only... |
1572 | 1572 |
1578 movwf sub_a+0 | 1578 movwf sub_a+0 |
1579 movff hi,sub_b+1 | 1579 movff hi,sub_b+1 |
1580 movff lo,sub_b+0 | 1580 movff lo,sub_b+0 |
1581 incf sub_b+0,F | 1581 incf sub_b+0,F |
1582 movlw d'0' | 1582 movlw d'0' |
1583 addwfc sub_b+1,F ; Add 1mBar offset | 1583 addwfc sub_b+1,F ; Add 1mBar offset |
1584 call sub16 ; sub_c = sub_a - sub_b | 1584 call sub16 ; sub_c = sub_a - sub_b |
1585 btfss neg_flag ; Depth lower then 10m? | 1585 btfss neg_flag ; Depth lower then 10m? |
1586 rcall depth_less_10mtr ; Yes, add extra space | 1586 rcall depth_less_10mtr ; Yes, add extra space |
1587 | 1587 |
1588 WIN_TOP .24 | 1588 WIN_TOP .24 |
1601 btfss neg_flag ; Depth lower then 1m? | 1601 btfss neg_flag ; Depth lower then 1m? |
1602 bra pled_depth2 ; Yes, display manual Zero | 1602 bra pled_depth2 ; Yes, display manual Zero |
1603 | 1603 |
1604 bsf leftbind | 1604 bsf leftbind |
1605 bsf ignore_digit4 | 1605 bsf ignore_digit4 |
1606 output_16 ; Full meters in Big font | 1606 output_16 ; Full meters in Big font |
1607 bcf leftbind | 1607 bcf leftbind |
1608 bra pled_depth3 | 1608 bra pled_depth3 |
1609 | 1609 |
1610 pled_depth2: | 1610 pled_depth2: |
1611 PUTC '0' | 1611 PUTC '0' |
1622 SAFE_2BYTE_COPY rel_pressure, lo | 1622 SAFE_2BYTE_COPY rel_pressure, lo |
1623 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | 1623 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] |
1624 | 1624 |
1625 STRCPY "." | 1625 STRCPY "." |
1626 | 1626 |
1627 movlw HIGH d'9' | 1627 movlw HIGH d'20' ; Display 0.0m if lower then 20cm |
1628 movwf sub_a+1 | 1628 movwf sub_a+1 |
1629 movlw LOW d'9' | 1629 movlw LOW d'20' |
1630 movwf sub_a+0 | 1630 movwf sub_a+0 |
1631 movff hi,sub_b+1 | 1631 movff hi,sub_b+1 |
1632 movff lo,sub_b+0 | 1632 movff lo,sub_b+0 |
1633 call sub16 ; sub_c = sub_a - sub_b | 1633 call sub16 ; sub_c = sub_a - sub_b |
1634 btfss neg_flag ; Depth lower then 0.1m? | 1634 btfss neg_flag ; Depth lower then 0.3m? |
1635 bra pled_depth4 ; Yes, display manual Zero | 1635 bra pled_depth4 ; Yes, display manual Zero |
1636 | 1636 |
1637 movlw d'4' | 1637 movlw d'4' |
1638 movwf ignore_digits | 1638 movwf ignore_digits |
1639 bsf ignore_digit5 | 1639 bsf ignore_digit5 |
2219 bsf ignore_digit5 ; do not display 1cm depth | 2219 bsf ignore_digit5 ; do not display 1cm depth |
2220 output_16dp d'3' | 2220 output_16dp d'3' |
2221 bcf leftbind | 2221 bcf leftbind |
2222 STRCAT_PRINT "m" | 2222 STRCAT_PRINT "m" |
2223 return | 2223 return |
2224 | |
2225 PLED_stopwatch_show_gauge: | |
2226 btfsc menubit ; Divemode menu active? | |
2227 return ; Yes, return | |
2228 ; BIG Stopwatch | |
2229 call PLED_divemask_color ; Set Color for Divemode mask | |
2230 DISPLAYTEXTH d'310' ; Stopwatch | |
2231 DISPLAYTEXTH d'309' ; Average | |
2232 call PLED_standard_color | |
2233 ostc_debug 'V' ; Sends debug-information to screen if debugmode active | |
2234 WIN_TOP .80 | |
2235 WIN_LEFT .90 | |
2236 WIN_FONT FT_MEDIUM | |
2237 call PLED_standard_color | |
2238 | |
2239 lfsr FSR2,letter | |
2240 movff average_divesecs+0,lo ; Stopwatch | |
2241 movff average_divesecs+1,hi ; Stopwatch | |
2242 movlw d'2' | |
2243 subwf lo,F | |
2244 movlw d'0' | |
2245 subwfb hi,F ; Subtract 2 seconds | |
2246 call convert_time ; converts hi:lo in seconds to mins (hi) and secs (lo) | |
2247 movff lo,wait_temp | |
2248 movff hi,lo | |
2249 clrf hi | |
2250 movlw d'0' | |
2251 bcf leftbind | |
2252 bsf show_last3 | |
2253 output_16_3 ;Displays only 0...999 | |
2254 PUTC ':' | |
2255 movff wait_temp,lo | |
2256 output_99x | |
2257 call word_processor | |
2258 | |
2259 ostc_debug 'U' ; Sends debug-information to screen if debugmode active | |
2260 WIN_TOP .136 | |
2261 WIN_LEFT .90 | |
2262 WIN_FONT FT_MEDIUM | |
2263 call PLED_standard_color | |
2264 lfsr FSR2,letter | |
2265 movff avr_rel_pressure+0,lo | |
2266 movff avr_rel_pressure+1,hi | |
2267 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
2268 bsf ignore_digit5 ; do not display 1cm depth | |
2269 output_16dp d'3' | |
2270 bcf leftbind | |
2271 STRCAT_PRINT "m" | |
2272 WIN_FONT FT_SMALL ; Reset... | |
2273 return | |
2274 | |
2224 | 2275 |
2225 PLED_total_average_show: | 2276 PLED_total_average_show: |
2226 ; Non-Resettable Average | 2277 ; Non-Resettable Average |
2227 call PLED_divemask_color ; Set Color for Divemode mask | 2278 call PLED_divemask_color ; Set Color for Divemode mask |
2228 DISPLAYTEXTH d'281' ; Avr.Depth | 2279 DISPLAYTEXTH d'281' ; Avr.Depth |
3086 STRCAT_PRINT " " ; Display Setpoint with training zero | 3137 STRCAT_PRINT " " ; Display Setpoint with training zero |
3087 call PLED_standard_color ; Reset color | 3138 call PLED_standard_color ; Reset color |
3088 return | 3139 return |
3089 | 3140 |
3090 PLED_const_ppO2_too_hi: | 3141 PLED_const_ppO2_too_hi: |
3091 movlw '>' | 3142 PUTC '>' |
3092 movwf POSTINC2 ; Put ">" from WREG into buffer | |
3093 setf lo ; show ">2.55" | 3143 setf lo ; show ">2.55" |
3094 clrf hi ; clear hi | 3144 clrf hi ; clear hi |
3095 call PLED_warnings_color ; Set Warning color | 3145 call PLED_warnings_color ; Set Warning color |
3096 return | 3146 return |
3097 | 3147 |