altos: Pull igniter pins low as soon as possible at boot time
authorKeith Packard <keithp@keithp.com>
Thu, 11 Aug 2011 22:57:58 +0000 (15:57 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 11 Aug 2011 22:57:58 +0000 (15:57 -0700)
This reduces the pulse width on the igniter circuit caused by the
default cc1111 pin configuration at powerup time.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao.h
src/ao_ignite.c
src/ao_telemetrum.c

index bb3c80ec2ddbb5e8580eb1f8fa9655a58914dec9..0699fc2ca70f52e73a22a88c687b3dceac05909e 100644 (file)
--- a/src/ao.h
+++ b/src/ao.h
@@ -1350,6 +1350,9 @@ enum ao_igniter_status {
 enum ao_igniter_status
 ao_igniter_status(enum ao_igniter igniter);
 
+void
+ao_ignite_set_pins(void);
+
 void
 ao_igniter_init(void);
 
index 512ec6224ef2461f8b5c9799188ac7c645d3705e..5238beb4315663950e717f98629168b05bc4a419 100644 (file)
@@ -202,11 +202,17 @@ __code struct ao_cmds ao_ignite_cmds[] = {
 __xdata struct ao_task ao_igniter_task;
 
 void
-ao_igniter_init(void)
+ao_ignite_set_pins(void)
 {
        AO_IGNITER_DROGUE = 0;
        AO_IGNITER_MAIN = 0;
        AO_IGNITER_DIR |= AO_IGNITER_DROGUE_BIT | AO_IGNITER_MAIN_BIT;
+}
+
+void
+ao_igniter_init(void)
+{
+       ao_ignite_set_pins();
        ao_cmd_register(&ao_ignite_cmds[0]);
        ao_add_task(&ao_igniter_task, ao_igniter, "igniter");
 }
index 4ace415c23be7b3487f6bc9768c7a3b8b47e7bdd..d9ea1fc8c5c91e475b3d511aa71697ac64027a6e 100644 (file)
@@ -28,8 +28,13 @@ ao_set_monitor(uint8_t monitoring)
 void
 main(void)
 {
-       ao_clock_init();
+       /*
+        * Reduce the transient on the ignite pins at startup by
+        * pulling the pins low as soon as possible at power up
+        */
+       ao_ignite_set_pins();
 
+       ao_clock_init();
 
        /* Turn on the red LED until the system is stable */
        ao_led_init(LEDS_AVAILABLE);