AP_BLHeli: allow for negative temperatures from BLHeli32 ESCs

ESCs can send negative values
This commit is contained in:
Andrew Tridgell 2020-05-20 15:33:06 +10:00
parent 300a118852
commit cf0f95f81e
2 changed files with 2 additions and 2 deletions

View File

@ -1389,7 +1389,7 @@ void AP_BLHeli::read_telemetry_packet(void)
return;
}
struct telem_data td;
td.temperature = buf[0];
td.temperature = int8_t(buf[0]);
td.voltage = (buf[1]<<8) | buf[2];
td.current = (buf[3]<<8) | buf[4];
td.consumption = (buf[5]<<8) | buf[6];

View File

@ -46,7 +46,7 @@ public:
static const struct AP_Param::GroupInfo var_info[];
struct telem_data {
uint8_t temperature; // degrees C
int8_t temperature; // degrees C, negative values allowed
uint16_t voltage; // volts * 100
uint16_t current; // amps * 100
uint16_t consumption;// mAh