summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Dufour2008-04-20 16:03:23 +0200
committerJérémy Dufour2008-04-20 16:03:23 +0200
commit00263f03400236d09a6dcd821243cd67173eb1a8 (patch)
tree29b8dd33ebcc22b915869d17048c6c7d6d74a618
parent109b68101b37407591c34d6cccec6801798830fb (diff)
* digital/io/src
- servo module now manages 8 servos.
-rw-r--r--digital/io/src/servo.avr.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/digital/io/src/servo.avr.c b/digital/io/src/servo.avr.c
index 39886bc5..96e4c2c0 100644
--- a/digital/io/src/servo.avr.c
+++ b/digital/io/src/servo.avr.c
@@ -139,16 +139,8 @@ SIGNAL (SIG_OVERFLOW2)
static uint16_t servo_high_time_cycle = servo_tic_cyle_;
/* State machine actions */
- switch (servo_updating_id_)
+ if (servo_updating_id_ >= 0)
{
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
/* Servos motor high state mode */
/* Set to low state the previous servo motor pin if needed (not for
@@ -168,9 +160,9 @@ SIGNAL (SIG_OVERFLOW2)
* we are at the last one) */
if (++servo_updating_id_ == SERVO_NUMBER)
servo_updating_id_ = -1;
- break;
-
- case -1:
+ }
+ else
+ {
/* Sleeping time mode */
/* Is it the first we are in this mode? */
@@ -199,6 +191,5 @@ SIGNAL (SIG_OVERFLOW2)
servo_high_time_cycle = servo_tic_cyle_;
}
}
- break;
}
}