formatting fixes and rename one of ADC channels.
This commit is contained in:
parent
a0fce3c449
commit
d7c77c3fe2
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue