From 0119d7a874e6d648f241f0978c6248f532df5c54 Mon Sep 17 00:00:00 2001 From: Luca Pescante Date: Mon, 15 May 2023 17:22:03 +0200 Subject: [PATCH] AP_BattMonitor_SMBus_Generic: style fixes --- .../AP_BattMonitor_SMBus_Generic.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_Generic.cpp b/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_Generic.cpp index 5391c6b823..2fe8927e2b 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_Generic.cpp +++ b/libraries/AP_BattMonitor/AP_BattMonitor_SMBus_Generic.cpp @@ -163,16 +163,10 @@ bool AP_BattMonitor_SMBus_Generic::read_specification_info() uint8_t version = (data & 0xF0) >> 4; // version less than 0011b (i.e. 3) do not support PEC - if (version < 3) { - _pec_supported = false; - } - else { - _pec_supported = true; - } - + _pec_supported = version >= 3; + // extract and update voltage multiplier - switch ((data & 0xF00) >> 8) - { + switch ((data & 0xF00) >> 8) { case 1: _v_multiplier = 10; break; @@ -188,8 +182,7 @@ bool AP_BattMonitor_SMBus_Generic::read_specification_info() } // extract and update current multiplier - switch ((data & 0xF000) >> 12) - { + switch ((data & 0xF000) >> 12) { case 1: _i_multiplier = 10; break; @@ -208,5 +201,4 @@ bool AP_BattMonitor_SMBus_Generic::read_specification_info() return true; } - #endif // AP_BATTERY_SMBUS_GENERIC_ENABLED