#define VOLTS_TO_PYRO(x) ((int16_t) ((x) * 27.0 / 127.0 / 3.3 * 32767.0))
+ /* convert ADC value to voltage in tenths, then add .2 for the diode drop */
+ query.battery = (packet->adc.batt + 96) / 192 + 2;
cur = 0;
if (pyro > VOLTS_TO_PYRO(10)) {
query.arm_status = AO_PAD_ARM_STATUS_ARMED;
PRINTD ("armed\n");
ao_pad_armed = command.channels;
ao_pad_arm_time = ao_time();
-
- /* fall through ... */
+ break;
case AO_LAUNCH_QUERY:
if (command.box != ao_pad_box) {
ao_pad_arm_time, ao_time());
break;
}
- time_difference = command.tick - ao_time();
- if (time_difference < 0)
- time_difference = -time_difference;
- if (time_difference > 10) {
- PRINTD ("time different too large %d\n", time_difference);
- break;
- }
PRINTD ("ignite\n");
ao_pad_ignite = ao_pad_armed;
ao_pad_arm_time = ao_time();