fix warnings (#2003)

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2020-12-03 06:27:27 -06:00 committed by GitHub
parent b2e26a2e2b
commit 4deb875204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -28,8 +28,8 @@ public:
bool isHwUsed(adc_channel_e hwChannel) const;
int size() const;
void init(void);
int conversionCount;
int errorsCount;
uint32_t conversionCount = 0;
uint32_t errorsCount = 0;
int getAdcValueByIndex(int internalIndex) const;
void invalidateSamplesCache();
@ -38,7 +38,7 @@ public:
int getAdcValueByHwChannel(adc_channel_e hwChannel) const;
adc_state values;
int channelCount;
size_t channelCount = 0;
private:
ADCConversionGroup* hwConfig;
/**

View File

@ -64,9 +64,6 @@ float getVoltage(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMET
AdcDevice::AdcDevice(ADCConversionGroup* hwConfig, adcsample_t *buf) {
this->hwConfig = hwConfig;
this->samples = buf;
channelCount = 0;
conversionCount = 0;
errorsCount = 0;
hwConfig->sqr1 = 0;
hwConfig->sqr2 = 0;
@ -342,7 +339,7 @@ void AdcDevice::init(void) {
}
bool AdcDevice::isHwUsed(adc_channel_e hwChannelIndex) const {
for (int i = 0; i < channelCount; i++) {
for (size_t i = 0; i < channelCount; i++) {
if (hardwareIndexByIndernalAdcIndex[i] == hwChannelIndex) {
return true;
}