Mercurial > public > ostc4
comparison Discovery/Src/timer.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 | 5f11787b4f42 |
children | 90e65971f15d |
comparison
equal
deleted
inserted
replaced
185:1bb24fd3fc92 | 186:f11f0bf6ef2d |
---|---|
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. |
27 ////////////////////////////////////////////////////////////////////////////// | 27 ////////////////////////////////////////////////////////////////////////////// |
28 | 28 |
29 #include "data_central.h" | 29 #include "data_central.h" |
30 | 30 |
31 long stopWatchTime_Second = 0; | 31 static long stopWatchTime_Second = 0; |
32 _Bool bStopWatch = false; | 32 static _Bool bStopWatch = false; |
33 float stopWatchAverageDepth_Meter = 0.0f; | 33 static float stopWatchAverageDepth_Meter = 0.0f; |
34 long safetyStopCountDown_Second = 0; | 34 static long safetyStopCountDown_Second = 0; |
35 _Bool bSafetyStop = false; | |
36 | 35 |
37 void timer_init(void) | 36 void timer_init(void) |
38 { | 37 { |
39 stopWatchTime_Second = 0; | 38 stopWatchTime_Second = 0; |
40 stopWatchAverageDepth_Meter = 0.0f; | 39 stopWatchAverageDepth_Meter = 0.0f; |
46 void timer_UpdateSecond(_Bool checkOncePerSecond) | 45 void timer_UpdateSecond(_Bool checkOncePerSecond) |
47 { | 46 { |
48 static int last_second = -1; | 47 static int last_second = -1; |
49 static _Bool bSafetyStop = false; | 48 static _Bool bSafetyStop = false; |
50 static float last_depth_meter = 0; | 49 static float last_depth_meter = 0; |
51 //static _Bool CountDownStarted = false; | 50 |
52 if(checkOncePerSecond) | 51 if(checkOncePerSecond) |
53 { | 52 { |
54 int now = current_second(); | 53 int now = current_second(); |
55 if( last_second == now) | 54 if( last_second == now) |
56 return; | 55 return; |