Skip to content

Commit 913a27d

Browse files
committed
EnvironmentSensorManager: allow for INA3221 macro overrides
Allow for platformio.ini files to override the default values for the following INA3221 related macros: TELEM_INA3221_ADDRESS TELEM_INA3221_SHUNT_VALUE TELEM_INA3221_NUM_CHANNELS Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent 467959c commit 913a27d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/helpers/sensors/EnvironmentSensorManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,15 @@ LPS22HBClass LPS22HB(*TELEM_WIRE);
6262
#endif
6363

6464
#if ENV_INCLUDE_INA3221
65+
#ifndef TELEM_INA3221_ADDRESS
6566
#define TELEM_INA3221_ADDRESS 0x42 // INA3221 3 channel current sensor I2C address
67+
#endif
68+
#ifndef TELEM_INA3221_SHUNT_VALUE
6669
#define TELEM_INA3221_SHUNT_VALUE 0.100 // most variants will have a 0.1 ohm shunts
70+
#endif
71+
#ifndef TELEM_INA3221_NUM_CHANNELS
6772
#define TELEM_INA3221_NUM_CHANNELS 3
73+
#endif
6874
#include <Adafruit_INA3221.h>
6975
static Adafruit_INA3221 INA3221;
7076
#endif

0 commit comments

Comments
 (0)