From 84b6ab0707e948ea35f8373e7a8449cf3aff9fc3 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 23 Jul 2015 18:14:35 +0900 Subject: [PATCH] BattMon_Bebop: use ARRAY_SIZE Also remove printf of failure message, instead we should add the battery monitor health to the SYS_STATUS message sent to the ground station --- libraries/AP_BattMonitor/AP_BattMonitor_Bebop.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_Bebop.cpp b/libraries/AP_BattMonitor/AP_BattMonitor_Bebop.cpp index 9d183751ca..a65ac5dcb2 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_Bebop.cpp +++ b/libraries/AP_BattMonitor/AP_BattMonitor_Bebop.cpp @@ -25,7 +25,6 @@ extern const AP_HAL::HAL& hal; -#define SIZEOF_ARRAY(x) (sizeof((x)[0])/sizeof((x))) #define BATTERY_CAPACITY (1200U) /* mAh */ #define BATTERY_VOLTAGE_COMPENSATION_LANDED (0.2f) @@ -105,7 +104,7 @@ float AP_BattMonitor_Bebop::_compute_compensation(const uint16_t *rpm, vbat = vbat_raw; for (i = 0; i < BEBOP_BLDC_MOTORS_NUM; i++) { res = 0; - for (j = 0; j < SIZEOF_ARRAY(bat_comp_polynomial_coeffs); j++) + for (j = 0; j < ARRAY_SIZE(bat_comp_polynomial_coeffs); j++) res = res * rpm[i] + bat_comp_polynomial_coeffs[j]; vbat -= res; @@ -151,7 +150,6 @@ void AP_BattMonitor_Bebop::read(void) ret = rcout->read_obs_data(data); if (ret < 0) { _state.healthy = false; - hal.console->printf("read_obs_data failed %d\n", ret); return; }