summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Duchon2012-04-24 19:26:55 +0200
committerFlorent Duchon2012-05-04 00:06:28 +0200
commitb383e31b3b7f9dc45e6c98e4c45b7779508fcfaf (patch)
tree6a81dad164cc3d988abd1a4ae03f0dd983bc728d
parentceb223a58667eaf283f56fd57c8db99047217fd2 (diff)
digital/beacon: improve calibration_start_stop_task() internal behavior
-rw-r--r--digital/beacon/src/calibration.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/digital/beacon/src/calibration.c b/digital/beacon/src/calibration.c
index fe661407..95d8d168 100644
--- a/digital/beacon/src/calibration.c
+++ b/digital/beacon/src/calibration.c
@@ -60,16 +60,13 @@ void calibration_stop_task(void)
/* This function starts or stops the calibration task depending on the current state */
void calibration_start_stop_task(void)
{
- static bool task_step = 0;
- if(task_step == 0)
+ if(calibration_get_state() != CALIBRATION_INIT)
{
- calibration_start_task();
- task_step = 1;
+ calibration_stop_task();
}
else
{
- calibration_stop_task();
- task_step = 0;
+ calibration_start_task();
}
}