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
75488639
Commit
75488639
authored
Oct 19, 2015
by
devsaurus
Browse files
make spi.send() transparent for 32 bit data
accept negative values as u32
parent
20881d27
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/spi.c
View file @
75488639
...
@@ -71,8 +71,6 @@ static int spi_send( lua_State *L )
...
@@ -71,8 +71,6 @@ static int spi_send( lua_State *L )
if
(
lua_type
(
L
,
argn
)
==
LUA_TNUMBER
)
if
(
lua_type
(
L
,
argn
)
==
LUA_TNUMBER
)
{
{
numdata
=
(
int
)
luaL_checkinteger
(
L
,
argn
);
numdata
=
(
int
)
luaL_checkinteger
(
L
,
argn
);
if
(
numdata
<
0
)
return
luaL_error
(
L
,
"wrong arg range"
);
platform_spi_send
(
id
,
spi_databits
[
id
],
numdata
);
platform_spi_send
(
id
,
spi_databits
[
id
],
numdata
);
wrote
++
;
wrote
++
;
}
}
...
@@ -84,8 +82,6 @@ static int spi_send( lua_State *L )
...
@@ -84,8 +82,6 @@ static int spi_send( lua_State *L )
lua_rawgeti
(
L
,
argn
,
i
+
1
);
lua_rawgeti
(
L
,
argn
,
i
+
1
);
numdata
=
(
int
)
luaL_checkinteger
(
L
,
-
1
);
numdata
=
(
int
)
luaL_checkinteger
(
L
,
-
1
);
lua_pop
(
L
,
1
);
lua_pop
(
L
,
1
);
if
(
numdata
<
0
)
return
luaL_error
(
L
,
"wrong arg range"
);
platform_spi_send
(
id
,
spi_databits
[
id
],
numdata
);
platform_spi_send
(
id
,
spi_databits
[
id
],
numdata
);
}
}
wrote
+=
i
;
wrote
+=
i
;
...
...
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