From 7f622c7aabea26afbd497feb545ecfb11b3bcc56 Mon Sep 17 00:00:00 2001 From: SalimTerryLi Date: Mon, 3 Feb 2020 11:28:06 +0800 Subject: [PATCH] fix batt_smbus build error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix `error: variable-sized object ‘lifetime_block_one’ may not be initialized` --- src/drivers/batt_smbus/batt_smbus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/batt_smbus/batt_smbus.cpp b/src/drivers/batt_smbus/batt_smbus.cpp index 2a7bb972130d..626f6ab92088 100644 --- a/src/drivers/batt_smbus/batt_smbus.cpp +++ b/src/drivers/batt_smbus/batt_smbus.cpp @@ -543,7 +543,7 @@ int BATT_SMBUS::lifetime_data_flush() int BATT_SMBUS::lifetime_read_block_one() { - int buffer_size = 32 + 2; // 32 bytes of data and 2 bytes of address + const int buffer_size = 32 + 2; // 32 bytes of data and 2 bytes of address uint8_t lifetime_block_one[buffer_size] = {}; if (PX4_OK != manufacturer_read(BATT_SMBUS_LIFETIME_BLOCK_ONE, lifetime_block_one, buffer_size)) {