diff Small_CPU/Src/scheduler.c @ 186:f11f0bf6ef2d cleanup-2

cleanup: remove obsolete code, make static, etc. Some rather trivial cleanup things like putting demo code into ifdefs, making functions static where possible, and against my normal policy of hard removing unused code, commenting it out at this point in time. Somehow, I think that this commented code might be useful in the near future as a new pressure sensor is coming. And finally, fixed some typo's in comment. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Fri, 15 Mar 2019 12:39:28 +0100
parents 331882a89421
children b95741467355
line wrap: on
line diff
--- a/Small_CPU/Src/scheduler.c	Fri Mar 15 08:22:16 2019 +0000
+++ b/Small_CPU/Src/scheduler.c	Fri Mar 15 12:39:28 2019 +0100
@@ -458,11 +458,9 @@
   */
 void scheduleDiveMode(void)
 {
-//	uint32_t tickstart = 0;
 	uint32_t ticksdiff = 0; 
 	uint32_t lasttick = 0;
 
-	uint32_t turbo_seconds = 0;
 	uint8_t counterAscentRate = 0;
 	float lastPressure_bar = 0.0f;
 	global.dataSendToMaster.mode = MODE_DIVE;
@@ -498,9 +496,10 @@
 				global.check_sync_not_running++;
 				pressure_update();
 				scheduleUpdateDeviceData();
+#ifdef DEMOMODE
 				if(global.demo_mode)
 				{
-					turbo_seconds = demo_modify_temperature_and_pressure(global.lifeData.dive_time_seconds, Scheduler.counterPressure100msec, global.ceiling_from_main_CPU_mbar);
+					int turbo_seconds = demo_modify_temperature_and_pressure(global.lifeData.dive_time_seconds, Scheduler.counterPressure100msec, global.ceiling_from_main_CPU_mbar);
 					if(turbo_seconds)
 					{
 						global.lifeData.dive_time_seconds += turbo_seconds;
@@ -510,7 +509,7 @@
 					if((global.lifeData.counterSecondsShallowDepth > 1) && (global.lifeData.counterSecondsShallowDepth < (global.settings.timeoutDiveReachedZeroDepth - 10)))
 						global.lifeData.counterSecondsShallowDepth = (global.settings.timeoutDiveReachedZeroDepth - 10);
 				}
-				
+#endif
 				
 				//Calc ascentrate every two second (20 * 100 ms)
 				counterAscentRate++;
@@ -1543,7 +1542,7 @@
 }
 
 
-//save time diffenrence
+//save time difference
 uint32_t time_elapsed_ms(uint32_t ticksstart,uint32_t ticksnow)
 {
 	if(ticksstart <= ticksnow)