summaryrefslogtreecommitdiff
path: root/digital
diff options
context:
space:
mode:
authorJérémy Dufour2008-03-22 16:18:07 +0100
committerJérémy Dufour2008-03-22 16:18:07 +0100
commit2aa5d01b93364a52e0bcbeda9bb596c04b494ed0 (patch)
treeb40a79d514a8c582873da8768382c8cc2dc33cde /digital
parent66f04f914d617be8e8c5178cab0c965017db1ea1 (diff)
* digital/io/src
- fix a bug in setting pins direction (use DDR rather than PORT for setting the pins direction (thanks to ni)).
Diffstat (limited to 'digital')
-rw-r--r--digital/io/src/servo.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/digital/io/src/servo.c b/digital/io/src/servo.c
index 0051fac5..5e131b87 100644
--- a/digital/io/src/servo.c
+++ b/digital/io/src/servo.c
@@ -38,6 +38,7 @@
* All servos are connected to the PORTA.
*/
#define SERVO_PORT PORTA
+#define SERVO_DDR DDRA
/**
* TOP of the timer/counter.
@@ -88,11 +89,11 @@ void
servo_init (void)
{
/* Set-up all the pins of the servo to out direction */
- set_bit (SERVO_PORT, 0);
- set_bit (SERVO_PORT, 1);
- set_bit (SERVO_PORT, 2);
- set_bit (SERVO_PORT, 3);
- set_bit (SERVO_PORT, 4);
+ set_bit (SERVO_DDR, 0);
+ set_bit (SERVO_DDR, 1);
+ set_bit (SERVO_DDR, 2);
+ set_bit (SERVO_DDR, 3);
+ set_bit (SERVO_DDR, 4);
/* All pins are at low state by default */
/* Set-up the timer/counter 2: