altos: Silence radio while firing igniters
authorKeith Packard <keithp@keithp.com>
Sun, 4 Sep 2011 15:49:16 +0000 (08:49 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 4 Sep 2011 15:49:16 +0000 (08:49 -0700)
Hold the radio mutex while firing igniters to reduce potential
interactions between the two.

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

index 5238beb4315663950e717f98629168b05bc4a419..ac1d28e767e5a482e4910373e492914707758810 100644 (file)
@@ -90,6 +90,7 @@ ao_igniter_status(enum ao_igniter igniter)
 void
 ao_igniter_fire(enum ao_igniter igniter) __critical
 {
+       ao_mutex_get(&ao_radio_mutex);
        ao_ignition[igniter].firing = 1;
        switch(ao_config.ignite_mode) {
        case AO_IGNITE_MODE_DUAL:
@@ -134,6 +135,7 @@ ao_igniter_fire(enum ao_igniter igniter) __critical
                break;
        }
        ao_ignition[igniter].firing = 0;
+       ao_mutex_put(&ao_radio_mutex);
 }
 
 void