Просмотр исходного кода

update: mlx90640.init拦截非法的i2c初始化参数

Wendal Chen 2 лет назад
Родитель
Сommit
706fb7c650
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      components/mlx90640-library/luat_lib_mlx90640.c

+ 4 - 0
components/mlx90640-library/luat_lib_mlx90640.c

@@ -126,6 +126,10 @@ static int l_mlx90640_init(lua_State *L){
 	}else if (lua_isuserdata(L, 1)){
         mlx90640_i2c.ei2c = toei2c(L);
     }
+    else {
+        LLOGE("bad i2c arg!!!");
+        return 0;
+    }
     mlx90640_refresh_rate = luaL_optinteger(L, 2 , FPS4HZ);
     lcd_conf = luat_lcd_get_default();