Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 839:ab68f28514e0
undo faulty 6 seconds velocity from rev. 834
author | heinrichsweikamp |
---|---|
date | Fri, 07 Jul 2023 16:29:17 +0200 |
parents | f8afe90796d6 |
children |
comparison
equal
deleted
inserted
replaced
838:2750099bf5bb | 839:ab68f28514e0 |
---|---|
949 calc_velocity: ; called every two seconds | 949 calc_velocity: ; called every two seconds |
950 btfss divemode | 950 btfss divemode |
951 bra do_not_display_velocity ; display velocity only in divemode | 951 bra do_not_display_velocity ; display velocity only in divemode |
952 | 952 |
953 calc_velocity2: | 953 calc_velocity2: |
954 ; Update ring buffer | 954 SAFE_2BYTE_COPY amb_pressure, sub_a |
955 movff last_pressure+2,last_pressure+4 | 955 movff last_pressure+0,sub_b+0 |
956 movff last_pressure+3,last_pressure+5 | 956 movff last_pressure+1,sub_b+1 |
957 movff last_pressure+0,last_pressure+2 | 957 movff sub_a+0,last_pressure+0 ; store old value for velocity |
958 movff last_pressure+1,last_pressure+3 | 958 movff sub_a+1,last_pressure+1 |
959 SAFE_2BYTE_COPY amb_pressure, last_pressure | |
960 | |
961 | |
962 ; use 6sec interval for velocity | |
963 movff last_pressure+4,sub_b+0 | |
964 movff last_pressure+5,sub_b+1 | |
965 movff last_pressure+0,sub_a+0 | |
966 movff last_pressure+1,sub_a+1 | |
967 | 959 |
968 call sub16 ; sub_c = amb_pressure - last_pressure | 960 call sub16 ; sub_c = amb_pressure - last_pressure |
969 | 961 |
970 movff sub_c+0,xA+0 | 962 movff sub_c+0,xA+0 |
971 movff sub_c+1,xA+1 | 963 movff sub_c+1,xA+1 |