Commits

wrobell committed ab41b5b Merge

- merged changes from default branch to get ver. 2.90 of firmware

  • Participants
  • Parent commits f0769e4, b980706
  • Branches deco-spike

Comments (0)

Files changed (6)

File code_part1/OSTC_code_asm_part1/changelog.txt

+New in 2.90:
+Stable Release
+BUGFIX: CNS calculation in decoplan should track gas (no marked changes anymore)
+
 New in 2.81:
-BETA Version - Do NOT use for diving
+BUGFIX: Show bailout list if first bailout gas <> gas 1
+BUGFIX: Italian language fix (Divemode menu)
+BUGFIX: Gas change depth display in divemode menu (OSTC 2C only)
 
 New in 2.80:
 Stable Release

File code_part1/OSTC_code_asm_part1/definitions.asm

 ; ToDo:
 
 #DEFINE	softwareversion_x		d'2'		; Software version  XX.YY
-#DEFINE	softwareversion_y		d'80'		; Software version  XX.YY
+#DEFINE	softwareversion_y		d'90'		; Software version  XX.YY
 
 #DEFINE softwareversion_beta 	0 			; (and 0 for release)
 

File code_part1/OSTC_code_asm_part1/italian_text.asm

     TCODE    .40,  .2,       "Reset Menu"                ;028 Reset Menu
     TCODE    .43,  .2,       "Imposta ora:"              ;029 Set Time:
     TCODE    .100, .50,      "Marker"                    ;030 Marker            (Add a mark in logbook profile)
-    TCODE    .100, .25,      "PianoDeco"                 ;031 Decoplan
+    TCODE    .100, .25,      "Decoplan"                  ;031 Decoplan
     TCODE    .100, .0,       "ListaGas"                  ;032 Gaslist
-    TCODE    .100, .50,      "AzzeraAvr"                 ;033 ResetAvr          (Reset average depth)
+    TCODE    .100, .50,      "Azz. Avr"                  ;033 ResetAvr          (Reset average depth)
     TCODE    .100, .100,     "Esci"                      ;034 Exit		        (Exit current menu)
     TCODE    .0,   .0,       "NonVolo"                   ;035 NoFly		        (No-flight count-down)
 ;

File code_part1/OSTC_code_asm_part1/outputs.asm

     bcf     leftbind
     STRCAT  "m "
     clrf    WREG
-    movff   WREG,letter+9       ; Limit to 8 chars
+    movff   WREG,letter+.9       ; Limit to 9 chars
     STRCAT_PRINT  ""
 
 	WIN_TOP		.216
     bcf     leftbind
     STRCAT  "m "
     clrf    WREG
-    movff   WREG,letter+9       ; Limit to 8 chars
+    movff   WREG,letter+.9       ; Limit to 9 chars
     STRCAT_PRINT  ""
     return
 
     call	word_processor
 	WIN_TOP		.50
 	WIN_LEFT	.90
+	read_int_eeprom 	d'33'	; Read start gas (1-5)
+	movff	EEDATA,hi       ; Store start gas
     bsf		leftbind
     lfsr	FSR2,letter
-	STRCAT  TXT_G1_3
-	movlw   .6              ; Gas #1: %O2 - Set address in internal EEPROM
+	STRCPY  TXT_GAS1
+	movff	hi,lo			; copy gas number
+	output_8				; display gas number
+	STRCAT  ": "
+    movlw   .4
+    mulwf   hi              ; 1-5
+    movf    PRODL,W
+	addlw   .2              ; Gas #x: %O2 - Set address in internal EEPROM
     movwf   EEADR
 	call	read_eeprom		; get byte (stored in EEDATA)
 	movff	EEDATA,lo		; copy to lo
 	output_8				; outputs into Postinc2!
 	PUTC    '/'
-	movlw   .7              ; Gas #1: %He - Set address in internal EEPROM
+    movlw   .4
+    mulwf   hi,W            ; 1-5
+    movf    PRODL,W
+	addlw   .3              ; Gas #x: %He - Set address in internal EEPROM
     movwf   EEADR
 	call	read_eeprom		; get byte (stored in EEDATA)
 	movff	EEDATA,lo		; copy to lo
 	WIN_LEFT	.90
 	WIN_FONT	FT_SMALL
 	bsf		leftbind
-	
 	movlw	d'2'
 	movwf	wait_temp			; here: stores eeprom address for gas list
 	movlw	d'0'
-	movwf	waitms_temp		; here: stores row for gas list
+	movwf	waitms_temp         ; here: stores row for gas list
 	clrf	hi					; here: Gas counter
 
 DISP_pre_dive_screen2_loop:
     decf    hi,W            ; Gas # in 0..4
 	call    DISP_grey_inactive_gas
 
-	read_int_eeprom 	d'33'			; Read start gas (1-5)
+	read_int_eeprom 	d'33'	; Read start gas (1-5)
 	movf	EEDATA,W
-	cpfseq	hi				; Current Gas the active gas?
-	bra		DISP_pre_dive_screen2a
-	bra		DISP_pre_dive_screen2b
+	cpfseq	hi                  ; Current Gas the start gas?
+	bra		DISP_pre_dive_screen2a  ; Yes
+	bra		DISP_pre_dive_screen2b  ; No
 
 DISP_pre_dive_screen2a:
 	movlw	d'25'
 	addwf	waitms_temp,F		; Increase row
 	WIN_LEFT	.90
 	movff	waitms_temp,win_top ; Set Row
-	call	word_processor	; No, display gas
+	call	word_processor      ; Display gas
 
 DISP_pre_dive_screen2b:
-	movlw	d'5'			; list all four (remaining) gases
-	cpfseq	hi				; All gases shown?
+	movlw	d'5'                ; list all four (remaining) gases
+	cpfseq	hi                  ; All gases shown?
 	bra		DISP_pre_dive_screen2_loop	; No
 	
-	return							; No, return (OC mode)
+	return						; No, return (OC mode)
 
 DISP_pre_dive_screen3:	
 	WIN_LEFT	.90
 	call	read_eeprom			; Low-value
 	movff	EEDATA,lo
 	output_8					; Show gas number
-    STRCAT_PRINT  TXT_METER2	; "m "
+    STRCAT  "m "
+    clrf    WREG
+    movff   WREG,letter+.9       ; Limit to 9 chars
+    STRCAT_PRINT  ""
 	bcf		leftbind
 	call	DISP_standard_color
 	return

File code_part1/OSTC_code_c_part2/p2_deco.c

 // 2013/03/05: [jDG] Should vault low_depth too.
 // 2013/03/05: [jDG] Wrobell remark: ascent_to_first_stop works better with finer steps (2sec).
 // 2013/05/08: [jDG] A. Salm remark: NOAA tables for CNS are in ATA, not bar.
-// 2013/10/22: [mH] Remove CF55 stuff
+// 2013/10/22: [mH]  Remove CF55 stuff
+// 2013/12/21: [jDG] Fix CNS calculation in decoplan w/o marked gas switch
 //
 // TODO:
 //  + Allow to abort MD2 calculation (have to restart next time).
 {
     // Copy depth of the first (deepest) stop, because when reversing
     // order, it will be hard to find...
-    char_O_first_deco_depth = internal_deco_depth[0] & 0x7F;
+    char_O_first_deco_depth = internal_deco_depth[0];
     char_O_first_deco_time  = internal_deco_time [0];
 
     if( read_custom_function(54) & 1 ) //---- Should we reverse table ? ------
 //
 // Input:  temp_depth_limit,
 //         deco_gas_change[]
-//         sim_gas_delay, sim_gas_depth_used, sim_dive_mins.
+//         sim_gas_depth_used, sim_dive_mins.
 //
 // RETURNS TRUE if a stop is needed for gas switch.
 //
-// Output: temp_depth_limit, sim_gas_delay, sim_gas_depth_used IFF the is a switch.
+// Output: temp_depth_limit, sim_gas_depth_used IFF the is a switch.
 //
-// NOTE: might be called from bottom (when sim_gas_delay and sim_gas_depth_used
-//       are null), or during the ascent to make sure we are not passing a
+// NOTE: might be called from bottom (when sim_gas_depth_used
+//       is null), or during the ascent to make sure we are not passing a
 //       stop (in which case both can be already set).
 //
 static unsigned char gas_switch_deepest(void)
     for(x=0; x<NUM_STOPS; ++x)
     {
         // Make sure deco-stops are recorded in order:
-        assert( !internal_deco_depth[x] || temp_depth_limit <= (internal_deco_depth[x]& 0x7F) );
-
-        if( (internal_deco_depth[x] & 0x7F) == temp_depth_limit )
+        assert( !internal_deco_depth[x] || temp_depth_limit <= internal_deco_depth[x] );
+
+        if( internal_deco_depth[x]== temp_depth_limit )
         {
             // Do not overflow (max 255')
             if( internal_deco_time[x] < 255 )
 {
     overlay unsigned char  backup_gas_last_depth;
     overlay unsigned char  backup_gas_last_used;
-    overlay unsigned short backup_gas_delay;
     overlay unsigned short backup_dive_mins;
     overlay unsigned char  backup_actual_ppO2;
 
         //---- Do all further stops ------------------------------------------
         for(i=0; i<NUM_STOPS; ++i)
         {
-            overlay unsigned char switch_gas;
+            overlay unsigned char stop_gas;
 
             //---- Get next stop, possibly in reverse order ------------------
             if( deepest_first )
             {
                 time             = char_O_deco_time[i];
                 temp_depth_limit = char_O_deco_depth[i];
+                stop_gas         = char_O_deco_gas[i];
             }
             else
             {
                 time             = char_O_deco_time[(NUM_STOPS-1)-i];
                 temp_depth_limit = char_O_deco_depth[(NUM_STOPS-1)-i];
+                stop_gas         = char_O_deco_gas[(NUM_STOPS-1)-i];
             }
             if( time == 0 ) continue;
 
             //---- Gas Switch ? ----------------------------------------------
-            switch_gas = temp_depth_limit & 0x80;   // Switch flag.
-            temp_depth_limit &= 0x7F;               // True stop depth.
-
-            if( switch_gas )
+            if( stop_gas != sim_gas_last_used )
             {
-                gas_switch_deepest();
+                sim_gas_last_depth = deco_gas_change[stop_gas-1];
+                sim_gas_last_used  = stop_gas;
                 gas_switch_set();
             }
 
             time = char_O_deco_time[i];
             if( time == 0 ) break;          // End of table: done.
 
-             newDepth  = char_O_deco_depth[i] & 0x7F;
+             newDepth  = char_O_deco_depth[i];
         }
         else
         {
             time = char_O_deco_time[31-i];
             if( time == 0 ) continue;       // not yet: still search table.
 
-            newDepth = char_O_deco_depth[31-i] & 0x7F;
+            newDepth = char_O_deco_depth[31-i];
         }
 
         //---- Gas switch during this step -----------------------------------

File code_part1/OSTC_code_c_part2/p2_deco.o

Binary file modified.