return -1;
switch (rch->type) {
- case RC_PROTO_TYPE_CHANNEL:
+ case RC_PROTO_TYPE_CHANNEL: {
+ struct rc_proto_channel *rcc =
+ (struct rc_proto_channel *) recvframe->data;
+ int16_t val;
if (datalen != sizeof(struct rc_proto_channel))
return -1;
+ val = ntohs(rcc->axis[0]);
+ val >>= 6;
+ val += 512;
+ spi_servo_set(0, val);
break;
+ }
case RC_PROTO_TYPE_RANGE: {
struct rc_proto_range *rcr =
(struct rc_proto_range *) recvframe->data;
int8_t err;
struct xbee_dev dev;
- spi_servo_init();
#ifdef USE_USB
SetupHardware();
1000L / SCHEDULER_UNIT,
LED_PRIO);
cmdline_init();
+ spi_servo_init();
#ifndef USE_USB
/* in usb mode, it's done in usb callback */
printf_P(PSTR("\r\n"));