comparison Discovery/Src/timer.c @ 188:ddc21166d25b

Merged in janlmulder/ostc4/cleanup-2 (pull request #5) Trivial cleanup
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Fri, 15 Mar 2019 12:55:58 +0000
parents f11f0bf6ef2d
children 90e65971f15d
comparison
equal deleted inserted replaced
185:1bb24fd3fc92 188:ddc21166d25b
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;