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
|
// optional ADC5 input on rev.5 hardware
|
||||||
if (hse_value == 12000000) {
|
if (hse_value == 12000000) {
|
||||||
numChannels++;
|
numChannels++;
|
||||||
adcConfig[ADC_EXTERNAL1].adcChannel = ADC_Channel_5;
|
adcConfig[ADC_EXTERNAL_PAD].adcChannel = ADC_Channel_5;
|
||||||
adcConfig[ADC_EXTERNAL1].dmaIndex = numChannels - 1;
|
adcConfig[ADC_EXTERNAL_PAD].dmaIndex = numChannels - 1;
|
||||||
}
|
}
|
||||||
// another channel can be stolen from PWM for current measurement or other things
|
// another channel can be stolen from PWM for current measurement or other things
|
||||||
if (init->powerAdcChannel > 0) {
|
if (init->powerAdcChannel > 0) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ADC_BATTERY = 0,
|
ADC_BATTERY = 0,
|
||||||
ADC_EXTERNAL1 = 1,
|
ADC_EXTERNAL_PAD = 1,
|
||||||
ADC_EXTERNAL_CURRENT = 2,
|
ADC_EXTERNAL_CURRENT = 2,
|
||||||
ADC_CHANNEL_MAX = 3
|
ADC_CHANNEL_MAX = 3
|
||||||
} AdcChannel;
|
} AdcChannel;
|
||||||
|
|
|
@ -474,9 +474,9 @@ static void evaluateCommand(void)
|
||||||
serialize8((uint8_t)constrain(vbat, 0, 255));
|
serialize8((uint8_t)constrain(vbat, 0, 255));
|
||||||
serialize16(mAhdrawn); // milliamphours drawn from battery
|
serialize16(mAhdrawn); // milliamphours drawn from battery
|
||||||
serialize16(rssi);
|
serialize16(rssi);
|
||||||
if(mcfg.multiwiicurrentoutput) {
|
if (mcfg.multiwiicurrentoutput)
|
||||||
serialize16((uint16_t)constrain((abs(amperage) * 10), 0, 0xFFFF)); // send amperage in 0.001 A steps
|
serialize16((uint16_t)constrain((abs(amperage) * 10), 0, 0xFFFF)); // send amperage in 0.001 A steps
|
||||||
} else
|
else
|
||||||
serialize16((uint16_t)abs(amperage)); // send amperage in 0.01 A steps
|
serialize16((uint16_t)abs(amperage)); // send amperage in 0.01 A steps
|
||||||
break;
|
break;
|
||||||
case MSP_RC_TUNING:
|
case MSP_RC_TUNING:
|
||||||
|
|
Loading…
Reference in New Issue