# HG changeset patch # User Ideenmodellierer # Date 1600022690 -7200 # Node ID b33a8c1c72e5226bbff7fc3cd640540fd3c149e9 # Parent 0a407cd48912b31223dc322447c0f9cdcb567d43 Minor: Removed duplicated definition of number of available gases diff -r 0a407cd48912 -r b33a8c1c72e5 Discovery/Inc/logbook.h --- 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]; diff -r 0a407cd48912 -r b33a8c1c72e5 Discovery/Src/logbook.c --- 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;