Skip to content

Commit

Permalink
use enum from INA219_WE library
Browse files Browse the repository at this point in the history
  • Loading branch information
KrX3D authored Jan 28, 2025
1 parent d6f22d6 commit 6120912
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions usermods/INA219/usermod_ina219.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class UsermodINA219 : public Usermod {
#ifdef INA219_CONVERSION_TIME
INA219_ADC_MODE conversionTime = static_cast<INA219_ADC_MODE>(INA219_CONVERSION_TIME); // Cast from int if defined
#else
INA219_ADC_MODE conversionTime = BIT_MODE_12; // Default 12-bit resolution
INA219_ADC_MODE conversionTime = static_cast<INA219_ADC_MODE>(BIT_MODE_12); // Default 12-bit resolution
#endif

// Decimal factor for current/power readings
Expand Down Expand Up @@ -176,21 +176,6 @@ class UsermodINA219 : public Usermod {
_ina219 = nullptr;
}

// ADC mode enumeration
enum class ADCMode {
BIT_MODE_9 = 0,
BIT_MODE_10 = 1,
BIT_MODE_11 = 2,
BIT_MODE_12 = 3,
SAMPLE_MODE_2 = 9,
SAMPLE_MODE_4 = 10,
SAMPLE_MODE_8 = 11,
SAMPLE_MODE_16 = 12,
SAMPLE_MODE_32 = 13,
SAMPLE_MODE_64 = 14,
SAMPLE_MODE_128 = 15
};

// Setup function called once on boot or restart
void setup() override {
updateINA219Settings(); // Configure INA219 settings
Expand Down

0 comments on commit 6120912

Please sign in to comment.