diff options
| author | Keith Packard <keithp@keithp.com> | 2012-07-16 15:32:26 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-07-16 15:32:26 -0700 | 
| commit | 5860f75677ee20fcf35ab89a6b62f3e14a1c32f5 (patch) | |
| tree | bfe09041a823c8f759c210d292a0f56335edb89e /src/core/ao_pyro.c | |
| parent | 3ce645a79b54e22d7835c6e390a22a5ad501a339 (diff) | |
altos: Enable pyro channel control in telepyro
This should make the board actually work now.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/core/ao_pyro.c')
| -rw-r--r-- | src/core/ao_pyro.c | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/src/core/ao_pyro.c b/src/core/ao_pyro.c index a1377d21..4f37e979 100644 --- a/src/core/ao_pyro.c +++ b/src/core/ao_pyro.c @@ -20,6 +20,15 @@  #include <ao_sample.h>  #include <ao_flight.h> +#if IS_COMPANION +#include <ao_companion.h> +#define ao_accel ao_companion_command.accel +#define ao_speed ao_companion_command.speed +#define ao_height ao_companion_command.height +#define ao_flight_state ao_companion_command.flight_state +#define ao_motor_number ao_companion_command.motor_number +#endif +  #define ao_lowbit(x)	((x) & (-x))  /* @@ -152,6 +161,8 @@ ao_pyro_fire(uint8_t p)  	ao_delay(AO_MS_TO_TICKS(50));  } +uint8_t	ao_pyro_wakeup; +  static void  ao_pyro(void)  { @@ -163,7 +174,9 @@ ao_pyro(void)  		ao_sleep(&ao_flight_state);  	for (;;) { -		ao_delay(AO_MS_TO_TICKS(100)); +		ao_alarm(AO_MS_TO_TICKS(100)); +		ao_sleep(&ao_pyro_wakeup); +		ao_clear_alarm();  		for (p = 0; p < AO_PYRO_NUM; p++) {  			pyro = &ao_config.pyro[p]; | 
