comparison src/divemode.asm @ 645:070528a88715

3.16 release
author heinrichsweikamp
date Sun, 07 Nov 2021 12:39:23 +0100
parents 7d8a4c60ec1a
children ef2ed7e3a895
comparison
equal deleted inserted replaced
644:1e695355dfc4 645:070528a88715
552 bra update_divemode60_1 ; NO - skip next 552 bra update_divemode60_1 ; NO - skip next
553 movlw d'7' ; YES - set type of alarm = battery low 553 movlw d'7' ; YES - set type of alarm = battery low
554 movwf alarm_type ; - copy to alarm register 554 movwf alarm_type ; - copy to alarm register
555 bsf event_occured ; - set event flag 555 bsf event_occured ; - set event flag
556 movlw .0 ; - coding of brightness level ECO 556 movlw .0 ; - coding of brightness level ECO
557 movff WREG,opt_brightness ; - set brightness to ECO 557 movff WREG,opt_brightness_divemode ; - set brightness to ECO
558 558
559 update_divemode60_1: 559 update_divemode60_1:
560 ; max allowed runtime in simulator is 254 minutes in 560 ; max allowed runtime in simulator is 254 minutes in
561 ; order for the tissue calculation catch-up to work! 561 ; order for the tissue calculation catch-up to work!
562 562
1971 call cmpU16 ; sub_a - sub_b = pressure_rel_cur - start-dive threshold 1971 call cmpU16 ; sub_a - sub_b = pressure_rel_cur - start-dive threshold
1972 btfsc neg_flag ; pressure_rel_cur > dive_threshold, i.e. deeper than threshold? 1972 btfsc neg_flag ; pressure_rel_cur > dive_threshold, i.e. deeper than threshold?
1973 bra check_dive_modes_shallow ; NO - shallower than threshold 1973 bra check_dive_modes_shallow ; NO - shallower than threshold
1974 btfsc divetime_longer_1min ; YES - diving > one minute? 1974 btfsc divetime_longer_1min ; YES - diving > one minute?
1975 CLRI dive_timeout_timer ; YES - reset timeout counter 1975 CLRI dive_timeout_timer ; YES - reset timeout counter
1976 decfsz dive_threshold_debounce,F ; debounce counter
1977 return
1978 incf dive_threshold_debounce,F
1976 bsf divemode ; - set dive mode flag 1979 bsf divemode ; - set dive mode flag
1977 bsf count_divetime ; - count dive time 1980 bsf count_divetime ; - count dive time
1978 return ; - done 1981 return ; - done
1979 1982
1980 check_dive_modes_shallow: 1983 check_dive_modes_shallow:
1984 movlw .5 ; load debounce counter
1985 movwf dive_threshold_debounce
1981 bcf count_divetime ; stop counting dive time 1986 bcf count_divetime ; stop counting dive time
1982 ; btfss divetime_longer_1min ; diving > one minute? 1987 ; btfss divetime_longer_1min ; diving > one minute?
1983 ; bcf divemode ; NO - quit dive mode as this was no real dive 1988 ; bcf divemode ; NO - quit dive mode as this was no real dive
1984 return ; done mH 1989 return ; done mH
1985 1990