Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
17504b6e
Commit
17504b6e
authored
May 16, 2020
by
vsky
Committed by
Nathaniel Wesley Filardo
Jun 17, 2020
Browse files
ads1115 minor cleanup
parent
1f2e5bba
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/ads1115.c
View file @
17504b6e
...
@@ -251,10 +251,7 @@ static int ads1115_lua_register(lua_State *L, uint8_t chip_id) {
...
@@ -251,10 +251,7 @@ static int ads1115_lua_register(lua_State *L, uint8_t chip_id) {
if
(
config_read
!=
ADS1115_DEFAULT_CONFIG_REG
)
{
if
(
config_read
!=
ADS1115_DEFAULT_CONFIG_REG
)
{
return
luaL_error
(
L
,
"unexpected config value (%p) please reset device before calling this function"
,
config_read
);
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
));
ads_ctrl_ud_t
*
ads_ctrl
=
lua_newuserdata
(
L
,
sizeof
(
ads_ctrl_ud_t
));
if
(
NULL
==
ads_ctrl
)
{
return
luaL_error
(
L
,
"ads1115 malloc: out of memory"
);
}
luaL_getmetatable
(
L
,
metatable_name
);
luaL_getmetatable
(
L
,
metatable_name
);
lua_setmetatable
(
L
,
-
2
);
lua_setmetatable
(
L
,
-
2
);
ads_ctrl
->
chip_id
=
chip_id
;
ads_ctrl
->
chip_id
=
chip_id
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment