comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 71:6beb680a6130

1.72beta - color-coded gaslist, small fix with stopwatch
author heinrichsweikamp
date Wed, 10 Nov 2010 14:59:09 +0100
parents df2d3b28947f
children a1ccb92b59cd
comparison
equal deleted inserted replaced
70:8d8e753d72e3 71:6beb680a6130
516 516
517 btfsc simulatormode_active ; Are we in simulator mode? 517 btfsc simulatormode_active ; Are we in simulator mode?
518 return ; Yes, discard everything 518 return ; Yes, discard everything
519 519
520 btfsc header_stored ; Header already stored? 520 btfsc header_stored ; Header already stored?
521 bra store_dive_data2 ; Yes, store only profile data 521 bra store_dive_data2 ; Yes, store only profile data
522 bsf header_stored ; Store header 522 bsf header_stored ; Store header
523 523
524 movff eeprom_address+0, eeprom_header_address+0 ; store startposition 524 movff eeprom_address+0, eeprom_header_address+0 ; store startposition
525 movff eeprom_address+1, eeprom_header_address+1 ; store startposition 525 movff eeprom_address+1, eeprom_header_address+1 ; store startposition
526 526
1478 bra set_powersafe1 ; Still to low 1478 bra set_powersafe1 ; Still to low
1479 bcf low_battery_state ; clear flag for battery warning mode 1479 bcf low_battery_state ; clear flag for battery warning mode
1480 return 1480 return
1481 1481
1482 calc_average_depth: 1482 calc_average_depth:
1483 bcf lock_stopwatch_reset ; Un-Lock the stopwatch reset option
1483 ; 1. Add new 2xdepth to the Sum of depths registers 1484 ; 1. Add new 2xdepth to the Sum of depths registers
1484 movff rel_pressure+0,b0_lo 1485 movff rel_pressure+0,b0_lo
1485 movff rel_pressure+1,b0_hi 1486 movff rel_pressure+1,b0_hi
1486 1487
1487 movf b0_lo,w 1488 movf b0_lo,w
1531 1532
1532 clrf average_depth_hold+0 1533 clrf average_depth_hold+0
1533 clrf average_depth_hold+1 1534 clrf average_depth_hold+1
1534 clrf average_depth_hold+2 1535 clrf average_depth_hold+2
1535 clrf average_depth_hold+3 ; Clear average depth register 1536 clrf average_depth_hold+3 ; Clear average depth register
1536 movlw d'1' 1537 movlw d'2'
1537 movwf average_divesecs+0 1538 movwf average_divesecs+0
1538 clrf average_divesecs+1 1539 clrf average_divesecs+1
1539 1540
1540 movlw d'1' 1541 movlw d'1'
1541 movwf apnoe_max_pressure+0 1542 movwf apnoe_max_pressure+0
1551 clrf apnoe_timeout_counter ; timeout in minutes 1552 clrf apnoe_timeout_counter ; timeout in minutes
1552 clrf timeout_counter ; takes care of the timeout 1553 clrf timeout_counter ; takes care of the timeout
1553 clrf timeout_counter2 ; Here: counts to six, then store deco data and temperature 1554 clrf timeout_counter2 ; Here: counts to six, then store deco data and temperature
1554 clrf AlarmType ; Clear all alarms 1555 clrf AlarmType ; Clear all alarms
1555 bcf event_occured ; clear flag 1556 bcf event_occured ; clear flag
1557 bcf lock_stopwatch_reset ; clear flag
1556 bcf depth_greater_100m ; clear flag 1558 bcf depth_greater_100m ; clear flag
1557 setf last_diluent ; to be displayed after first calculation (range: 0 to 100 [%]) 1559 setf last_diluent ; to be displayed after first calculation (range: 0 to 100 [%])
1558 bcf dekostop_active 1560 bcf dekostop_active
1559 bcf is_bailout ;=1: CC mode, but bailout active! 1561 bcf is_bailout ;=1: CC mode, but bailout active!
1560 bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode 1562 bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode