# HG changeset patch # User JeanDo # Date 1318463999 -7200 # Node ID 9fc8feff27a50a2df688dd59608e7ac05fdf3552 # Parent fd8266b511cc6b83223220ca9538ee78efd870b9 Enable reset in cave bailout prediction, by using chrono average depth. diff -r fd8266b511cc -r 9fc8feff27a5 code_part1/OSTC_code_asm_part1/customview.asm --- a/code_part1/OSTC_code_asm_part1/customview.asm Wed Oct 12 19:02:38 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/customview.asm Thu Oct 13 01:59:59 2011 +0200 @@ -27,33 +27,43 @@ ;============================================================================= ; Show the customview-dependent entry for the divemode menu ; -customview_menu_entry3: -; bcf menu3_active ;=1: menu entry three in divemode menu is active - +customview_menu_entry3: movff menupos3,WREG ; copy dcfsnz WREG,F bra customview_menu3_stopwatch ; Show the stopwatch option in divemode menu dcfsnz WREG,F bra customview_menu3_marker ; Show the marker option in divemode menu dcfsnz WREG,F - bra customview_menu3_clock ; Show the clock option in divemode menu + bra customview_menu3_clock ; Show nothing + dcfsnz WREG,F + bra customview_menu3_lead_tiss ; Show nothing + dcfsnz WREG,F + bra customview_menu3_average ; Show nothing dcfsnz WREG,F - bra customview_menu3_lead_tiss ; Show the leading tissue option in divemode menu - ; Menupos3=0, do nothing + bra customview_menu3_graphs ; Show nothing + dcfsnz WREG,F + bra customview_menu3_ead_end ; Show nothing + dcfsnz WREG,F + bra customview_menu3_@5 ; Show nothing + dcfsnz WREG,F + bra customview_menu3_cave_bailout; Show reset option return +customview_menu3_cave_bailout: customview_menu3_stopwatch: -; bsf menu3_active ; Set Flag DISPLAYTEXT .33 ; ResetAvr return customview_menu3_marker: -; bsf menu3_active ; Set Flag DISPLAYTEXT .30 ; Set Marker return customview_menu3_clock: ; No menu entry -customview_menu3_lead_tiss ; No menu entry +customview_menu3_lead_tiss: +customview_menu3_average: +customview_menu3_graphs: +customview_menu3_ead_end: +customview_menu3_@5: return ;============================================================================= @@ -120,6 +130,7 @@ goto PLED_show_@5 customview_1sec_cave_bailout: + bsf menu3_active ; Set Flag goto PLED_show_cave_bailout ;============================================================================= @@ -168,7 +179,7 @@ ; Show next customview (and delete this flag) customview_toggle: - bcf menu3_active ;=1: menu entry three in divemode menu is active + bcf menu3_active ;=1: menu entry three in divemode menu is active ostc_debug 'X' ; Sends debug-information to screen if debugmode active btfsc FLAG_apnoe_mode ; In Apnoe mode? @@ -238,7 +249,7 @@ call PLED_standard_color DISPLAYTEXT d'151' ; Set Marker? - bsf menu3_active ; Set Flag + bsf menu3_active ; Set Flag bra customview_toggle_exit customview_init_clock: ; Init Clock @@ -288,6 +299,7 @@ iorwf hi,W bz customview_toggle ; No: jump to next Customview ! + bsf menu3_active ; Set Flag call PLED_show_cave_bailout bra customview_toggle_exit diff -r fd8266b511cc -r 9fc8feff27a5 code_part1/OSTC_code_asm_part1/divemode_menu.asm --- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm Wed Oct 12 19:02:38 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm Thu Oct 13 01:59:59 2011 +0200 @@ -194,15 +194,24 @@ bra timeout_divemenu2 ; Quit divemode menu divemode_menu3: - movff menupos3,temp1 ; copy - dcfsnz temp1,F + dcfsnz menupos3,W ; copy bra toggle_stopwatch ; Toggle Stopwatch/Average register - dcfsnz temp1,F + dcfsnz WREG,F bra set_marker ; Set Marker - dcfsnz temp1,F + dcfsnz WREG,F bra divemode_menu3_nothing ; clock... - dcfsnz temp1,F + dcfsnz WREG,F bra divemode_menu3_nothing ; leading tissue... + dcfsnz WREG,F + bra divemode_menu3_nothing ; Average depth (not resetable) + dcfsnz WREG,F + bra divemode_menu3_nothing ; Graphs... + dcfsnz WREG,F + bra divemode_menu3_nothing ; END/EAD in divemode + dcfsnz WREG,F + bra divemode_menu3_nothing ; Futur TTS... + dcfsnz WREG,F + bra toggle_stopwatch ; Cave bailout prediction. divemode_menu3_nothing: bra timeout_divemenu2 ; Quit divemode menu diff -r fd8266b511cc -r 9fc8feff27a5 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Wed Oct 12 19:02:38 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Thu Oct 13 01:59:59 2011 +0200 @@ -3370,19 +3370,9 @@ call PLED_standard_color lfsr FSR2,letter - ;---- Compute divetime in seconds - movff divemins+0,xA+0 - movff divemins+1,xA+1 - movlw d'60' - movwf xB+0 - clrf xB+1 - call mult16x16 ; xC:4=xA:2*xB:2 - movf divesecs,W - addwf xC+0,W - movwf xA+0 - movlw d'0' - addwfc xC+1,W - movwf xA+1 ; xA:2 holds total dive seconds + ;---- Retrieve divetime in seconds (since last reset) + movff average_divesecs+0,xA+0 + movff average_divesecs+1,xA+1 ;---- Multiply by SAC, and divide by 60 (SAC inliters per minutes) GETCUSTOM8 d'56' ; Get bottom SAC @@ -3400,10 +3390,10 @@ movff xC+0,xA+0 ; Get result (in xC+0, noy xC+2 !) into xA movff xC+1,xA+1 - movf avr_rel_pressure_total+0,W ; Add surface pressure to get absolute pressure + movf avr_rel_pressure+0,W ; Add surface pressure to get absolute pressure addwf last_surfpressure_30min+0,W movwf xB+0 - movf avr_rel_pressure_total+1,W + movf avr_rel_pressure+1,W addwfc last_surfpressure_30min+1,W movwf xB+1 ; --> Into xB