update i2c tools

This commit is contained in:
MX
2022-11-10 08:23:54 +03:00
parent 68219f0d7b
commit 3420cda83a
7 changed files with 36 additions and 29 deletions

View File

@@ -6,7 +6,7 @@ void scan_i2c_bus(i2cScanner* i2c_scanner) {
// Get the bus
furi_hal_i2c_acquire(I2C_BUS);
// scan
for(uint8_t addr = 0x01; addr < MAX_I2C_ADDR; addr++) {
for(uint8_t addr = 0x01; addr <= MAX_I2C_ADDR << 1; addr++) {
// Check for peripherals
if(furi_hal_i2c_is_device_ready(I2C_BUS, addr, I2C_TIMEOUT)) {
// skip even 8-bit addr