From 4e656078b6e5282370b294355da43a988c2a8dfc Mon Sep 17 00:00:00 2001 From: Raman Gopalan Date: Sun, 26 Nov 2023 15:47:06 +0530 Subject: [PATCH] soft_i2c: Loop iteration variable: Conform to C89 --- components/drivers/i2c/soft_i2c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/drivers/i2c/soft_i2c.c b/components/drivers/i2c/soft_i2c.c index 7c3bd1e93a..54c7395121 100644 --- a/components/drivers/i2c/soft_i2c.c +++ b/components/drivers/i2c/soft_i2c.c @@ -221,8 +221,9 @@ int rt_soft_i2c_init(void) { int err = RT_EOK; struct rt_soft_i2c *obj; + int i; - for(int i = 0; i < sizeof(i2c_bus_obj) / sizeof(i2c_bus_obj[0]); i++) + for(i = 0; i < sizeof(i2c_bus_obj) / sizeof(i2c_bus_obj[0]); i++) { struct soft_i2c_config *cfg = &i2c_cfg[i];