+ IRQ_LOCK(flags);
+ spi_servo_tx.cmd_mask |= (1 << N_SERVO);
+ if (enable)
+ spi_servo_tx.servo[N_SERVO] |= BYPASS_BIT;
+ else
+ spi_servo_tx.servo[N_SERVO] &= (~BYPASS_BIT);
+ spi_servo_tx.cmd_mask |= (1 << N_SERVO);
+ IRQ_UNLOCK(flags);
+}
+
+void spi_servo_set_ppm(uint8_t enable)
+{
+ uint8_t flags;
+
+ IRQ_LOCK(flags);
+ spi_servo_tx.cmd_mask |= (1 << N_SERVO);
+ if (enable)
+ spi_servo_tx.servo[N_SERVO] |= PPM_BIT;
+ else
+ spi_servo_tx.servo[N_SERVO] &= (~PPM_BIT);
+ spi_servo_tx.cmd_mask |= (1 << N_SERVO);
+ IRQ_UNLOCK(flags);
+}
+
+void spi_servo_dump(void)
+{
+ uint8_t i;
+
+ for (i = 0; i < N_SERVO; i++)
+ printf_P(PSTR("%d: rx=%4.4d tx=%4.4d\r\n"), i,
+ spi_servo_get(i), spi_servo_tx.servo[i]);
+ printf_P(PSTR("bypass=%d ppm=%d\n"),
+ spi_servo_get_bypass(), spi_servo_get_ppm());