浏览代码

soft_i2c: Loop iteration variable: Conform to C89

Raman Gopalan 1 年之前
父节点
当前提交
4e656078b6
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      components/drivers/i2c/soft_i2c.c

+ 2 - 1
components/drivers/i2c/soft_i2c.c

@@ -221,8 +221,9 @@ int rt_soft_i2c_init(void)
 {
 {
     int err = RT_EOK;
     int err = RT_EOK;
     struct rt_soft_i2c *obj;
     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];
         struct soft_i2c_config *cfg = &i2c_cfg[i];