# HG changeset patch # User heinrichsweikamp # Date 1300710698 -3600 # Node ID 3ed240d60341e4de539f25594307e62862164137 # Parent 9581e48a914f82911e8822aeac70f3f99217c06c High altitude (Plane/Fly) mode added diff -r 9581e48a914f -r 3ed240d60341 code_part1/OSTC_code_asm_part1/changelog.txt --- a/code_part1/OSTC_code_asm_part1/changelog.txt Sun Mar 20 17:55:21 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Mon Mar 21 13:31:38 2011 +0100 @@ -1,6 +1,7 @@ New in 1.84 beta: BETA Version - Do NOT use for diving! BUGFIX: NoFly time should not be reseted after dive simulation. +NEW: High altitude (Plane/Fly) mode added New in 1.83 beta: BETA Version - Do NOT use for diving! diff -r 9581e48a914f -r 3ed240d60341 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Sun Mar 20 17:55:21 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Mon Mar 21 13:31:38 2011 +0100 @@ -34,7 +34,7 @@ ;#DEFINE GERMAN ; Use german_text.asm ;#DEFINE SPANISH ; Use spanish_text.asm -#DEFINE __DEBUG ; +;#DEFINE __DEBUG ; #DEFINE logbook_profile_version 0x20 ; Do not touch! #DEFINE T0CON_debounce b'00000000' ; Timer0 Switch Debounce @@ -452,7 +452,7 @@ #DEFINE FLAG_active_descent flag8,3 ;=1: A Descent in Apnoe mode is active #DEFINE display_see_deco flag8,4 ;=1: Display decoplan in Divemode #DEFINE display_set_gas flag8,5 ;=1: Display Gaslist menu in Divemode -;free flag8,6 ;=1: +#DEFINE high_altitude_mode flag8,6 ;=1: Unit was manually turned on with ambient pressure <880mBar #DEFINE rs232_recieve_overflow flag8,7 ;=1: An RS232 timeout overflow occoured #DEFINE nofly_active flag9,0 ;=1: Do not fly! diff -r 9581e48a914f -r 3ed240d60341 code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Sun Mar 20 17:55:21 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Mon Mar 21 13:31:38 2011 +0100 @@ -1409,24 +1409,25 @@ return set_dive_modes: + btfsc high_altitude_mode ; In high altitude (Fly) mode? + bra set_dive_modes3 ; Yes + bcf divemode2 ; Stop time GETCUSTOM8 .0 ; loads dive_threshold in WREG movwf sub_a+0 ; dive_treshold is in cm clrf sub_a+1 - movff rel_pressure+0,sub_b+0 movff rel_pressure+1,sub_b+1 - - call sub16 ; sub_c = sub_a - sub_b + call sub16 ; sub_c = sub_a - sub_b btfss neg_flag - bra set_dive_modes2 ; too shallow (rel_pressure this was no real dive return +set_dive_modes3: + movlw HIGH d'1075' ; hard-wired 1075mBar threshold + movwf sub_a+1 + movlw LOW d'1075' ; hard-wired 1075mBar threshold + movwf sub_a+0 + movff rel_pressure+0,sub_b+0 + movff rel_pressure+1,sub_b+1 + call sub16 ; sub_c = sub_a - sub_b + + btfss neg_flag + bra set_dive_modes2 ; too shallow (rel_pressure880mBar)? + bsf high_altitude_mode ; No, Set Flag! ; Should we disable sleep (hardware emulator) movlw .0