mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-17 03:07:35 +08:00
I should really compile before pushing, fixed a scoping error on int result
This commit is contained in:
@@ -117,18 +117,22 @@ int SMBus::block_write(const uint8_t cmd_code, void *data, uint8_t byte_count, b
|
||||
}
|
||||
|
||||
unsigned i = 0;
|
||||
int result = 0;
|
||||
|
||||
// If block_write fails, try up to 10 times.
|
||||
while (i < 10) {
|
||||
int result = transfer((uint8_t *)buf, byte_count + 2, nullptr, 0);
|
||||
result = transfer((uint8_t *)buf, byte_count + 2, nullptr, 0);
|
||||
|
||||
if (result != PX4_OK) {
|
||||
i++;
|
||||
|
||||
if (i == 10) {
|
||||
PX4_WARN("Block_write failed 10 times");
|
||||
result = -ENODATA;
|
||||
result = -EINVAL;
|
||||
}
|
||||
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user