projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Provide direct segment driving interface for LCD displays
[fw/altos]
/
src
/
drivers
/
ao_pad.c
diff --git
a/src/drivers/ao_pad.c
b/src/drivers/ao_pad.c
index 3ad239cced3e3c62f07545ba51277982668face2..419ea8d34c58e4b5a5281e80f1aff0b4e883eeff 100644
(file)
--- a/
src/drivers/ao_pad.c
+++ b/
src/drivers/ao_pad.c
@@
-127,6
+127,8
@@
ao_pad_monitor(void)
#define VOLTS_TO_PYRO(x) ((int16_t) ((x) * 27.0 / 127.0 / 3.3 * 32767.0))
#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;
cur = 0;
if (pyro > VOLTS_TO_PYRO(10)) {
query.arm_status = AO_PAD_ARM_STATUS_ARMED;
@@
-286,8
+288,7
@@
ao_pad(void)
PRINTD ("armed\n");
ao_pad_armed = command.channels;
ao_pad_arm_time = ao_time();
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) {
case AO_LAUNCH_QUERY:
if (command.box != ao_pad_box) {
@@
-318,13
+319,6
@@
ao_pad(void)
ao_pad_arm_time, ao_time());
break;
}
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();
PRINTD ("ignite\n");
ao_pad_ignite = ao_pad_armed;
ao_pad_arm_time = ao_time();