comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 615:3ab53b57f879

Bugfix: CF01 for end-of-dive detection
author heinrichsweikamp
date Fri, 20 Jul 2012 15:41:56 +0200
parents ec2cfd4b748b
children 8d1ff6fc54f5
comparison
equal deleted inserted replaced
614:7a269c01192a 615:3ab53b57f879
1656 1656
1657 set_dive_modes: 1657 set_dive_modes:
1658 btfsc high_altitude_mode ; In high altitude (Fly) mode? 1658 btfsc high_altitude_mode ; In high altitude (Fly) mode?
1659 bra set_dive_modes3 ; Yes! 1659 bra set_dive_modes3 ; Yes!
1660 1660
1661 btfss divemode ; In divemode?
1662 bra set_dive_modes0 ; No.
1663
1664 ; in Divemode, check threshold from CF01
1665 GETCUSTOM8 .1 ; loads dive_threshold in WREG
1666 movwf sub_a+0 ; dive_treshold is in cm
1667 clrf sub_a+1
1668 bra set_dive_modes1 ; Done.
1669
1661 set_dive_modes0: 1670 set_dive_modes0:
1662 GETCUSTOM8 .0 ; loads dive_threshold in WREG 1671 GETCUSTOM8 .0 ; loads dive_threshold in WREG
1663 movwf sub_a+0 ; dive_treshold is in cm 1672 movwf sub_a+0 ; dive_treshold is in cm
1664 clrf sub_a+1 1673 clrf sub_a+1
1674 bra set_dive_modes1 ; Done.
1665 1675
1666 set_dive_modes1: 1676 set_dive_modes1:
1667 SAFE_2BYTE_COPY rel_pressure, sub_b 1677 SAFE_2BYTE_COPY rel_pressure, sub_b
1668 call sub16 ; sub_c = sub_a - sub_b 1678 call sub16 ; sub_c = sub_a - sub_b
1669 1679