diff --git a/examples/all/i2c_example.cc b/examples/all/i2c_example.cc index 1a79258..eb34033 100644 --- a/examples/all/i2c_example.cc +++ b/examples/all/i2c_example.cc @@ -33,6 +33,7 @@ static void read_temperature_sensor_value(Mmio i2c, else { Debug::log("Could not read the {}", regName); + return; } } @@ -52,6 +53,7 @@ static void id_eeprom_report(Mmio i2c, const uint8_t IdAddr) if (!i2c->blocking_read(IdAddr, data, sizeof(data))) { Debug::log("Failed to read EEPROM ID of device at address {}", IdAddr); + return; } Debug::log("EEPROM ID of device at address {}:", IdAddr); diff --git a/examples/all/proximity_sensor_example.cc b/examples/all/proximity_sensor_example.cc index a2d07fa..36d0d88 100644 --- a/examples/all/proximity_sensor_example.cc +++ b/examples/all/proximity_sensor_example.cc @@ -85,6 +85,7 @@ static void setup_proximity_sensor(Mmio i2c, const uint8_t Addr) if (!i2c->blocking_write(ApdS9960I2cAddress, buf, 2, true)) { Debug::log("Failed to write proximity sensor address"); + return; } }