From b383e31b3b7f9dc45e6c98e4c45b7779508fcfaf Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Tue, 24 Apr 2012 19:26:55 +0200 Subject: digital/beacon: improve calibration_start_stop_task() internal behavior --- digital/beacon/src/calibration.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'digital') 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(); } } -- cgit v1.2.3