diff Discovery/Src/data_exchange_main.c @ 307:b6436edfb2c0 cleanup-4

cleanup: factor out unused stopwatch code Visually, this looks a bit of a dangerous cleanup, but its not :-) To explain this cleanup: stopwatch_seconds is never used, so assign to it is useless, and the variable can be removed. Now, stopwatch_start_at_this_dive_time_seconds is not used any more, so remove it as well. Now, look at the boolResetStopwatch code. It is used but only to reset itself. This makes the whole stopwatch block in data_exchange_main.c a useless thing. All the other cleanup is trivial. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Wed, 22 May 2019 22:22:15 +0200
parents 2f43419102c8
children 1203255481e4
line wrap: on
line diff
--- a/Discovery/Src/data_exchange_main.c	Wed May 22 14:39:04 2019 +0200
+++ b/Discovery/Src/data_exchange_main.c	Wed May 22 22:22:15 2019 +0200
@@ -860,7 +860,6 @@
 			//Init dive Mode
 			decoLock = DECO_CALC_init_as_is_start_of_dive;
 			pStateReal->lifeData.boolResetAverageDepth = 1;
-			pStateReal->lifeData.boolResetStopwatch = 1;
 		}
 
 		pStateReal->lifeData.cns = dataIn.data[dataIn.boolToxicData].cns;
@@ -992,7 +991,6 @@
 		// reset max_depth_meter, average_depth_meter and internal values
 			pStateReal->lifeData.max_depth_meter = 0;
 			pStateReal->lifeData.boolResetAverageDepth = 1;
-			pStateReal->lifeData.boolResetStopwatch = 1;
 		}
 	}
 
@@ -1024,16 +1022,6 @@
 	}
 	if(*AvgDepthCount == 0)
 		*AvgDepthValue = 0;
-
-
-	/* stop watch
-	 */
-	if(pStateReal->lifeData.boolResetStopwatch)
-	{
-		pStateReal->lifeData.internal.stopwatch_start_at_this_dive_time_seconds = pStateReal->lifeData.dive_time_seconds;
-		pStateReal->lifeData.boolResetStopwatch = 0;
-	}
-	pStateReal->lifeData.stopwatch_seconds = pStateReal->lifeData.dive_time_seconds - pStateReal->lifeData.internal.stopwatch_start_at_this_dive_time_seconds;
 }