git.droids-corp.org
/
protos
/
rc_servos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
809de0a
)
rc_servos: fix servo description to match board topology
author
Fabrice Desclaux
<serpilliere@droids-corp.org>
Thu, 22 Mar 2012 19:52:57 +0000
(20:52 +0100)
committer
Fabrice Desclaux
<serpilliere@droids-corp.org>
Thu, 22 Mar 2012 19:52:57 +0000
(20:52 +0100)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index
c729bbf
..
dd98345
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-7,16
+7,24
@@
struct servo {
static struct servo servo_table[] = {
{
static struct servo servo_table[] = {
{
- .bit =
0
,
+ .bit =
3
,
.command = 0,
},
{
.command = 0,
},
{
- .bit =
1
,
+ .bit =
4
,
.command = 512,
},
{
.command = 512,
},
{
- .bit = 2,
- .command = 1023,
+ .bit = 5,
+ .command = 512,
+ },
+ {
+ .bit = 6,
+ .command = 512,
+ },
+ {
+ .bit = 7,
+ .command = 512,
},
};
#define NB_SERVO (sizeof(servo_table)/sizeof(*servo_table))
},
};
#define NB_SERVO (sizeof(servo_table)/sizeof(*servo_table))
@@
-61,7
+69,7
@@
static volatile union {
SIGNAL(TIMER1_COMPA_vect)
{
SIGNAL(TIMER1_COMPA_vect)
{
- PORT
C
= portval;
+ PORT
D
= portval;
TIMSK1 &= ~_BV(OCIE1A);
done = 1;
}
TIMSK1 &= ~_BV(OCIE1A);
done = 1;
}
@@
-147,7
+155,8
@@
int main(void)
DDRB = 0x20;
/* servo outputs */
DDRB = 0x20;
/* servo outputs */
- DDRC = 0x7;
+ DDRD = 0xf8;
+ DDRB |= 0x01;
/* start timer1 at clk/1 (8Mhz) */
TCNT1 = 0;
/* start timer1 at clk/1 (8Mhz) */
TCNT1 = 0;
@@
-177,7
+186,7
@@
int main(void)
}
/* bypass mode */
while (bypass == 1) {
}
/* bypass mode */
while (bypass == 1) {
- PORT
C = PORTB
;
+ PORT
D = ((PINC & 0x0f) << 3) | ((PINB & 0x01) << 7)
;
poll_spi();
}
}
poll_spi();
}
}