summaryrefslogtreecommitdiff
path: root/digital/beacon/src/laser.c
diff options
context:
space:
mode:
authorFlorent Duchon2012-05-16 17:29:49 +0200
committerFlorent Duchon2012-05-16 17:43:11 +0200
commit61738d34f10046b667846d474724294ff159a320 (patch)
treeb9f5da4bdf92ab242ec1f2c8ce89de50b6760d82 /digital/beacon/src/laser.c
parenta64fb816764b34b7bee2dc886c7efaa2c8bf0539 (diff)
digital/beacon: improve laser angle confirmation
Diffstat (limited to 'digital/beacon/src/laser.c')
-rw-r--r--digital/beacon/src/laser.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/digital/beacon/src/laser.c b/digital/beacon/src/laser.c
index e73c1bd7..888589ad 100644
--- a/digital/beacon/src/laser.c
+++ b/digital/beacon/src/laser.c
@@ -85,14 +85,7 @@ 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)
{
- if(value > CODEWHEEL_CPR - LASER_CONFIRMATION_OFFSET)
- {
- OCR3B = LASER_CONFIRMATION_OFFSET - (CODEWHEEL_CPR - value);
- }
- else
- {
- OCR3B = value + LASER_CONFIRMATION_OFFSET;
- }
+ OCR3B = (value + LASER_CONFIRMATION_OFFSET)%CODEWHEEL_CPR;
/* Enable interrupt */
TIMSK3 |= (1<<OCIE3B);