changeset 322:676d18bce8d7

Fix ppO2[flush] display in customview.
author JeanDo
date Sat, 07 May 2011 00:08:08 +0200
parents a99073445c18
children b7940978edc9
files code_part1/OSTC_code_asm_part1/pled_outputs.asm code_part1/OSTC_code_c_part2/p2_deco.c code_part1/OSTC_code_c_part2/p2_deco.o code_part1/OSTC_code_c_part2/shared_definitions.h
diffstat 4 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Thu May 05 22:18:24 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat May 07 00:08:08 2011 +0200
@@ -3109,9 +3109,16 @@
 
 	WIN_LEFT	.130
 	WIN_TOP		.168
+
+    movff       char_O_flush_ppO2, lo
+    incf        lo,W                    ; ppO2 == 2.55 ?
+    bnz         PLED_show_end_ead_divemode_1
+    
+    STRCPY_PRINT "----"                 ; YES: mark overflow.
+    return
+
+PLED_show_end_ead_divemode_1:    
 	lfsr		FSR2,letter
-
-    movff       char_O_diluent_ppO2, lo
     clrf        hi
 	bsf		leftbind
 	output_16dp	d'3'					; Show ppO2 w/o leading zero
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Thu May 05 22:18:24 2011 +0200
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Sat May 07 00:08:08 2011 +0200
@@ -1384,6 +1384,8 @@
 	pres_diluent = pres_respiration;
     if( char_I_const_ppO2 != 0 )												// new in v.101
     {
+        overlay float flush_ppO2 = pres_respiration * (1.0 - N2_ratio - He_ratio);
+        
   		pres_diluent -= const_ppO2;                                             // new in v.101
   		pres_diluent /= N2_ratio + He_ratio;                                    // new in v.101
         if( pres_diluent < 0.0 )
@@ -1392,7 +1394,10 @@
   		    pres_diluent = pres_respiration;                                    // new in v.101
 
  		char_O_diluent = (unsigned char)(pres_diluent/pres_respiration*100.0 + 0.5);
- 		char_O_diluent_ppO2 = (unsigned char)(pres_diluent * (1.0 - N2_ratio - He_ratio) * 100.0 + 0.5);
+
+ 		if( flush_ppO2 > 2.45 ) flush_ppO2 = 2.55;
+ 		if( flush_ppO2 < 0.0  ) flush_ppO2 = 0.0;
+ 		char_O_flush_ppO2 = (unsigned char)(flush_ppO2*100.0 + 0.5);
     }
 
     if( pres_diluent > ppWater )                                              // new in v.101
Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed
--- a/code_part1/OSTC_code_c_part2/shared_definitions.h	Thu May 05 22:18:24 2011 +0200
+++ b/code_part1/OSTC_code_c_part2/shared_definitions.h	Sat May 07 00:08:08 2011 +0200
@@ -86,7 +86,7 @@
 VAR_UCHAR (char_O_gradient_factor);        // 
 VAR_UCHAR (char_O_gtissue_no);             // 
 VAR_UCHAR (char_O_diluent);                // new in v.101
-VAR_UCHAR (char_O_diluent_ppO2);           // 2011-05-01: ppO2 from diluant (CCR mode).
+VAR_UCHAR (char_O_flush_ppO2);             // 2011-05-01: ppO2 from diluant (CCR mode).
 VAR_UCHAR (char_O_EAD);                    // 2011-05-01: Added EAD/END in deco model.
 VAR_UCHAR (char_O_END);                    // 2011-05-01: Added EAD/END in deco model.
 VAR_UCHAR (char_O_CNS_fraction);           // new in v.101