From b6bff185f3518ef49b03eb8a6adeafd197440fd3 Mon Sep 17 00:00:00 2001 From: Adriano Cunha <35786489+adrcunha@users.noreply.github.com> Date: Mon, 3 Apr 2023 08:53:13 -0700 Subject: [PATCH] Cleanup general definitions in MQUnifiedSensor.h ADC_RESOLUTION is unused, and retries and retry_interval are only used by getVoltage(). Thus, remove ADC_RESOLUTION and move retries and retry_interval to MQUnifiedsensor.cpp. Furthermore, these three definitions have generic names so it's easy to have them conflict with a user's sketch that imports MQUnifiedSensor.h. --- src/MQUnifiedsensor.cpp | 3 +++ src/MQUnifiedsensor.h | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/MQUnifiedsensor.cpp b/src/MQUnifiedsensor.cpp index 089bad9..10b31bb 100644 --- a/src/MQUnifiedsensor.cpp +++ b/src/MQUnifiedsensor.cpp @@ -1,5 +1,8 @@ #include "MQUnifiedsensor.h" +#define retries 2 +#define retry_interval 20 + MQUnifiedsensor::MQUnifiedsensor(String Placa, float Voltage_Resolution, int ADC_Bit_Resolution, int pin, String type) { this->_pin = pin; Placa.toCharArray(this->_placa, 20); diff --git a/src/MQUnifiedsensor.h b/src/MQUnifiedsensor.h index 6ed97b6..306e88e 100644 --- a/src/MQUnifiedsensor.h +++ b/src/MQUnifiedsensor.h @@ -6,10 +6,6 @@ /***********************Software Related Macros************************************/ -#define ADC_RESOLUTION 10 // for 10bit analog to digital converter. -#define retries 2 -#define retry_interval 20 - class MQUnifiedsensor { public: