From d83609b24c1d2682a8e7872a2594c9b56fa86967 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 14 Oct 2015 12:53:14 -0300 Subject: [PATCH] DataFlash: remove check for max BARO instances For all supported boards we allow more than 1 baro instance. --- libraries/DataFlash/LogFile.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/DataFlash/LogFile.cpp b/libraries/DataFlash/LogFile.cpp index a048299470..313930056e 100644 --- a/libraries/DataFlash/LogFile.cpp +++ b/libraries/DataFlash/LogFile.cpp @@ -831,7 +831,7 @@ void DataFlash_Class::Log_Write_Baro(AP_Baro &baro) climbrate : baro.get_climb_rate() }; WriteBlock(&pkt, sizeof(pkt)); -#if BARO_MAX_INSTANCES > 1 + if (baro.num_instances() > 1 && baro.healthy(1)) { struct log_BARO pkt2 = { LOG_PACKET_HEADER_INIT(LOG_BAR2_MSG), @@ -843,8 +843,7 @@ void DataFlash_Class::Log_Write_Baro(AP_Baro &baro) }; WriteBlock(&pkt2, sizeof(pkt2)); } -#endif -#if BARO_MAX_INSTANCES > 2 + if (baro.num_instances() > 2 && baro.healthy(2)) { struct log_BARO pkt3 = { LOG_PACKET_HEADER_INIT(LOG_BAR3_MSG), @@ -856,7 +855,6 @@ void DataFlash_Class::Log_Write_Baro(AP_Baro &baro) }; WriteBlock(&pkt3, sizeof(pkt3)); } -#endif } // Write an raw accel/gyro data packet