Skip to content

Commit

Permalink
Fix MSP_VOLTAGE_METERS and MSP_CURRENT_METERS (#5547)
Browse files Browse the repository at this point in the history
Only sustract the unused voltage/current meters from ESC when
USE_ESC_SENSOR is defined
  • Loading branch information
McGiverGim authored and mikeller committed Mar 27, 2018
1 parent 50962be commit 56fb46a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/interface/msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
case MSP_VOLTAGE_METERS: {
// write out id and voltage meter values, once for each meter we support
uint8_t count = supportedVoltageMeterCount;
#ifndef USE_OSD_SLAVE
count = supportedVoltageMeterCount - (VOLTAGE_METER_ID_ESC_COUNT - getMotorCount());
#if !defined(USE_OSD_SLAVE) && defined(USE_ESC_SENSOR)
count -= VOLTAGE_METER_ID_ESC_COUNT - getMotorCount();
#endif

for (int i = 0; i < count; i++) {
Expand All @@ -515,8 +515,8 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
case MSP_CURRENT_METERS: {
// write out id and current meter values, once for each meter we support
uint8_t count = supportedCurrentMeterCount;
#ifndef USE_OSD_SLAVE
count = supportedCurrentMeterCount - (VOLTAGE_METER_ID_ESC_COUNT - getMotorCount());
#if !defined(USE_OSD_SLAVE) && defined(USE_ESC_SENSOR)
count -= VOLTAGE_METER_ID_ESC_COUNT - getMotorCount();
#endif
for (int i = 0; i < count; i++) {

Expand Down

0 comments on commit 56fb46a

Please sign in to comment.