comparison src/divemode.asm @ 657:c2e97f94c55f default tip

bump to 10.93 / 3.32
author heinrichsweikamp
date Tue, 27 Jan 2026 11:01:04 +0100
parents 8af5aefbcdaf
children
comparison
equal deleted inserted replaced
656:8af5aefbcdaf 657:c2e97f94c55f
560 bsf event_occured ; - set event flag 560 bsf event_occured ; - set event flag
561 movlw .0 ; - coding of brightness level ECO 561 movlw .0 ; - coding of brightness level ECO
562 movff WREG,opt_brightness_divemode ; - set brightness to ECO 562 movff WREG,opt_brightness_divemode ; - set brightness to ECO
563 563
564 update_divemode60_1: 564 update_divemode60_1:
565 IFDEF _ccr_pscr
566 TSTOSS opt_ScrubTmrEnable ; Scrubber Timer Enabled?
567 bra update_divemode60_3 ; NO - skip next
568
569 btfsc sensor_override_active ; in simulator mode?
570 bra update_divemode60_3 ; YES - skip next
571
572 btfsc FLAG_ccr_mode ; check if we are in CCR mode
573 bra update_divemode60_1_2 ; YES - continue with further checks
574 btfsc FLAG_pscr_mode ; check if we are in pSCR mode
575 bra update_divemode60_1_2 ; YES - continue with further checks
576 bra update_divemode60_3 ; NO - skip next
577 update_divemode60_1_2:
578 btfsc bailout_mode ; =1: in bailout mode
579 bra update_divemode60_3 ; YES - skip next
580 MOVII opt_scrubber_timer_mins,mpr ; Get the minutes into lo:hi
581 btfss hi,7 ; already negative?
582 bra update_divemode60_1_3 ; No, count-down
583 ; count up
584 INCI mpr ; ++1
585 bra update_divemode60_2 ; done
586 update_divemode60_1_3:
587 ; count down
588 DECI mpr ; --1
589 btfss hi,7 ; already negative?
590 bra update_divemode60_2 ; No, done
591 clrf lo
592 movlw b'10000000'
593 movwf hi ; clear and set negative bit
594 update_divemode60_2:
595 MOVII mpr,opt_scrubber_timer_mins ; Copy result back into opt_scrubber_timer_mins:2
596 update_divemode60_3:
597 ENDIF
565 ; max allowed runtime in simulator is 254 minutes in 598 ; max allowed runtime in simulator is 254 minutes in
566 ; order for the tissue calculation catch-up to work! 599 ; order for the tissue calculation catch-up to work!
567 600
568 btfss sensor_override_active ; in simulator mode? 601 btfss sensor_override_active ; in simulator mode?
569 return ; NO - done 602 return ; NO - done
3192 diveloop_boot: 3225 diveloop_boot:
3193 ; do the basic initialization 3226 ; do the basic initialization
3194 call restart_set_modes_and_flags ; basic settings depending on deco mode 3227 call restart_set_modes_and_flags ; basic settings depending on deco mode
3195 3228
3196 ; save on energy 3229 ; save on energy
3197 call I2C_sleep_compass ; stop accelerometer and compass 3230 ; call I2C_sleep_compass ; stop accelerometer and compass
3198 3231
3199 ; do an early initialization of all deco engine output variables to 3232 ; do an early initialization of all deco engine output variables to
3200 ; avoid glitches in the display outputs during deco engine start-up 3233 ; avoid glitches in the display outputs during deco engine start-up
3201 call deco_init_output_vars; ; (C-code) 3234 call deco_init_output_vars; ; (C-code)
3202 banksel common ; back to bank common 3235 banksel common ; back to bank common
3479 IFDEF _ccr_pscr 3512 IFDEF _ccr_pscr
3480 btfsc FLAG_ccr_mode ; in CCR mode? 3513 btfsc FLAG_ccr_mode ; in CCR mode?
3481 rcall check_gas_density ; YES - check gas density 3514 rcall check_gas_density ; YES - check gas density
3482 btfsc FLAG_pscr_mode ; in pSCR mode? 3515 btfsc FLAG_pscr_mode ; in pSCR mode?
3483 rcall check_gas_density ; YES - check gas density 3516 rcall check_gas_density ; YES - check gas density
3517
3518 btfsc FLAG_ccr_mode ; in CCR mode?
3519 rcall check_scrubber_timer ; YES - check the scrubber (If it's enabled)
3520 btfsc FLAG_pscr_mode ; in pSCR mode?
3521 rcall check_scrubber_timer ; YES - check the scrubber (If it's enabled)
3522
3484 ENDIF 3523 ENDIF
3485 3524
3486 btfsc use_aGF ; using alternative GF factors? 3525 btfsc use_aGF ; using alternative GF factors?
3487 rcall remind_agf_in_use ; YES - show reminder 3526 rcall remind_agf_in_use ; YES - show reminder
3488 3527
4000 return ; YES - suppress warning, done 4039 return ; YES - suppress warning, done
4001 bsf warn_det_no_bo_gas ; NO - set warning for no bailout gas 4040 bsf warn_det_no_bo_gas ; NO - set warning for no bailout gas
4002 incf message_counter,F ; - increase message counter 4041 incf message_counter,F ; - increase message counter
4003 goto TFT_message_no_BO_gas ; - show message and return 4042 goto TFT_message_no_BO_gas ; - show message and return
4004 4043
4044
4045 ;-----------------------------------------------------------------------------
4046 ; Check the scrubber timer
4047 ;
4048 check_scrubber_timer:
4049 bcf attn_scrubber_timer ; clear warning by default
4050 TSTOSS opt_ScrubTmrEnable ; Scrubber Timer Enabled?
4051 return ; NO - Done.
4052 MOVII opt_scrubber_timer_mins,mpr ; Get the minutes into lo:hi
4053 btfsc hi,7 ; Negative timer?
4054 bra check_scrubber_timer4 ; YES, Show the warning
4055 check_scrubber_timer2: ; NO
4056 movff lo,sub_a+0
4057 movff hi,sub_a+1
4058 movlw low_scrubber_threshold+0
4059 movwf sub_b+0
4060 movlw low_scrubber_threshold+1
4061 movwf sub_b+1
4062 call cmpU16 ; sub_a - sub_b
4063 btfss neg_flag ; theshold triggered?
4064 bra check_scrubber_timer4 ; YES, Show the warning
4065 check_scrubber_timer3: ; NO
4066 movff char_O_deco_info,WREG ; get the deco info vector
4067 btfss WREG,deco_stops_norm ; deco stops found?
4068 return ; NO - within NDL - Done.
4069 MOVII int_O_TTS_norm,sub_b ; YES - use TTS as the threshold
4070 call cmpU16 ; sub_a - sub_b
4071 btfss neg_flag ; theshold triggered?
4072 return ; NO - Done.
4073 check_scrubber_timer4: ; Show the warning
4074 incf message_counter,F ; YES - increase message counter
4075 bsf attn_scrubber_timer ; Set warning for scrubber timer
4076 goto TFT_message_scrubber ; - show message and return
4077
4078
4005 ENDIF ; _ccr_pscr 4079 ENDIF ; _ccr_pscr
4006 4080
4007 4081
4008 IFDEF _cave_mode 4082 IFDEF _cave_mode
4009 4083