diff --git a/drivers/bme280/bme280.cpp b/drivers/bme280/bme280.cpp index 5091162a..1e7090ec 100644 --- a/drivers/bme280/bme280.cpp +++ b/drivers/bme280/bme280.cpp @@ -11,7 +11,10 @@ namespace pimoroni { gpio_pull_up(interrupt); } - device.intf_ptr = new i2c_intf_ptr{.i2c = i2c, .address = address}; + i2c_interface.i2c = i2c; + i2c_interface.address = address; + + device.intf_ptr = &i2c_interface; device.intf = bme280_intf::BME280_I2C_INTF; device.read = (bme280_read_fptr_t)&read_bytes; device.write = (bme280_write_fptr_t)&write_bytes; diff --git a/drivers/bme280/bme280.hpp b/drivers/bme280/bme280.hpp index cc255e54..706d87c3 100644 --- a/drivers/bme280/bme280.hpp +++ b/drivers/bme280/bme280.hpp @@ -26,6 +26,8 @@ namespace pimoroni { bool status; }; + i2c_intf_ptr i2c_interface; + bool debug = false; bool init();