_i2c_addr is just a variable with a typedef for an integer, but () is initializing it like a class. I don't know what the compiler would do with () on a variable, it's not an array index This caused runtime memory errors for me so it may be trying to access it as a class with an undefined pointer?
Should be:
INA3221(ina3221_addr_t addr) {i2c_addr=addr};
Constructor: INA3221(ina3221_addr_t addr) : _i2c_addr(addr){};
_i2c_addr is just a variable with a typedef for an integer, but () is initializing it like a class. I don't know what the compiler would do with () on a variable, it's not an array index This caused runtime memory errors for me so it may be trying to access it as a class with an undefined pointer?
Should be: INA3221(ina3221_addr_t addr) {i2c_addr=addr};