comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 352:544a96faa9f3 64kByte Logbook

New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
author Heinrichsweikamp
date Mon, 06 Jun 2011 18:50:26 +0200
parents 5c186a72cb5d
children 562f1bc79f3c
comparison
equal deleted inserted replaced
351:5c186a72cb5d 352:544a96faa9f3
1422 bra timeout_divemode3 ; Yes, use fixed 5 seconds timeout 1422 bra timeout_divemode3 ; Yes, use fixed 5 seconds timeout
1423 endif 1423 endif
1424 1424
1425 bcf divemode 1425 bcf divemode
1426 incf timeout_counter,F 1426 incf timeout_counter,F
1427 GETCUSTOM8 d'2' ; diveloop_timeout 1427 movlw d'0'
1428 addlw d'2' ; adds two seconds in case timout=zero! 1428 addwfc timeout_counter2,F ; timeout is 15bits
1429 btfsc STATUS,C ; > 255? 1429 GETCUSTOM15 d'2' ; diveloop_timeout
1430 movlw d'255' ; Set to 255... 1430 movff lo,sub_a+0
1431 decf WREG,F ; Limit to 254 1431 movff hi,sub_a+1
1432 cpfsgt timeout_counter 1432 movff timeout_counter, sub_b+0
1433 bsf divemode 1433 movff timeout_counter2, sub_b+1
1434 call sub16 ; sub_c = sub_a - sub_b
1435 btfss neg_flag ; Result negative?
1436 bsf divemode ; No, set flag
1434 return 1437 return
1435 1438
1436 timeout_divemode2: 1439 timeout_divemode2:
1437 incf timeout_counter,F ; seconds... 1440 incf timeout_counter,F ; seconds...
1438 movlw d'60' 1441 movlw d'60'
1718 clrf menupos3 1721 clrf menupos3
1719 bcf menu3_active 1722 bcf menu3_active
1720 clrf divesecs 1723 clrf divesecs
1721 clrf samplesecs 1724 clrf samplesecs
1722 clrf apnoe_timeout_counter ; timeout in minutes 1725 clrf apnoe_timeout_counter ; timeout in minutes
1723 clrf timeout_counter ; takes care of the timeout 1726 clrf timeout_counter ; takes care of the timeout (Low byte)
1724 clrf timeout_counter2 ; Here: counts to six, then store deco data and temperature 1727 clrf timeout_counter2 ; takes care of the timeout (High byte)
1725 clrf AlarmType ; Clear all alarms 1728 clrf AlarmType ; Clear all alarms
1726 bcf event_occured ; clear flag 1729 bcf event_occured ; clear flag
1727 bcf setpoint_changed ; clear flag 1730 bcf setpoint_changed ; clear flag
1728 rcall reset_average1 ; Reset the resettable average depth 1731 rcall reset_average1 ; Reset the resettable average depth
1729 clrf average_depth_hold_total+0 1732 clrf average_depth_hold_total+0