Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: increase i2c max burst
  • Loading branch information
facchinm committed Oct 20, 2025
commit 565ee430c03b9a8940873b1171f21f0263dd9b15
9 changes: 3 additions & 6 deletions src/BMI270.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int8_t BoschSensorClass::configure_sensor(struct bmm150_dev *dev)

int8_t BoschSensorClass::bmi2_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
if ((reg_data == NULL) || (len == 0) || (len > 32)) {
if ((reg_data == NULL) || (len == 0) || (len > 250)) {
return -1;
}
uint8_t bytes_received;
Expand All @@ -308,18 +308,15 @@ int8_t BoschSensorClass::bmi2_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint

int8_t BoschSensorClass::bmi2_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
if ((reg_data == NULL) || (len == 0) || (len > 32)) {
if ((reg_data == NULL) || (len == 0) || (len > 250)) {
return -1;
}

struct dev_info* dev_info = (struct dev_info*)intf_ptr;
uint8_t dev_id = dev_info->dev_addr;
dev_info->_wire->beginTransmission(dev_id);
dev_info->_wire->write(reg_addr);
for (uint16_t i = 0; i < len; i++)
{
dev_info->_wire->write(reg_data[i]);
}
dev_info->_wire->write(reg_data, (size_t)len);
if (dev_info->_wire->endTransmission() != 0) {
return -1;
}
Expand Down