Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 237:55178aa1f972
Hunting for NoFly bug...
+ Asserts for NoFly range.
+ Bugfix surface pressure in simulator mode.
author | JeanDo |
---|---|
date | Sun, 20 Mar 2011 10:19:19 +0100 |
parents | 2cbaa01dac26 |
children | 3ed240d60341 |
comparison
equal
deleted
inserted
replaced
236:3dbeacf42e9e | 237:55178aa1f972 |
---|---|
459 call PLED_display_ndl ; display no deco limit | 459 call PLED_display_ndl ; display no deco limit |
460 return | 460 return |
461 | 461 |
462 ;----------------------------------------------------------------------------- | 462 ;----------------------------------------------------------------------------- |
463 | 463 |
464 divemode_prepare_flags_for_deco: | 464 divemode_prepare_flags_for_deco: |
465 movff amb_pressure+0,int_I_pres_respiration+0 ; lo and copy result to deco routine | 465 movff amb_pressure+0,int_I_pres_respiration+0 ; lo and copy result to deco routine |
466 movff amb_pressure+1,int_I_pres_respiration+1 ; hi | 466 movff amb_pressure+1,int_I_pres_respiration+1 ; hi |
467 GETCUSTOM8 d'11' ; Saturation multiplier % | 467 GETCUSTOM8 d'11' ; Saturation multiplier % |
468 movff WREG,char_I_saturation_multiplier | 468 movff WREG,char_I_saturation_multiplier |
469 GETCUSTOM8 d'12' ; Desaturation multiplier % | 469 GETCUSTOM8 d'12' ; Desaturation multiplier % |
769 | 769 |
770 bcf display_velocity ; Velocity was displayed, delete velocity now | 770 bcf display_velocity ; Velocity was displayed, delete velocity now |
771 call PLED_display_velocity_clear | 771 call PLED_display_velocity_clear |
772 return | 772 return |
773 | 773 |
774 check_ppO2: ; check current ppO2 and display warning if required | 774 check_ppO2: ; check current ppO2 and display warning if required |
775 btfsc FLAG_const_ppO2_mode ; ignore in ppO2 mode.... | 775 btfsc FLAG_const_ppO2_mode ; ignore in ppO2 mode.... |
776 return | 776 return |
777 | 777 |
778 check_ppO2_bail: ; In CC mode but bailout active! | 778 check_ppO2_bail: ; In CC mode but bailout active! |
779 movff amb_pressure+0,xA+0 | 779 movff amb_pressure+0,xA+0 |
780 movff amb_pressure+1,xA+1 | 780 movff amb_pressure+1,xA+1 |
1596 bcf is_bailout ;=1: CC mode, but bailout active! | 1596 bcf is_bailout ;=1: CC mode, but bailout active! |
1597 bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode | 1597 bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode |
1598 | 1598 |
1599 call get_free_EEPROM_location ; get last position in external EEPROM, may be up to 2 secs! | 1599 call get_free_EEPROM_location ; get last position in external EEPROM, may be up to 2 secs! |
1600 | 1600 |
1601 btfss simulatormode_active | |
1602 bra diveloop_boot_1 | |
1603 ; Normal mode = Surface pressure is the pressure 30mn before dive. | |
1604 movff last_surfpressure_30min+0,int_I_pres_surface+0 ; LOW copy surfacepressure to deco routine | |
1601 movff last_surfpressure_30min+1,int_I_pres_surface+1 ; HIGH copy surfacepressure to deco routine | 1605 movff last_surfpressure_30min+1,int_I_pres_surface+1 ; HIGH copy surfacepressure to deco routine |
1602 movff last_surfpressure_30min+0,int_I_pres_surface+0 ; LOW copy surfacepressure to deco routine | 1606 bra diveloop_boot_2 |
1603 movff temperature+0,mintemp+0 ; Reset Min-Temp registers | 1607 |
1604 movff temperature+1,mintemp+1 ; Reset Min-Temp registers | 1608 diveloop_boot_1: |
1609 ; Simulator mode: Surface pressure is 1bar. | |
1610 movlw LOW .1000 | |
1611 movff WREG,int_I_pres_surface+0 ; LOW copy surfacepressure to deco routine | |
1612 movlw HIGH .1000 | |
1613 movff WREG,int_I_pres_surface+1 ; HIGH copy surfacepressure to deco routine | |
1614 | |
1615 diveloop_boot_2: | |
1616 movff temperature+0,mintemp+0 ; Reset Min-Temp registers | |
1617 movff temperature+1,mintemp+1 ; Reset Min-Temp registers | |
1605 | 1618 |
1606 ; Init profile recording parameters | 1619 ; Init profile recording parameters |
1607 GETCUSTOM8 d'20' ; sample rate | 1620 GETCUSTOM8 d'20' ; sample rate |
1608 movwf samplesecs_value ; to avoid EEPROM access in the ISR | 1621 movwf samplesecs_value ; to avoid EEPROM access in the ISR |
1609 GETCUSTOM8 d'21' | 1622 GETCUSTOM8 d'21' |
1610 movwf divisor_temperature ; load divisors for profile storage | 1623 movwf divisor_temperature ; load divisors for profile storage |
1611 GETCUSTOM8 d'22' | 1624 GETCUSTOM8 d'22' |
1612 movwf divisor_deco | 1625 movwf divisor_deco |
1613 GETCUSTOM8 d'23' | 1626 GETCUSTOM8 d'23' |
1614 movwf divisor_tank | 1627 movwf divisor_tank |
1615 GETCUSTOM8 d'24' | 1628 GETCUSTOM8 d'24' |