summaryrefslogtreecommitdiff
path: root/digital/beacon/src/motor.c
diff options
context:
space:
mode:
authorFlorent Duchon2012-04-22 00:10:04 +0200
committerFlorent Duchon2012-05-04 00:06:27 +0200
commit3f1a3107d81a696b9dedc48c1a9bbc8029682c6b (patch)
tree584bf27b4d220eb5ec34aacca4226e69463d3ebd /digital/beacon/src/motor.c
parentfc5732a9d2e0cdda0ac1fbdd6a2626c19ede2461 (diff)
digital/beacon: add motor control to the debug menu & display motor state in the debug task
Diffstat (limited to 'digital/beacon/src/motor.c')
-rw-r--r--digital/beacon/src/motor.c10
1 files changed, 10 insertions, 0 deletions
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();
+}