Fix adcdbug when one or more channels set to "none" (#477)
* gitignore atollic truestudio * Fix adcdebug when >= 1 ADC channel is set to none
This commit is contained in:
parent
b39e245a37
commit
d13b25eaa2
|
@ -527,17 +527,21 @@ static void printFullAdcReport(Logging *logger) {
|
||||||
appendMsgPrefix(logger);
|
appendMsgPrefix(logger);
|
||||||
|
|
||||||
adc_channel_e hwIndex = slowAdc.getAdcHardwareIndexByInternalIndex(index);
|
adc_channel_e hwIndex = slowAdc.getAdcHardwareIndexByInternalIndex(index);
|
||||||
ioportid_t port = getAdcChannelPort("print", hwIndex);
|
|
||||||
int pin = getAdcChannelPin(hwIndex);
|
|
||||||
|
|
||||||
int adcValue = slowAdc.getAdcValueByIndex(index);
|
if(hwIndex != EFI_ADC_NONE && hwIndex != EFI_ADC_ERROR)
|
||||||
appendPrintf(logger, " ch%d %s%d", index, portname(port), pin);
|
{
|
||||||
appendPrintf(logger, " ADC%d 12bit=%d", hwIndex, adcValue);
|
ioportid_t port = getAdcChannelPort("print", hwIndex);
|
||||||
float volts = adcToVolts(adcValue);
|
int pin = getAdcChannelPin(hwIndex);
|
||||||
appendPrintf(logger, " v=%f", volts);
|
|
||||||
|
|
||||||
appendMsgPostfix(logger);
|
int adcValue = slowAdc.getAdcValueByIndex(index);
|
||||||
scheduleLogging(logger);
|
appendPrintf(logger, " ch%d %s%d", index, portname(port), pin);
|
||||||
|
appendPrintf(logger, " ADC%d 12bit=%d", hwIndex, adcValue);
|
||||||
|
float volts = adcToVolts(adcValue);
|
||||||
|
appendPrintf(logger, " v=%f", volts);
|
||||||
|
|
||||||
|
appendMsgPostfix(logger);
|
||||||
|
scheduleLogging(logger);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue