From f8bee2fefff3b50abbb73836700dd763998ec294 Mon Sep 17 00:00:00 2001 From: Bruce Luckcuck Date: Wed, 25 Apr 2018 11:12:46 -0400 Subject: [PATCH] Fix potential overflow in combined ESC sensor data The calculated combined ESC sensor data could potentially overflow in some extreme cases and the problem would be more likely in cases with more than 4 motors. --- src/main/sensors/esc_sensor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/sensors/esc_sensor.h b/src/main/sensors/esc_sensor.h index 3c38d8bde..12bd540d4 100644 --- a/src/main/sensors/esc_sensor.h +++ b/src/main/sensors/esc_sensor.h @@ -31,8 +31,8 @@ typedef struct { uint8_t dataAge; int8_t temperature; // C degrees int16_t voltage; // 0.01V - int16_t current; // 0.01A - int16_t consumption; // mAh + int32_t current; // 0.01A + int32_t consumption; // mAh int16_t rpm; // 0.01erpm } escSensorData_t;