fix batt_smbus build error

fix `error: variable-sized object ‘lifetime_block_one’ may not be initialized`
This commit is contained in:
SalimTerryLi
2020-02-03 11:28:06 +08:00
committed by Beat Küng
parent 86eff44a5e
commit 20ad3a0ded
+1 -1
View File
@@ -543,7 +543,7 @@ int BATT_SMBUS::lifetime_data_flush()
int BATT_SMBUS::lifetime_read_block_one() 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] = {}; uint8_t lifetime_block_one[buffer_size] = {};
if (PX4_OK != manufacturer_read(BATT_SMBUS_LIFETIME_BLOCK_ONE, lifetime_block_one, buffer_size)) { if (PX4_OK != manufacturer_read(BATT_SMBUS_LIFETIME_BLOCK_ONE, lifetime_block_one, buffer_size)) {