From 3f1a3107d81a696b9dedc48c1a9bbc8029682c6b Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Sun, 22 Apr 2012 00:10:04 +0200 Subject: digital/beacon: add motor control to the debug menu & display motor state in the debug task --- digital/beacon/src/motor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'digital/beacon/src/motor.c') diff --git a/digital/beacon/src/motor.c b/digital/beacon/src/motor.c index 907559ea..330a861c 100644 --- a/digital/beacon/src/motor.c +++ b/digital/beacon/src/motor.c @@ -50,3 +50,13 @@ TMotor_state motor_get_state(void) else return MOTOR_STOPPED; } + +/* This function starts or stops the motor according to the current state */ +void motor_start_stop_control(void) +{ + + if(motor_get_state == MOTOR_IN_ROTATION) + motor_stop(); + else + motor_start(); +} -- cgit v1.2.3