fix downlink, only send ahrs_timeout_counter if imu is used as well as ahrs

This commit is contained in:
Felix Ruess
2011-10-04 21:02:23 +02:00
parent 622bc0da8e
commit 10c6c9e137
+1 -1
View File
@@ -95,7 +95,7 @@
#ifdef USE_INFRARED
#define PERIODIC_SEND_STATE_FILTER_STATUS(_chan) { uint16_t contrast = abs(infrared.roll) + abs(infrared.pitch) + abs(infrared.top); uint8_t mde = 3; if (contrast < 50) mde = 7; DOWNLINK_SEND_STATE_FILTER_STATUS(_chan, &mde, &contrast); }
#elif defined USE_AHRS
#elif defined USE_IMU && defined USE_AHRS
#define PERIODIC_SEND_STATE_FILTER_STATUS(_chan) { uint8_t mde = 3; if (ahrs.status == AHRS_UNINIT) mde = 2; if (ahrs_timeout_counter > 10) mde = 5; uint16_t val = 0; DOWNLINK_SEND_STATE_FILTER_STATUS(_chan, &mde, &val); }
#else
#define PERIODIC_SEND_STATE_FILTER_STATUS(_chan) {}