summaryrefslogtreecommitdiff
path: root/digital/beacon
diff options
context:
space:
mode:
authorFlorent Duchon2012-05-03 23:58:55 +0200
committerFlorent Duchon2012-05-04 00:06:29 +0200
commitf58fec87b270bf772c44cd697f90d7c2aa1260f1 (patch)
treeb73d5d3f220d0fb2cfc39ba7acbac950af94e3ee /digital/beacon
parent956c4bb433b65602f43ea079970b9758c630360e (diff)
digital/beacon: laser_get_angle can be returned in raw format or in degree
Diffstat (limited to 'digital/beacon')
-rw-r--r--digital/beacon/src/laser.c13
-rw-r--r--digital/beacon/src/laser.h11
2 files changed, 17 insertions, 7 deletions
diff --git a/digital/beacon/src/laser.c b/digital/beacon/src/laser.c
index 232ff229..4bd78c5c 100644
--- a/digital/beacon/src/laser.c
+++ b/digital/beacon/src/laser.c
@@ -91,14 +91,21 @@ void laser_engage_angle_confirmation(uint16_t value)
}
-/* This function returns the angle value */
-uint16_t laser_get_angle(void)
+/* This function returns the angle value in raw format */
+uint16_t laser_get_angle_raw(void)
{
+ uprintf("valeur de laser_get_angle_raw() = %d\r\n",laser.angle);
return laser.angle;
}
+/* This function returns the angle value in degree */
+float laser_get_angle_degree(void)
+{
+ return codewheel_convert_angle_raw2degrees(laser.angle);
+}
+
-/* This function sets the angle value */
+/* This function sets the angle value in raw format */
void laser_set_angle(uint16_t angle)
{
laser.angle = angle;
diff --git a/digital/beacon/src/laser.h b/digital/beacon/src/laser.h
index d9d24b1e..f50c5b07 100644
--- a/digital/beacon/src/laser.h
+++ b/digital/beacon/src/laser.h
@@ -57,10 +57,13 @@ void laser_inhibit_angle_confirmation(void);
/* This function configures the AVR OC3B interrupt that will send the angle LASER_SENDING_OFFSET after the latest rising edge */
void laser_engage_angle_confirmation(uint16_t value);
-/* This function returns the angle value */
-uint16_t laser_get_angle(void);
+/* This function returns the angle value in raw format */
+uint16_t laser_get_angle_raw(void);
-/* This function sets the angle value */
-void laser_set_angle(uint16_t angle);
+/* This function returns the angle value in degrees */
+float laser_get_angle_degrees(void);
+
+/* This function sets the angle value in raw format */
+void laser_set_angle_raw(uint16_t angle);
#endif