add a telemetry startup delay

This commit is contained in:
Felix Ruess
2009-09-07 15:06:14 +00:00
parent 12ec3872a8
commit 043de78830
3 changed files with 27 additions and 21 deletions
+1
View File
@@ -207,6 +207,7 @@
#set GPS lag for horizontal filter #set GPS lag for horizontal filter
ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R
ap.CFLAGS += -DTELEMETRY_STARTUP_DELAY=3
</makefile> </makefile>
</airframe> </airframe>
+22 -21
View File
@@ -119,28 +119,29 @@ STATIC_INLINE void booz2_main_periodic( void ) {
booz2_autopilot_periodic(); booz2_autopilot_periodic();
/* set actuators */ /* set actuators */
actuators_set(booz2_autopilot_motors_on); actuators_set(booz2_autopilot_motors_on);
PeriodicPrescaleBy10( \ PeriodicPrescaleBy10( \
{ \ { \
radio_control_periodic(); \ radio_control_periodic(); \
if (radio_control.status != RADIO_CONTROL_OK && booz2_autopilot_mode != BOOZ2_AP_MODE_KILL)\ if (radio_control.status != RADIO_CONTROL_OK && booz2_autopilot_mode != BOOZ2_AP_MODE_KILL) \
booz2_autopilot_set_mode(BOOZ2_AP_MODE_FAILSAFE); \ booz2_autopilot_set_mode(BOOZ2_AP_MODE_FAILSAFE);\
}, \ }, \
{ \ { \
Booz2TelemetryPeriodic(); \ if (cpu_time_sec > TELEMETRY_STARTUP_DELAY) \
}, \ Booz2TelemetryPeriodic(); \
{ \ }, \
booz_fms_periodic(); \ { \
}, \ booz_fms_periodic(); \
{ \ }, \
/*BoozControlSurfacesSetFromCommands();*/ \ { \
}, \ /*BoozControlSurfacesSetFromCommands();*/ \
{}, \ }, \
{}, \ {}, \
{}, \ {}, \
{}, \ {}, \
{}, \ {}, \
{} \ {}, \
); \ {} \
); \
// t1 = T0TC; // t1 = T0TC;
// diff = t1 - t0; // diff = t1 - t0;
+4
View File
@@ -36,6 +36,10 @@
#include "actuators.h" #include "actuators.h"
#ifndef TELEMETRY_STARTUP_DELAY
#define TELEMETRY_STARTUP_DELAY 0
#endif
#define PERIODIC_SEND_ALIVE(_chan) DOWNLINK_SEND_ALIVE(_chan, 16, MD5SUM) #define PERIODIC_SEND_ALIVE(_chan) DOWNLINK_SEND_ALIVE(_chan, 16, MD5SUM)
#include "booz2_battery.h" #include "booz2_battery.h"