From 948785120a829f321bce2e68ee92de556b84ae2d Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Sun, 22 Apr 2012 22:50:43 +0200 Subject: digital/beacon: when a reflector is detected for the very first time, request a codewheel rebase --- digital/beacon/src/laser.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'digital') diff --git a/digital/beacon/src/laser.c b/digital/beacon/src/laser.c index 205b60be..232ff229 100644 --- a/digital/beacon/src/laser.c +++ b/digital/beacon/src/laser.c @@ -27,6 +27,8 @@ #include #include "debug_avr.h" #include "laser.h" +#include "servo.h" +#include "codewheel.h" laser_s laser; @@ -106,8 +108,11 @@ void laser_set_angle(uint16_t angle) /* Zigbee sending IRQ vector */ ISR(TIMER3_COMPB_vect) { -// TIMSK3 &= ~OCIE3B; -// sei(); + if(servo_get_state(SERVO_1) == SERVO_SCANNING_FAST_IN_PROGRESS) + { + codewheel_set_rebase_offset(laser_get_angle()); + codewheel_set_state(CODEWHEEL_REQUEST_REBASE); + } } -- cgit v1.2.3