This makes the first altitude report time consistently 10 seconds
after launch, instead of some random time depending on when the rocket
launched relative to the time the device connection was made.
Signed-off-by: Keith Packard <keithp@keithp.com>
class IdleThread extends Thread {
+ boolean started;
private AltosState state;
int reported_landing;
public void notice(AltosState new_state) {
AltosState old_state = state;
state = new_state;
+ if (!started && state.state > Altos.ao_flight_pad) {
+ started = true;
+ start();
+ }
if (old_state != null && old_state.state != state.state)
report(false);
}
info_reset();
info_finish();
- idle_thread.start();
try {
for (;;) {
try {