changeset 524:b33a8c1c72e5

Minor: Removed duplicated definition of number of available gases
author Ideenmodellierer
date Sun, 13 Sep 2020 20:44:50 +0200
parents 0a407cd48912
children 1f557e5f4b5a
files Discovery/Inc/logbook.h Discovery/Src/logbook.c
diffstat 2 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Inc/logbook.h	Thu Sep 10 20:52:47 2020 +0200
+++ b/Discovery/Inc/logbook.h	Sun Sep 13 20:44:50 2020 +0200
@@ -30,8 +30,6 @@
 #include "data_central.h"
 #include "settings.h"
 
-#define NUM_GAS		(5)	/* number of selectable gases */
-
 typedef struct
 {
     uint8_t setpoint_cbar;
@@ -67,7 +65,7 @@
     int16_t  minTemp;
     uint16_t surfacePressure_mbar;
     uint16_t desaturationTime;
-    SGasListLog gasordil[NUM_GAS];
+    SGasListLog gasordil[NUM_GASES];
     uint8_t  firmwareVersionLow;
     uint8_t  firmwareVersionHigh;
     uint16_t batteryVoltage;
@@ -75,7 +73,7 @@
     uint8_t  gfAtBeginning;
     uint8_t  gfAtEnd;
     uint16_t personalDiveCount;
-    SSetpointLog setpoint[NUM_GAS];
+    SSetpointLog setpoint[NUM_GASES];
     uint16_t maxCNS;
     uint16_t averageDepth_mbar;
     uint16_t total_diveTime_seconds;
@@ -117,7 +115,7 @@
     uint8_t minTemp[2];
     uint8_t surfacePressure_mbar[2];
     uint8_t desaturationTime[2];
-    uint8_t gasordil[NUM_GAS*4];
+    uint8_t gasordil[NUM_GASES*4];
     uint8_t firmwareVersionLow;
     uint8_t firmwareVersionHigh;
     uint8_t batteryVoltage[2];
--- a/Discovery/Src/logbook.c	Thu Sep 10 20:52:47 2020 +0200
+++ b/Discovery/Src/logbook.c	Sun Sep 13 20:44:50 2020 +0200
@@ -1843,12 +1843,12 @@
 	if(ppo2)
 	{
 		/* find first gas ID */
-		for(index = 0; index < NUM_GAS; index++)
+		for(index = 0; index < NUM_GASES; index++)
 		{
 			if(pHeader->gasordil[index].note.ub.first)
 				break;
 		}
-		if(index != NUM_GAS)
+		if(index != NUM_GASES)
 		{
 			gas.helium_percentage = pHeader->gasordil[index].helium_percentage;
 			gas.nitrogen_percentage = 100 -  gas.helium_percentage - pHeader->gasordil[index].oxygen_percentage;