projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enable packet-based communcation to command processor
[fw/altos]
/
src
/
ao_flight.c
diff --git
a/src/ao_flight.c
b/src/ao_flight.c
index c0f5683047b4d5e3e37dd6d28d14bb9de71295e2..e91a5daa74c97cc77f03b6d3030657c6f061a45e 100644
(file)
--- a/
src/ao_flight.c
+++ b/
src/ao_flight.c
@@
-216,7
+216,7
@@
ao_flight(void)
ao_old_vel = ao_flight_vel;
ao_old_vel_tick = ao_flight_tick;
ao_old_vel = ao_flight_vel;
ao_old_vel_tick = ao_flight_tick;
- /* Go to
launch
pad state if the nose is pointing up */
+ /* Go to pad state if the nose is pointing up */
ao_config_get();
if (ao_flight_accel < ao_config.accel_zero_g - ACCEL_NOSE_UP) {
ao_config_get();
if (ao_flight_accel < ao_config.accel_zero_g - ACCEL_NOSE_UP) {
@@
-227,22
+227,23
@@
ao_flight(void)
/* Turn on telemetry system
*/
/* Turn on telemetry system
*/
+ ao_rdf_set(1);
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_PAD);
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_PAD);
- ao_flight_state = ao_flight_
launch
pad;
+ ao_flight_state = ao_flight_pad;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
} else {
ao_flight_state = ao_flight_idle;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
} else {
ao_flight_state = ao_flight_idle;
- /* Turn on
the Green LED
in idle mode
+ /* Turn on
packet system
in idle mode
*/
*/
- ao_
led_on(AO_LED_GREEN
);
+ ao_
packet_slave_start(
);
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
}
/* signal successful initialization by turning off the LED */
ao_led_off(AO_LED_RED);
break;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
}
/* signal successful initialization by turning off the LED */
ao_led_off(AO_LED_RED);
break;
- case ao_flight_
launch
pad:
+ case ao_flight_pad:
/* Trim velocity
*
/* Trim velocity
*
@@
-277,13
+278,16
@@
ao_flight(void)
/* Increase telemetry rate */
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_FLIGHT);
/* Increase telemetry rate */
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_FLIGHT);
+ /* disable RDF beacon */
+ ao_rdf_set(0);
+
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
break;
}
break;
case ao_flight_boost:
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
break;
}
break;
case ao_flight_boost:
- /* boost to
co
ast:
+ /* boost to
f
ast:
*
* accelerometer: start to fall at > 1/4 G
* OR
*
* accelerometer: start to fall at > 1/4 G
* OR
@@
-296,14
+300,14
@@
ao_flight(void)
if (ao_flight_accel > ao_ground_accel + (ACCEL_G >> 2) ||
(int16_t) (ao_flight_tick - ao_launch_tick) > BOOST_TICKS_MAX)
{
if (ao_flight_accel > ao_ground_accel + (ACCEL_G >> 2) ||
(int16_t) (ao_flight_tick - ao_launch_tick) > BOOST_TICKS_MAX)
{
- ao_flight_state = ao_flight_
co
ast;
+ ao_flight_state = ao_flight_
f
ast;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
break;
}
break;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
break;
}
break;
- case ao_flight_
co
ast:
+ case ao_flight_
f
ast:
- /*
coast to apogee detec
t:
+ /*
fast to coas
t:
*
* accelerometer: integrated velocity < 200 m/s
* OR
*
* accelerometer: integrated velocity < 200 m/s
* OR
@@
-325,13
+329,13
@@
ao_flight(void)
* apogee detect
*/
ao_min_vel = abs(ao_flight_vel);
* apogee detect
*/
ao_min_vel = abs(ao_flight_vel);
- ao_flight_state = ao_flight_
apogee
;
+ ao_flight_state = ao_flight_
coast
;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
}
break;
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
}
break;
- case ao_flight_
apogee
:
+ case ao_flight_
coast
:
- /* apogee detect to drogue deploy:
+ /* apogee detect
: coast
to drogue deploy:
*
* accelerometer: abs(velocity) > min_velocity + 2m/s
* OR
*
* accelerometer: abs(velocity) > min_velocity + 2m/s
* OR
@@
-438,6
+442,8
@@
ao_flight(void)
/* turn off the ADC capture */
ao_timer_set_adc_interval(0);
/* turn off the ADC capture */
ao_timer_set_adc_interval(0);
+ /* Enable RDF beacon */
+ ao_rdf_set(1);
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
}
ao_wakeup(DATA_TO_XDATA(&ao_flight_state));
}
@@
-452,7
+458,7
@@
ao_flight(void)
#define AO_VEL_COUNT_TO_MS(count) ((int16_t) ((count) / 2700))
static void
#define AO_VEL_COUNT_TO_MS(count) ((int16_t) ((count) / 2700))
static void
-ao_flight_status(void)
+ao_flight_status(void)
__reentrant
{
printf("STATE: %7s accel: %d speed: %d altitude: %d main: %d\n",
ao_state_names[ao_flight_state],
{
printf("STATE: %7s accel: %d speed: %d altitude: %d main: %d\n",
ao_state_names[ao_flight_state],