kopia lustrzana https://github.com/pimoroni/pimoroni-pico
BME68X: Avoid runtime memory allocation.
rodzic
59ae107982
commit
bcebccca1d
|
@ -11,8 +11,10 @@ namespace pimoroni {
|
||||||
gpio_pull_up(interrupt);
|
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 = bme68x_intf::BME68X_I2C_INTF;
|
device.intf = bme68x_intf::BME68X_I2C_INTF;
|
||||||
device.read = (bme68x_read_fptr_t)&read_bytes;
|
device.read = (bme68x_read_fptr_t)&read_bytes;
|
||||||
device.write = (bme68x_write_fptr_t)&write_bytes;
|
device.write = (bme68x_write_fptr_t)&write_bytes;
|
||||||
|
|
|
@ -18,6 +18,8 @@ namespace pimoroni {
|
||||||
int8_t address;
|
int8_t address;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
i2c_intf_ptr i2c_interface;
|
||||||
|
|
||||||
bool debug = true;
|
bool debug = true;
|
||||||
|
|
||||||
bool init();
|
bool init();
|
||||||
|
|
Ładowanie…
Reference in New Issue