# HG changeset patch # User heinrichsweikamp # Date 1310916205 -7200 # Node ID d022c62a1df58658f75cbd5f8364f67e69137293 # Parent dd4a1aa96232b653f28dd8d85eb50109f6e295a9 fixing issue with end-of-dive threshold in high-altitude mode simulator now works up to 120m depth fix internal logbook hung up on bad profile data diff -r dd4a1aa96232 -r d022c62a1df5 code_part1/OSTC_code_asm_part1/changelog.txt --- a/code_part1/OSTC_code_asm_part1/changelog.txt Sat Jul 16 13:25:23 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Sun Jul 17 17:23:25 2011 +0200 @@ -1,7 +1,8 @@ New in 1.94 beta: BETA Version - Do NOT use for diving! BUGFIX: CNS was not cleared with a "Reset Deco" - +CHANGE: Max. depth for simulator now 120m +BUGFIX: Ascend threshold in high altitude mode New in 1.93 beta: BETA Version - Do NOT use for diving! diff -r dd4a1aa96232 -r d022c62a1df5 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Sat Jul 16 13:25:23 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Sun Jul 17 17:23:25 2011 +0200 @@ -43,6 +43,12 @@ #DEFINE FT_MEDIUM .1 #DEFINE FT_LARGE .2 +; "Better Gas" behavior +; better_gas_window <= minimum_change_depth ! +; minimum_change_depth >=5 ! +#DEFINE minimum_change_depth .3 ; [m] +#DEFINE better_gas_window .3 ; [m] + ; Color Definitions: 8Bit RGB b'RRRGGGBB' #DEFINE color_red d'224' #DEFINE color_violet d'235' @@ -85,8 +91,8 @@ ;============================================================================= -#include "../OSTC_code_c_part2/shared_definitions.h" -;#include "shared_definitions.h" +;#include "../OSTC_code_c_part2/shared_definitions.h" +#include "shared_definitions.h" ;============================================================================= ; Reserve space for C-code data space. Eg.when calling log. diff -r dd4a1aa96232 -r d022c62a1df5 code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Sat Jul 16 13:25:23 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Sun Jul 17 17:23:25 2011 +0200 @@ -985,15 +985,15 @@ bra check_gas_change2 ; Yes, skip depth check check_gas_change1x: read_int_eeprom d'28' ; read gas_change_depth - movlw d'3' - cpfsgt EEDATA ; Change depth>3m? + movlw minimum_change_depth + cpfsgt EEDATA ; Change depth>minimum_change_depth? bra check_gas_change2 ; No, Change depth not deep enough, skip! movf xC+0,W ; load depth in m into WREG cpfsgt EEDATA ; gas_change_depth < current depth? bra check_gas_change2 ; No, check next gas - movlw d'3' - subwf EEDATA,W ; Change depth-3m - cpfslt xC+0 ; current depth3m? + movlw minimum_change_depth + cpfsgt EEDATA ; Change depth>minimum_change_depth? bra check_gas_change3 ; No, Change depth not deep enough, skip! movf xC+0,W ; load depth in m into WREG cpfsgt EEDATA ; gas_change_depth < current depth? bra check_gas_change3 ; No, check next gas - movlw d'3' - subwf EEDATA,W ; Change depth-3m - cpfslt xC+0 ; current depth3m? + movlw minimum_change_depth + cpfsgt EEDATA ; Change depth>minimum_change_depth? bra check_gas_change4 ; No, Change depth not deep enough, skip! movf xC+0,W ; load depth in m into WREG cpfsgt EEDATA ; gas_change_depth < current depth? bra check_gas_change4 ; No, check next gas - movlw d'3' - subwf EEDATA,W ; Change depth-3m - cpfslt xC+0 ; current depth3m? + movlw minimum_change_depth + cpfsgt EEDATA ; Change depth>minimum_change_depth? bra check_gas_change5 ; No, Change depth not deep enough, skip! movf xC+0,W ; load depth in m into WREG cpfsgt EEDATA ; gas_change_depth < current depth? bra check_gas_change5 ; No, check next gas - movlw d'3' - subwf EEDATA,W ; Change depth-3m - cpfslt xC+0 ; current depth3m? + movlw minimum_change_depth + cpfsgt EEDATA ; Change depth>minimum_change_depth? bra check_gas_change6 ; No, Change depth not deep enough, skip! movf xC+0,W ; load depth in m into WREG cpfsgt EEDATA ; gas_change_depth < current depth? bra check_gas_change6 ; No, check next gas - movlw d'3' - subwf EEDATA,W ; Change depth-3m - cpfslt xC+0 ; current depth this is a real dive -> Use CF00 threshold for ascend + + movlw HIGH d'300' ; hard-wired 300cm threshold movwf sub_a+1 - movlw LOW d'1075' ; hard-wired 1075mbar threshold + movlw LOW d'300' ; hard-wired 300cm threshold movwf sub_a+0 - SAFE_2BYTE_COPY rel_pressure, sub_b - call sub16 ; sub_c = sub_a - sub_b - - btfss neg_flag - bra set_dive_modes2 ; too shallow (rel_pressure1 to make "display_profile2e" working + +display_profile_offset4: bsf leftbind output_16dp d'3' ; max. depth STRCAT "m " diff -r dd4a1aa96232 -r d022c62a1df5 code_part1/OSTC_code_asm_part1/simulator.asm --- a/code_part1/OSTC_code_asm_part1/simulator.asm Sat Jul 16 13:25:23 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/simulator.asm Sun Jul 17 17:23:25 2011 +0200 @@ -120,7 +120,7 @@ simulator_inc_maxdepth: movlw d'3' addwf logbook_temp2,F ; Here: Maxdepth in m - movlw d'99' + movlw d'120' cpfslt logbook_temp2 movwf logbook_temp2 movlw d'4'