changeset 335:d36fe3651d56 ScreenDump

Updated to 1.91beta Added screen dumps in cf menu, and in GasList (second page). --> Need a centralized subroutine when waitting switches...
author JeanDo
date Fri, 13 May 2011 02:09:06 +0200
parents 1828234369fc (current diff) 4ccdc72ec0e5 (diff)
children 9ee86a19f1fa
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/divemode_menu.asm code_part1/OSTC_code_asm_part1/menu_custom.asm code_part1/OSTC_code_asm_part1/menu_gassetup.asm code_part1/OSTC_code_asm_part1/simulator.asm
diffstat 8 files changed, 43 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Wed May 11 01:37:29 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Fri May 13 02:09:06 2011 +0200
@@ -22,9 +22,9 @@
 ; ToDo:
 
 #DEFINE	softwareversion_x		d'1'		; Software version  XX.YY
-#DEFINE	softwareversion_y		d'90'		; Software version  XX.YY
+#DEFINE	softwareversion_y		d'91'		; Software version  XX.YY
 
-#DEFINE softwareversion_beta 	0 			; (and 0 for release) 
+#DEFINE softwareversion_beta 	1 			; (and 0 for release) 
 
 #DEFINE	max_custom_number		d'58'		; Number of last used custom function
 
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Wed May 11 01:37:29 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Fri May 13 02:09:06 2011 +0200
@@ -157,15 +157,21 @@
 	btfsc	toggle_customview				; Next view?
 	call	customview_toggle				; Yes, show next customview (and delete this flag)
 
-	btfsc	menubit							; Sleep only with inactive menu...
-	bra		diveloop_loop4
+	btfsc	simulatormode_active			; Is Simualtor mode active ?
+	bra		diveloop_loop4                  ; YES: don't sleep
 
-	btfsc	simulatormode_active			; Do not sleep in Simualtor mode
-	bra		diveloop_loop4
+	btfsc	menubit							; Sleep only with inactive menu...
+	bra		diveloop_loop5
 
 	sleep
 	nop
-diveloop_loop4:
+	bra		diveloop_loop					; Loop the divemode
+
+diveloop_loop4:                             ; And test screen dumps too!
+	btfsc	uart_dump_screen                ; Asked to dump screen contains ?
+	call	dump_screen     			    ; Yes!
+
+diveloop_loop5:
 	bra		diveloop_loop					; Loop the divemode
 
 timeout_premenu_divemode:
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Wed May 11 01:37:29 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Fri May 13 02:09:06 2011 +0200
@@ -108,6 +108,9 @@
 	btfss	switch_right
 	return
 
+	btfsc	uart_dump_screen                ; Asked to dump screen contains ?
+	call	dump_screen     			    ; Yes!
+
 	btfsc 	display_see_deco			; Is the Decoplan displayed?
 	bra		divemenu_see_decoplan2		; Yes, exit menu on left button press
 
--- a/code_part1/OSTC_code_asm_part1/menu_custom.asm	Wed May 11 01:37:29 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_custom.asm	Fri May 13 02:09:06 2011 +0200
@@ -299,6 +299,9 @@
 
 	bcf		onesecupdate			; end of 1sek. tasks
 
+	btfsc	uart_dump_screen            ; Dumps screen contains ?
+	call	dump_screen     			; Yes!
+
 	btfsc	sleepmode
 	bra	exit_customfunctions
 
--- a/code_part1/OSTC_code_asm_part1/menu_gassetup.asm	Wed May 11 01:37:29 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_gassetup.asm	Fri May 13 02:09:06 2011 +0200
@@ -780,6 +780,9 @@
 
 	bcf		onesecupdate	; 1 sec. functions done
 
+	btfsc	uart_dump_screen            ; Dumps screen contains ?
+	call	dump_screen     			; Yes!
+
 	btfsc	sleepmode
 	bra		exit_gassetup
 
--- a/code_part1/OSTC_code_asm_part1/simulator.asm	Wed May 11 01:37:29 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/simulator.asm	Fri May 13 02:09:06 2011 +0200
@@ -412,18 +412,18 @@
 	WAITMS	d'250'
 	WAITMS	d'250'                      ; Wait for Pressure Sensor to get real pressure again...
 
-	movlw	d'5'                            ; Pre-Set Cursor to "Show Decoplan"
+	movlw	d'5'                        ; Pre-Set Cursor to "Show Decoplan"
 	movwf	menupos
 	movff	char_I_bottom_time,logbook_temp1    ; Restore bottom time,
 	movff   char_I_bottom_depth,logbook_temp2   ; and depth.
 	bra     menu_simulator1                 ; Done.
 
 simulator_save_tissue_data:
-	bsf		restore_deco_data		; Set restore flag
-	ostc_debug	'S'							; Sends debug-information to screen if debugmode active
+	bsf		restore_deco_data           ; Set restore flag
+	ostc_debug	'S'                     ; Sends debug-information to screen if debugmode active
 	call	deco_push_tissues_to_vault
-	movlb	0x01							; Back to RAM Bank1
-	ostc_debug	'T'							; Sends debug-information to screen if debugmode active
+	movlb	0x01                        ; Back to RAM Bank1
+	ostc_debug	'T'                     ; Sends debug-information to screen if debugmode active
 	return
 
 simulator_restore_tissue_data:
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Wed May 11 01:37:29 2011 +0200
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Fri May 13 02:09:06 2011 +0200
@@ -76,7 +76,7 @@
 // 2011/04/15: [jDG] Store low_depth in 32bits (w/o rounding), for a better stability.
 // 2011/04/25: [jDG] Added 1mn mode for CNS calculation, to allow it for decoplanning.
 // 2011/04/27: [jDG] Fixed char_O_gradient_factor calculation when model uses gradient-factor.
-// 2011/05/02: [jDG] Added @+5min variant.
+// 2011/05/02: [jDG] Added "Future TTS" function (CF58).
 //
 // TODO:
 //  + Allow to abort MD2 calculation (have to restart next time).
@@ -979,7 +979,7 @@
     if( sim_gas_delay <= sim_dive_mins)
     {
         // Compute current depth:
-        overlay unsigned char depth = (unsigned char)((pres_respiration - pres_surface) * BAR_TO_METER);
+        overlay unsigned char depth = (unsigned char)(0.5 + (pres_respiration - pres_surface) * BAR_TO_METER);
         assert( depth < 130 );
 
         // And if I'm above the last decostop (with the 3m margin) ?
@@ -1462,7 +1462,7 @@
 // 
 // Note: because this can be very long, break on 16 iterations, and set state
 //       to 0 when finished, or to 1 when needing to continue.
-// Note: because this might be very long (~ 66 ms by iteration in 1.84beta),
+// Note: because each iteration might be very long too (~ 66 ms in 1.84beta),
 //       break the loop when total time > 512msec.
 //
 void calc_hauptroutine_calc_deco(void)
@@ -1508,7 +1508,11 @@
             }
         }
         else
+        {
+            // Note: if loop==0, temp_depth_limit might not be already set here.
+            temp_depth_limit = (int)(0.5 + (temp_deco - pres_surface) * BAR_TO_METER);
             update_deco_table();    // Just pass one minute.
+        }
 
         //---- Then update tissue --------------------------------------------
         sim_dive_mins++;            // Advance simulated time by 1 minute.
@@ -1528,6 +1532,9 @@
 //       there is no need to break on more that 16 iterations
 //       (or we are already in deep shit).
 //
+// Input:  pres_respiration
+// Output: temp_deco
+//
 // if char_O_deco_status indicate @+5 variant, add extra time at current depth,
 // before ascent.
 void sim_ascent_to_first_stop(void)
@@ -1569,10 +1576,13 @@
         }
 
         // Check for gas change below new depth ?
-        temp_depth_limit = (temp_deco - pres_surface) * BAR_TO_METER;
+        temp_depth_limit = (int)(0.5 + (temp_deco - pres_surface) * BAR_TO_METER);
+        assert( temp_depth_limit > 0);
 
         if( gas_switch_deepest() )
         {
+            assert( temp_depth_limit > 0);
+
             temp_deco = temp_depth_limit * METER_TO_BAR + pres_surface;
             break;
         }
@@ -1894,7 +1904,7 @@
     for(x=0; x<32; ++x)
     {
         // Make sure deco-stops are recorded in order:
-        assert( !internal_deco_depth[x] || temp_depth_limit <= internal_deco_depth[x] );
+        assert( !internal_deco_depth[x] || temp_depth_limit <= (internal_deco_depth[x]& 0x7F) );
 
         if( (internal_deco_depth[x] & 0x7F) == temp_depth_limit )
         {
@@ -2081,7 +2091,7 @@
         if( 0.0 < temp3 && temp3 < 1.0 )
     	{
             overlay float var_He_halftime = (buhlmann_ht+16)[ci];
-            assert( 1.51 <= var_He_halftime && var_He_halftime <= 240.03 );
+            assert( 1.5099 <= var_He_halftime && var_He_halftime <= 240.03 );
 
         	temp3 = log(1.0 - temp3) / -0.6931; // temp1 is the multiples of half times necessary.
         							 // 0.6931 is ln(2), because the math function log() calculates with a base of e  not 2 as requested.
Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed