summaryrefslogtreecommitdiffhomepage
path: root/digital/beacon/src/codewheel.c
diff options
context:
space:
mode:
authorFlorent Duchon2012-05-16 22:56:41 +0200
committerFlorent Duchon2012-12-24 17:47:56 +0100
commitaf60ab915440edb8664f4d68ce9e59ee9a0cc27f (patch)
tree05aa93e1860bf4174a3ea6a4b553dd14bbbfa2ce /digital/beacon/src/codewheel.c
parentbc1ca9a4c44e019638adc51af66db1a578c851b6 (diff)
digital/beacon: add codewheel timer task
Diffstat (limited to 'digital/beacon/src/codewheel.c')
-rw-r--r--digital/beacon/src/codewheel.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/digital/beacon/src/codewheel.c b/digital/beacon/src/codewheel.c
index 283439d6..45e97c71 100644
--- a/digital/beacon/src/codewheel.c
+++ b/digital/beacon/src/codewheel.c
@@ -113,6 +113,31 @@ ISR(TIMER3_COMPA_vect)
else
{
OCR3A = CODEWHEEL_CPR;
+ codewheel.time = 0;
}
laser_reset_angle_id();
}
+
+/* Task for turn time measurment */
+void codewheel_timer_task(void)
+{
+ codewheel.time+=10;
+}
+
+/* This function start the codewheel timer task */
+void start_codewheel_timer_task(void)
+{
+ codewheel.time = 0;
+ codewheelTimer.interval = CODEWHEEL_TIMER_TASK_PERIOD;
+ codewheelTimer.mode = TIMER_REPEAT_MODE;
+ codewheelTimer.callback = codewheel_timer_task;
+ HAL_StartAppTimer(&codewheelTimer);
+}
+
+/* This function stop the codewheel timer task */
+void stop_codewheel_timer_task(void)
+{
+ HAL_StopAppTimer(&codewheelTimer);
+}
+
+