#if PYRO_DBG
int pyro_dbg;
-#define DBG(...) do { if (pyro_dbg) printf("\t%d: ", (int) (pyro - ao_config.pyro)); printf(__VA_ARGS__); } while (0)
+#define DBG(...) do { if (pyro_dbg) { printf("\t%d: ", (int) (pyro - ao_config.pyro)); printf(__VA_ARGS__); } } while (0)
#else
#define DBG(...)
#endif
}
ao_delay(ao_config.pyro_time);
for (p = 0; p < AO_PYRO_NUM; p++) {
- if (fire & (1 << p)) {
+ if (fire & (1 << p))
ao_pyro_pin_set(p, 0);
- ao_config.pyro[p].fired = 1;
- ao_pyro_fired |= (1 << p);
- }
}
ao_delay(AO_MS_TO_TICKS(50));
}
/* Ignore igniters which have already fired
*/
- if (pyro->fired)
+ if (ao_pyro_fired & (1 << p))
continue;
/* Ignore disabled igniters
* by setting the fired bit
*/
if (!ao_pyro_ready(pyro)) {
- pyro->fired = 1;
+ ao_pyro_fired |= (1 << p);
continue;
}
fire |= (1 << p);
}
- if (fire)
+ if (fire) {
+ ao_pyro_fired |= fire;
ao_pyro_pins_fire(fire);
+ }
return any_waiting;
}
uint8_t state_less, state_greater_or_equal;
int16_t motor;
uint16_t delay_done;
- uint8_t fired;
+ uint8_t _unused; /* was 'fired' */
};
#define AO_PYRO_8_BIT_VALUE (ao_pyro_state_less|ao_pyro_state_greater_or_equal)