summaryrefslogtreecommitdiff
path: root/digital/beacon
diff options
context:
space:
mode:
authorFlorent Duchon2012-04-22 22:50:43 +0200
committerFlorent Duchon2012-05-04 00:06:28 +0200
commit948785120a829f321bce2e68ee92de556b84ae2d (patch)
treeff765e98c8afd39d03ee1fd0b82039c3736c7101 /digital/beacon
parent94e2e1e4af9b973b888f00988b0cfeb2d69eb99a (diff)
digital/beacon: when a reflector is detected for the very first time, request a codewheel rebase
Diffstat (limited to 'digital/beacon')
-rw-r--r--digital/beacon/src/laser.c9
1 files changed, 7 insertions, 2 deletions
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 <avr/interrupt.h>
#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);
+ }
}