Skip to content

Commit 62cf432

Browse files
committed
fix(i2c): Simplify test
1 parent 8772e1d commit 62cf432

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tests/validation/i2c_master/i2c_master.ino

+1-5
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ void test_api() {
254254
}
255255

256256
bool device_found() {
257-
std::vector<uint8_t> found_addresses;
258257
uint8_t err;
259258

260259
for (uint8_t address = 1; address < 127; ++address) {
@@ -263,16 +262,13 @@ bool device_found() {
263262
log_d("Address: 0x%02X, Error: %d", address, err);
264263
if (err == 0) {
265264
log_i("Found device at address: 0x%02X", address);
266-
found_addresses.push_back(address);
267265
} else if (address == DS1307_ADDR) {
268266
log_e("Failed to find DS1307");
269267
return false;
270268
}
271269
}
272270

273-
// Find DS1307_ADDR in found_addresses
274-
auto it = std::find(found_addresses.begin(), found_addresses.end(), DS1307_ADDR);
275-
return it != found_addresses.end();
271+
return true;
276272
}
277273

278274
void scan_bus() {

0 commit comments

Comments
 (0)