# HG changeset patch # User heinrichsweikamp # Date 1340534734 -7200 # Node ID f3735da188095abae0585b668a3e690c0955b68d # Parent 8172a7ce6db1a1d59a36423c01c9a25b0a807472 NEW: CF65: Show a safety stop for no-deco dives Texts 194 and 227 need translation diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/changelog.txt --- a/code_part1/OSTC_code_asm_part1/changelog.txt Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Sun Jun 24 12:45:34 2012 +0200 @@ -1,3 +1,7 @@ +New in 2.25: +BETA Version - Do NOT use for diving! +NEW: CF65: Show a safety stop for no-deco dives + New in 2.24: BETA Version - Do NOT use for diving! BUGFIX: CNS for pSCR-GF diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Sun Jun 24 12:45:34 2012 +0200 @@ -26,7 +26,7 @@ #DEFINE softwareversion_beta 1 ; (and 0 for release) -#DEFINE max_custom_number d'64' ; Number of last used custom function +#DEFINE max_custom_number d'65' ; Number of last used custom function ; International extension. Selecting messages source: #DEFINE ENGLISH ; Use english_text.asm @@ -63,6 +63,12 @@ #DEFINE FT_MEDIUM .1 #DEFINE FT_LARGE .2 +; Safety stop parameters +#DEFINE safety_stop_length .180 ; [s] +#DEFINE safety_stop_start .500 ; [mbar] +#DEFINE safety_stop_end .300 ; [mbar] +#DEFINE safety_stop_reset .1000 ; [mbar] + ; "Better Gas" behavior ; better_gas_window <= minimum_change_depth ! ; minimum_change_depth >=5 ! @@ -350,6 +356,8 @@ desaturation_time_buffer res 2 ; buffer for desat time total_divetime_seconds res 2 ; counts dive seconds regardless of CF01 (18h max.) +safety_stop_countdown res 1 ; counts seconds of safety stop + ASSERT_BANK1 MACRO tag Ifdef __DEBUG local @end @@ -434,7 +442,7 @@ #DEFINE oneminupdate flag2,2 ;=1 after any minute #DEFINE realdive flag2,3 ; dive was longer then one minute? #DEFINE sleepmode flag2,4 ;=1 if in sleepmode -#DEFINE same_row flag2,5 ;=1 if pixel pair is in same row (display_profile) +#DEFINE safety_stop_active flag2,5 ;=1 The safety stop is currently displayed #DEFINE premenu flag2,6 ; Premenu/Divemenu selected #DEFINE menubit flag2,7 ; menu @@ -497,9 +505,9 @@ #DEFINE nofly_active flag9,0 ;=1: Do not fly! #DEFINE ppO2_display_active flag9,1 ;=1: ppO2 value is displayed #DEFINE ppO2_show_value flag9,2 ;=1: show ppO2 value! -#DEFINE uart_reset_battery_stats flag9,3 ;=1: Reset the battery statistics (UART String FFF) +#DEFINE uart_reset_battery_stats flag9,3;=1: Reset the battery statistics (UART String FFF) #DEFINE ignore_digit3 flag9,4 ;=1: ignores digits 3-5 in valconv -#DEFINE ppO2_warn_value flag9,5 ;=1: warn about ppO2! +#DEFINE show_safety_stop flag9,5 ;=1: Show the safety stop #DEFINE output_to_postinc_only flag9,6 ;=1: Do not call wordprocessor in output #DEFINE uart_send_hash flag9,7 ;=1: Send the MD2 hash via UART diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Sun Jun 24 12:45:34 2012 +0200 @@ -67,6 +67,8 @@ ; Tasks only for OC modes call check_ppO2 ; check ppO2 and displays warning if required call calc_deko_divemode ; calculate decompression and display result (any two seconds) + btfsc show_safety_stop ; Show the safety stop? + call PLED_show_safety_stop ; Yes, show/delete if done. bra diveloop_loop1x ; Common Tasks ; Tasks only for Gauge mode @@ -97,6 +99,8 @@ diveloop_loop1c: call PLED_const_ppO2_value ; display const ppO2 setting in [bar] call calc_deko_divemode ; calculate decompression and display result (any two seconds) + btfsc show_safety_stop ; Show the safety stop? + call PLED_show_safety_stop ; Yes, show/delete if done. btfsc is_bailout ; Are we in Bailout mode? call check_ppO2_bail ; Yes, display ppO2 (If required) @@ -218,7 +222,7 @@ divemode_apnoe_tasks2: btfss FLAG_active_descent ; Are descending? return ; No, We are at the surface - rcall apnoe_calc_maxdepth ; Yes! + call apnoe_calc_maxdepth ; Yes! divemode_apnoe_tasks3: call PLED_apnoe_clear_surface ; Clear Surface timer @@ -273,6 +277,7 @@ ; Routines used in the "other second" call calc_average_depth ; calculate average depth call calc_velocity ; calculate vertical velocity and display if > threshold (every two seconds) + call set_reset_safety_stop ; Set flags for safety stop and/or reset safety stop ; Calculate CNS clrf WREG @@ -374,6 +379,75 @@ movff EEDATA,char_I_deco_gas_change+4 ; Yes! return +set_reset_safety_stop: ; Set flags for safety stop and/or reset safety stop + GETCUSTOM8 d'65' ; Use safety stop + decfsz WREG,F ; WREG=1? + bra delete_safety_stop ; No, don't show safety stop + + btfsc dekostop_active ; Is a deco stop displayed? + bra delete_safety_stop ; Yes, don't show safety stop + ; Below "safety_stop_reset"? Set flag and reset count-down timer + SAFE_2BYTE_COPY rel_pressure, lo + call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] + movff lo,sub_a+0 + movff hi,sub_a+1 + movlw LOW safety_stop_reset + movwf sub_b+0 + movlw HIGH safety_stop_reset + movwf sub_b+1 + call sub16 ; sub_c = sub_a - sub_b + btfss neg_flag + bra reset_safety_stop ; Below 10m, reset safety stop + + ; Above "safety_stop_end"? Clear flag. + SAFE_2BYTE_COPY rel_pressure, lo + call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] + movff lo,sub_a+0 + movff hi,sub_a+1 + movlw LOW safety_stop_end + movwf sub_b+0 + movlw HIGH safety_stop_end + movwf sub_b+1 + call sub16 ; sub_c = sub_a - sub_b + btfsc neg_flag + bra delete_safety_stop ; Above 3m, remove safety stop + + ; Above "safety_stop_start"? Activate safety stop + SAFE_2BYTE_COPY rel_pressure, lo + call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar] + movff lo,sub_a+0 + movff hi,sub_a+1 + movlw LOW safety_stop_start + movwf sub_b+0 + movlw HIGH safety_stop_start + movwf sub_b+1 + call sub16 ; sub_c = sub_a - sub_b + btfsc neg_flag + bra acivate_safety_stop ; Above 5m, activate safety stop + + bra reset_safety_stop2 ; Pause safety stop + +acivate_safety_stop: + tstfsz safety_stop_countdown ; Countdown at zero? + bsf show_safety_stop ; No, Set flag! + return + +delete_safety_stop: + bcf show_safety_stop ; Clear flag + clrf safety_stop_countdown ; reset timer + return ; Done. + +reset_safety_stop: + movlw safety_stop_length ;[s] + movwf safety_stop_countdown ; reset timer +reset_safety_stop2: + btfss safety_stop_active ; Safety stop shown + return ; No, don't delete it + bcf show_safety_stop ; Clear flag + bcf safety_stop_active ; Clear flag + call PLED_clear_decoarea ; Yes, Clear stop + goto PLED_display_ndl_mask ; Show NDL again (And return) + ;----------------------------------------------------------------------------- ; calculate ppO2 in 0.01bar (e.g. 150 = 1.50 bar ppO2) set_actual_ppo2: @@ -916,7 +990,6 @@ bsf ppO2_show_value ; set flag if required ;check if we are within our warning thresholds! - bcf ppO2_warn_value ; clear flag movff xC+0,sub_b+0 movff xC+1,sub_b+1 GETCUSTOM8 d'18' ; ppo2_warning_high @@ -929,7 +1002,6 @@ check_ppO2_bail2: bsf ppO2_show_value ; set flag if required - bsf ppO2_warn_value ; set flag movlw d'5' ; Type of Alarm movwf AlarmType ; Copy to Alarm Register bsf event_occured ; Set Event Flag @@ -945,7 +1017,6 @@ btfsc neg_flag bra check_ppO2_1 ; Not too low - bsf ppO2_warn_value ; set flag bsf ppO2_show_value ; show ppO2 if below threshold! movlw d'4' ; Type of Alarm movwf AlarmType ; Copy to Alarm Register @@ -1148,7 +1219,7 @@ ; Dive finished (and longer then one minute or Apnoe timeout occured) btfsc FLAG_apnoe_mode ; Calc max. depth (again) for very short apnoe dives - rcall apnoe_calc_maxdepth + call apnoe_calc_maxdepth ; calculate desaturation time movff last_surfpressure_30min+0,int_I_pres_surface+0 ; Pass surface to desat routine ! @@ -1810,6 +1881,8 @@ bcf is_bailout ;=1: CC mode, but bailout active! bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode bcf tts_extra_time ;=1: Compute TTS if extra time spent at current depth + bcf show_safety_stop ;=1: Show the safety stop + clrf safety_stop_countdown ; Clear count-down call get_free_EEPROM_location ; get last position in external EEPROM, may be up to 2 secs! diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/divemode_menu.asm --- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm Sun Jun 24 12:45:34 2012 +0200 @@ -722,6 +722,9 @@ btfss dekostop_active call PLED_display_ndl ; Update NDL display at once + btfsc safety_stop_active + bcf safety_stop_active ; Clear flag to rebuild the safety stop + timeout_divemenu2a: bcf menubit bcf premenu ; Yes, clear flags and menu, display dive time and mask again diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/english_text.asm --- a/code_part1/OSTC_code_asm_part1/english_text.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/english_text.asm Sun Jun 24 12:45:34 2012 +0200 @@ -328,7 +328,7 @@ ; 32 custom function descriptors III (FIXED LENGTH = 15 chars). TCODE .40, .35, "Color# inactive" ;193 Color# inactive - TCODE .40, .35, "unused " ;194 unused + TCODE .40, .35, "Use safety stop" ;194 Use safety stop TCODE .40, .35, "unused " ;195 unused TCODE .40, .35, "unused " ;196 unused TCODE .40, .35, "unused " ;197 unused @@ -362,7 +362,7 @@ ; TCODE .7, .2, "Custom Functions III" ;225 Custom Functions III TCODE .85, .125, "pSCR-GF " ;226 pSCR-GF - TCODE .0, .0, "" ;227 unused + TCODE .90, .54, "SafetyStop" ;227 SafetyStop TCODE .0, .0, "" ;228 unused TCODE .0, .0, "" ;229 unused TCODE .0, .0, "" ;230 unused diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/french_text.asm --- a/code_part1/OSTC_code_asm_part1/french_text.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/french_text.asm Sun Jun 24 12:45:34 2012 +0200 @@ -330,7 +330,7 @@ ; 32 custom function descriptors III (FIXED LENGTH = 15 chars). TCODE .40, .35, "Color# inactive" ;193 Color# inactive - TCODE .40, .35, "unused " ;194 unused + TCODE .40, .35, "Use safety stop" ;194 Use safety stop TCODE .40, .35, "unused " ;195 unused TCODE .40, .35, "unused " ;196 unused TCODE .40, .35, "unused " ;197 unused @@ -364,7 +364,7 @@ ; TCODE .7, .2, "Config Fonctions III" ;225 Custom Functions III TCODE .85, .125, "pSCR-GF " ;226 pSCR-GF - TCODE .0, .0, "" ;227 unused + TCODE .90, .54, "SafetyStop" ;227 SafetyStop TCODE .0, .0, "" ;228 unused TCODE .0, .0, "" ;229 unused TCODE .0, .0, "" ;230 unused diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/german_text.asm --- a/code_part1/OSTC_code_asm_part1/german_text.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/german_text.asm Sun Jun 24 12:45:34 2012 +0200 @@ -329,7 +329,7 @@ ; 32 custom function descriptors III (FIXED LENGTH = 15 chars). TCODE .40, .35, "Farbe# inaktiv " ;193 Color# inactive - TCODE .40, .35, "unbenutzt " ;194 unused + TCODE .40, .35, "Sicherheitsstop" ;194 Use safety stop TCODE .40, .35, "unbenutzt " ;195 unused TCODE .40, .35, "unbenutzt " ;196 unused TCODE .40, .35, "unbenutzt " ;197 unused @@ -363,7 +363,7 @@ ; TCODE .7, .2, "Custom Funktionen III" ;225 Custom Functions III TCODE .85, .125, "pSCR-GF " ;226 pSCR-GF - TCODE .0, .0, "" ;227 unused + TCODE .90, .54, "Sicherheit" ;227 SafetyStop TCODE .0, .0, "" ;228 unused TCODE .0, .0, "" ;229 unused TCODE .0, .0, "" ;230 unused diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/menu_reset.asm --- a/code_part1/OSTC_code_asm_part1/menu_reset.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm Sun Jun 24 12:45:34 2012 +0200 @@ -190,7 +190,7 @@ CF_DEFAULT CF_INT8, .10, .0, .100 ; CF63 pSCR counterlung ratio cf_default_table2: CF_DEFAULT CF_COLOR, d'74', 0, 0 ; CF64 color_inactive Color inactive: grey - CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF65 unused + CF_DEFAULT CF_BOOL, 0, 0, 0 ; CF65 Show safety stop CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF66 unused CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF67 unused CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF68 unused diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Sun Jun 24 12:45:34 2012 +0200 @@ -412,7 +412,6 @@ ; Clear Dekostop and Dekosum rcall PLED_clear_decoarea - call PLED_divemask_color ; Set Color for Divemode mask DISPLAYTEXT d'84' ; NoStop call PLED_standard_color @@ -451,6 +450,7 @@ rcall PLED_clear_decoarea ; total deco time word + bcf show_safety_stop ; Clear safety stop flag call PLED_divemask_color ; Set Color for Divemode mask DISPLAYTEXT d'85' ; TTS DISPLAYTEXT d'82' ; DEKOSTOP @@ -515,6 +515,54 @@ call PLED_standard_color return +PLED_show_safety_stop: + tstfsz safety_stop_countdown ; Countdown at zero? + bra PLED_show_safety_stop2 ; No, show stop + + bcf show_safety_stop ; Clear flag + + btfsc safety_stop_active ; Displayed? + rcall PLED_clear_decoarea ; Yes, Clear stop + bcf safety_stop_active ; Clear flag + bra PLED_display_ndl_mask ; Show NDL again + +PLED_show_safety_stop2: + btfsc safety_stop_active ; Displayed? + bra PLED_show_safety_stop3 ; Yes. + + bsf safety_stop_active ; Set flag + + btfsc menubit ; Divemode menu active? + bra PLED_show_safety_stop3 ; Yes, do not display now but countdown + + call PLED_divemask_color ; Set Color for Divemode mask + DISPLAYTEXT d'227' ; Safety stop + +PLED_show_safety_stop3: + decf safety_stop_countdown,F ; Reduce countdown + btfsc menubit ; Divemode menu active? + return ; Yes, do not show + movff safety_stop_countdown,lo + call PLED_standard_color + WIN_TOP .80 + WIN_LEFT .104 + WIN_FONT FT_MEDIUM + WIN_INVERT .0 ; Init new Wordprocessor + lfsr FSR2,letter + clrf hi + call convert_time ; converts hi:lo in seconds to mins (hi) and seconds (lo) + movf hi,W + movff lo,hi + movwf lo ; exchange lo and hi + output_99 + PUTC ':' + movff hi,lo + output_99x + STRCAT_PRINT "" + WIN_FONT FT_SMALL + call PLED_standard_color + return + ;============================================================================= ; Update simulator menu with time/depth ; Note: because translations might change a bit the string length, we reprint diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/russian_text.asm --- a/code_part1/OSTC_code_asm_part1/russian_text.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/russian_text.asm Sun Jun 24 12:45:34 2012 +0200 @@ -332,7 +332,7 @@ ; 32 custom function descriptors III (FIXED LENGTH = 15 chars). TCODE .40, .35, "Color# inactive" ;193 Color# inactive - TCODE .40, .35, "unused " ;194 unused + TCODE .40, .35, "Use safety stop" ;194 Use safety stop TCODE .40, .35, "unused " ;195 unused TCODE .40, .35, "unused " ;196 unused TCODE .40, .35, "unused " ;197 unused @@ -366,7 +366,7 @@ ; TCODE .12, .2, "Доп. Параметры III" ;225 Custom Functions III TCODE .85, .125, "pSCR-GF " ;226 pSCR-GF - TCODE .0, .0, "" ;227 unused + TCODE .90, .54, "SafetyStop" ;227 SafetyStop TCODE .0, .0, "" ;228 unused TCODE .0, .0, "" ;229 unused TCODE .0, .0, "" ;230 unused diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/spanish_text.asm --- a/code_part1/OSTC_code_asm_part1/spanish_text.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/spanish_text.asm Sun Jun 24 12:45:34 2012 +0200 @@ -328,7 +328,7 @@ ; 32 custom function descriptors III (FIXED LENGTH = 15 chars). TCODE .40, .35, "Color# inactive" ;193 Color# inactive - TCODE .40, .35, "unused " ;194 unused + TCODE .40, .35, "Use safety stop" ;194 Use safety stop TCODE .40, .35, "unused " ;195 unused TCODE .40, .35, "unused " ;196 unused TCODE .40, .35, "unused " ;197 unused @@ -362,7 +362,7 @@ ; TCODE .7, .2, "Func.Personaliz. III" ;225 Custom Functions III TCODE .85, .125, "pSCR-GF " ;226 pSCR-GF - TCODE .0, .0, "" ;227 unused + TCODE .90, .54, "SafetyStop" ;227 SafetyStop TCODE .0, .0, "" ;228 unused TCODE .0, .0, "" ;229 unused TCODE .0, .0, "" ;230 unused diff -r 8172a7ce6db1 -r f3735da18809 code_part1/OSTC_code_asm_part1/turkish_text.asm --- a/code_part1/OSTC_code_asm_part1/turkish_text.asm Thu Jun 21 08:32:29 2012 +0200 +++ b/code_part1/OSTC_code_asm_part1/turkish_text.asm Sun Jun 24 12:45:34 2012 +0200 @@ -331,7 +331,7 @@ ; 32 custom function descriptors III (FIXED LENGTH = 15 chars). TCODE .40, .35, "Color# inactive" ;193 Color# inactive - TCODE .40, .35, "unused " ;194 unused + TCODE .40, .35, "Use safety stop" ;194 Use safety stop TCODE .40, .35, "unused " ;195 unused TCODE .40, .35, "unused " ;196 unused TCODE .40, .35, "unused " ;197 unused @@ -365,7 +365,7 @@ ; TCODE .7, .2, "Ozel Fonksiyonlar III" ;225 Custom Functions III TCODE .85, .125, "pSCR-GF " ;226 pSCR-GF - TCODE .0, .0, "" ;227 unused + TCODE .90, .54, "SafetyStop" ;227 SafetyStop TCODE .0, .0, "" ;228 unused TCODE .0, .0, "" ;229 unused TCODE .0, .0, "" ;230 unused