summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-01 17:06:49 -0700
committerKeith Packard <keithp@keithp.com>2011-08-27 12:45:36 -0700
commitbe117376179126824439d98379079025ca0b245a (patch)
tree2d4376320f29c8cf7b6133c512d8d04494267f42
parentbc1b94df4d6b92e794ec93d9c1682ae5f61efa61 (diff)
altos: Keep relay closed while firing launcher
Instead of opening the relay while checking the desired state, keep it closed until the state goes off. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/ao_launch.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ao_launch.c b/src/ao_launch.c
index 35afbda8..a593d0b2 100644
--- a/src/ao_launch.c
+++ b/src/ao_launch.c
@@ -31,17 +31,17 @@ ao_launch_run(void)
for (;;) {
while (!ao_launch_ignite)
ao_sleep(&ao_launch_ignite);
+ ao_ignition[ao_igniter_drogue].firing = 1;
+ ao_ignition[ao_igniter_main].firing = 1;
+ AO_IGNITER_DIR |= AO_IGNITER_DROGUE_BIT | AO_IGNITER_MAIN_BIT;
+ AO_IGNITER_DROGUE = 1;
while (ao_launch_ignite) {
ao_launch_ignite = 0;
-
- ao_ignition[ao_igniter_drogue].firing = 1;
- ao_ignition[ao_igniter_main].firing = 1;
- AO_IGNITER_DROGUE = 1;
ao_delay(AO_MS_TO_TICKS(500));
- AO_IGNITER_DROGUE = 0;
- ao_ignition[ao_igniter_drogue].firing = 0;
- ao_ignition[ao_igniter_main].firing = 0;
}
+ AO_IGNITER_DROGUE = 0;
+ ao_ignition[ao_igniter_drogue].firing = 0;
+ ao_ignition[ao_igniter_main].firing = 0;
}
}