summaryrefslogtreecommitdiff
path: root/digital/beacon/src/laser.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/beacon/src/laser.c')
-rw-r--r--digital/beacon/src/laser.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/digital/beacon/src/laser.c b/digital/beacon/src/laser.c
index 0dc01e58..ffbdbcbb 100644
--- a/digital/beacon/src/laser.c
+++ b/digital/beacon/src/laser.c
@@ -33,6 +33,9 @@ laser_s laser;
/* This function initializes the laser pin input and associated interrupt */
void laser_init(void)
{
+ /* Init laser structiure */
+ laser_set_angle(0);
+
/* Configure Input compare interrupts for Laser Interrupt*/
TCCR3B |= (1<<ICNC3)|(1<<ICES3);
TIMSK3 |= (1<<ICIE3);
@@ -86,6 +89,20 @@ void laser_engage_angle_confirmation(uint16_t value)
}
+/* This function returns the angle value */
+uint16_t laser_get_angle(void)
+{
+ return laser.angle;
+}
+
+
+/* This function sets the angle value */
+void laser_set_angle(uint16_t angle)
+{
+ laser.angle = angle;
+}
+
+
/* Zigbee sending IRQ vector */
ISR(TIMER3_COMPB_vect)
{