From 40d35e9eaa764335cbac1f71134914df313ec1eb Mon Sep 17 00:00:00 2001 From: s-ol Date: Sun, 20 Nov 2022 16:08:00 +0100 Subject: [PATCH] Don't block in I2CTarget.request(-1) Partially reverts #6985 Closes #7241 --- shared-bindings/i2ctarget/I2CTarget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/i2ctarget/I2CTarget.c b/shared-bindings/i2ctarget/I2CTarget.c index 4dc5b775f4..17da952118 100644 --- a/shared-bindings/i2ctarget/I2CTarget.c +++ b/shared-bindings/i2ctarget/I2CTarget.c @@ -159,7 +159,7 @@ STATIC mp_obj_t i2ctarget_i2c_target_request(size_t n_args, const mp_obj_t *pos_ bool forever = false; uint64_t timeout_end = 0; - if (timeout_ms <= 0) { + if (timeout_ms == 0) { forever = true; } else if (timeout_ms > 0) { timeout_end = common_hal_time_monotonic_ms() + timeout_ms;