Skip to content

Commit

Permalink
ads1115 minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vsky authored and nwf committed Jun 17, 2020
1 parent 1f2e5bb commit 17504b6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/modules/ads1115.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,7 @@ static int ads1115_lua_register(lua_State *L, uint8_t chip_id) {
if (config_read != ADS1115_DEFAULT_CONFIG_REG) {
return luaL_error(L, "unexpected config value (%p) please reset device before calling this function", config_read);
}
ads_ctrl_ud_t *ads_ctrl = (ads_ctrl_ud_t *)lua_newuserdata(L, sizeof(ads_ctrl_ud_t));
if (NULL == ads_ctrl) {
return luaL_error(L, "ads1115 malloc: out of memory");
}
ads_ctrl_ud_t *ads_ctrl = lua_newuserdata(L, sizeof(ads_ctrl_ud_t));
luaL_getmetatable(L, metatable_name);
lua_setmetatable(L, -2);
ads_ctrl->chip_id = chip_id;
Expand Down

0 comments on commit 17504b6

Please sign in to comment.