summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5d82209)
We already have the fired status saved in the ao_pyro_fired variable,
so just use that to detect whether a channel has already been fired.
Fixes possible cases where the pyro config data gets written back to
eeprom with the fired bit set, which then inhibits the channel during
flight.
Signed-off-by: Keith Packard <keithp@keithp.com>
#if PYRO_DBG
int pyro_dbg;
#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
#else
#define DBG(...)
#endif
}
ao_delay(ao_config.pyro_time);
for (p = 0; p < AO_PYRO_NUM; p++) {
}
ao_delay(ao_config.pyro_time);
for (p = 0; p < AO_PYRO_NUM; p++) {
- ao_config.pyro[p].fired = 1;
- ao_pyro_fired |= (1 << p);
- }
}
ao_delay(AO_MS_TO_TICKS(50));
}
}
ao_delay(AO_MS_TO_TICKS(50));
}
/* Ignore igniters which have already fired
*/
/* Ignore igniters which have already fired
*/
+ if (ao_pyro_fired & (1 << p))
continue;
/* Ignore disabled igniters
continue;
/* Ignore disabled igniters
* by setting the fired bit
*/
if (!ao_pyro_ready(pyro)) {
* by setting the fired bit
*/
if (!ao_pyro_ready(pyro)) {
+ ao_pyro_fired |= (1 << p);
+ if (fire) {
+ ao_pyro_fired |= fire;
uint8_t state_less, state_greater_or_equal;
int16_t motor;
uint16_t delay_done;
uint8_t state_less, state_greater_or_equal;
int16_t motor;
uint16_t delay_done;
+ uint8_t _unused; /* was 'fired' */
};
#define AO_PYRO_8_BIT_VALUE (ao_pyro_state_less|ao_pyro_state_greater_or_equal)
};
#define AO_PYRO_8_BIT_VALUE (ao_pyro_state_less|ao_pyro_state_greater_or_equal)