ghst: fix warning generated on PR (Clang Tidy)

Fix warning generated on PR (Clang Tidy).
This commit is contained in:
jciberlin 2021-03-14 15:05:50 +01:00 committed by Lorenz Meier
parent 6f5efbeab5
commit 01c9a4f24d

View File

@ -371,7 +371,6 @@ static inline void write_frame_crc(uint8_t *buf, int &offset, int buf_size)
bool ghst_send_telemetry_battery_status(int uart_fd, uint16_t voltage_in_10mV,
uint16_t current_in_10mA, uint16_t fuel_in_10mAh)
{
bool success;
uint8_t buf[GHST_FRAME_PAYLOAD_SIZE_TELEMETRY + 4U]; // address, frame length, type, crc
int offset = 0;
write_frame_header(buf, offset, ghstTelemetryType::batteryPack, GHST_FRAME_PAYLOAD_SIZE_TELEMETRY);
@ -384,12 +383,5 @@ bool ghst_send_telemetry_battery_status(int uart_fd, uint16_t voltage_in_10mV,
write_uint8_t(buf, offset, 0x00U); // empty
write_frame_crc(buf, offset, sizeof(buf));
if (write(uart_fd, buf, offset) == offset) {
success = true;
} else {
success = false;
}
return success;
return write(uart_fd, buf, offset) == offset;
}