beep when GPS ready
[protos/xbee-avr.git] / spi_servo.c
index 917769c..7a85070 100644 (file)
@@ -41,6 +41,8 @@ struct spi_servo_rx {
 };
 static struct spi_servo_rx spi_servo_rx;
 
+static struct callout spi_timer;
+
 /*
  * SPI protocol:
  *
@@ -182,14 +184,13 @@ void spi_servo_init(void)
        /* remove power reduction on spi */
        PRR0 &= ~(1 << PRSPI);
 
-       /* Enable SPI, Master, set clock rate fck/64 */
-       SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1);
+       /* Enable SPI, Master, set clock rate fck/16 */
+       SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR0);
 
        SS_HIGH();
 
-       callout_init(&xbeeboard.spi_timer, spi_servo_cb, NULL, SPI_PRIO);
-       callout_schedule(&xbeeboard.intr_cm,
-               &xbeeboard.spi_timer, 0); /* immediate */
+       callout_init(&spi_timer, spi_servo_cb, NULL, SPI_PRIO);
+       callout_schedule(&xbeeboard.intr_cm, &spi_timer, 0); /* immediate */
        spi_servo_set_bypass(1);
 }