From b6e28f0de9c2f02fe2cb5c3f8244f6b2199673b9 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Sat, 22 Mar 2008 16:17:19 +0100 Subject: * digital/io/src - use the helper macro set_bit where needed. --- digital/io/src/servo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'digital/io/src/servo.c') diff --git a/digital/io/src/servo.c b/digital/io/src/servo.c index 66fb9681..19f97a63 100644 --- a/digital/io/src/servo.c +++ b/digital/io/src/servo.c @@ -26,7 +26,7 @@ #include "servo.h" #include "io.h" /* General defines of registers */ -#include "modules/utils/utils.h" /* regv */ +#include "modules/utils/utils.h" /* regv, set_bit */ #include "modules/utils/byte.h" /* v16_to_v8 */ /** @@ -86,7 +86,6 @@ SIGNAL (SIG_OVERFLOW2); void servo_init (void) { -#define set_bit(port, bit) (port |= _BV(bit)) /* Set-up all the pins of the servo to out direction */ set_bit (SERVO_PORT, 0); set_bit (SERVO_PORT, 1); @@ -104,7 +103,7 @@ servo_init (void) servo_updating_id_ = 0; /* Enable overflow interrupt */ - TIMSK |= _BV (TOIE2); + set_bit (TIMSK, TOIE2); } /* Set the high time of the input signal of a servo (and its position). */ @@ -152,7 +151,7 @@ SIGNAL (SIG_OVERFLOW2) if (servo_updating_id_ != 0) SERVO_PORT &= ~_BV (servo_updating_id_ - 1); /* Set to high state the current servo motor pin */ - SERVO_PORT |= _BV (servo_updating_id_); + set_bit (SERVO_PORT, servo_updating_id_); /* Plan next timer overflow to the TOP minus the current configuration * of the servo motor */ TCNT2 = SERVO_TCNT_TOP - servo_high_time_[servo_updating_id_]; -- cgit v1.2.3