From d7c77c3fe2e07b8d357d7b967ab9a599767c5eee Mon Sep 17 00:00:00 2001 From: dongie Date: Fri, 30 May 2014 19:28:46 +0900 Subject: [PATCH] formatting fixes and rename one of ADC channels. --- src/drv_adc.c | 4 ++-- src/drv_adc.h | 2 +- src/serial.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/drv_adc.c b/src/drv_adc.c index 965522c77..0da40a908 100755 --- a/src/drv_adc.c +++ b/src/drv_adc.c @@ -27,8 +27,8 @@ void adcInit(drv_adc_config_t *init) // optional ADC5 input on rev.5 hardware if (hse_value == 12000000) { numChannels++; - adcConfig[ADC_EXTERNAL1].adcChannel = ADC_Channel_5; - adcConfig[ADC_EXTERNAL1].dmaIndex = numChannels - 1; + adcConfig[ADC_EXTERNAL_PAD].adcChannel = ADC_Channel_5; + adcConfig[ADC_EXTERNAL_PAD].dmaIndex = numChannels - 1; } // another channel can be stolen from PWM for current measurement or other things if (init->powerAdcChannel > 0) { diff --git a/src/drv_adc.h b/src/drv_adc.h index 1f09b2e79..123021690 100755 --- a/src/drv_adc.h +++ b/src/drv_adc.h @@ -2,7 +2,7 @@ typedef enum { ADC_BATTERY = 0, - ADC_EXTERNAL1 = 1, + ADC_EXTERNAL_PAD = 1, ADC_EXTERNAL_CURRENT = 2, ADC_CHANNEL_MAX = 3 } AdcChannel; diff --git a/src/serial.c b/src/serial.c index 99ba54495..992a24c66 100755 --- a/src/serial.c +++ b/src/serial.c @@ -474,9 +474,9 @@ static void evaluateCommand(void) serialize8((uint8_t)constrain(vbat, 0, 255)); serialize16(mAhdrawn); // milliamphours drawn from battery serialize16(rssi); - if(mcfg.multiwiicurrentoutput) { - serialize16((uint16_t)constrain((abs(amperage)*10), 0, 0xFFFF)); // send amperage in 0.001 A steps - } else + if (mcfg.multiwiicurrentoutput) + serialize16((uint16_t)constrain((abs(amperage) * 10), 0, 0xFFFF)); // send amperage in 0.001 A steps + else serialize16((uint16_t)abs(amperage)); // send amperage in 0.01 A steps break; case MSP_RC_TUNING: