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
42ec3844
Unverified
Commit
42ec3844
authored
Feb 18, 2024
by
Gregor Hartmann
Committed by
GitHub
Feb 18, 2024
Browse files
add ws2812 4 channels for RGBW strips + diagnostic output (#3637)
parent
68ffcfeb
Changes
2
Show whitespace changes
Inline
Side-by-side
app/lua/luac_cross/lflashimg.c
View file @
42ec3844
...
@@ -399,6 +399,7 @@ uint dumpToFlashImage (lua_State* L, const Proto *main, lua_Writer w,
...
@@ -399,6 +399,7 @@ uint dumpToFlashImage (lua_State* L, const Proto *main, lua_Writer w,
fh
->
flash_sig
=
FLASH_SIG
+
(
address
?
FLASH_SIG_ABSOLUTE
:
0
);
fh
->
flash_sig
=
FLASH_SIG
+
(
address
?
FLASH_SIG_ABSOLUTE
:
0
);
fh
->
flash_size
=
curOffset
*
WORDSIZE
;
fh
->
flash_size
=
curOffset
*
WORDSIZE
;
printf
(
"Image size: %d
\n
"
,
fh
->
flash_size
);
if
(
fh
->
flash_size
>
maxSize
)
{
if
(
fh
->
flash_size
>
maxSize
)
{
fatal
(
"The image is too large for specfied LFS size"
);
fatal
(
"The image is too large for specfied LFS size"
);
}
}
...
...
app/modules/ws2812.c
View file @
42ec3844
...
@@ -138,7 +138,7 @@ static int ws2812_write(lua_State* L) {
...
@@ -138,7 +138,7 @@ static int ws2812_write(lua_State* L) {
else
if
(
type
==
LUA_TUSERDATA
)
else
if
(
type
==
LUA_TUSERDATA
)
{
{
pixbuf
*
buffer
=
pixbuf_from_lua_arg
(
L
,
1
);
pixbuf
*
buffer
=
pixbuf_from_lua_arg
(
L
,
1
);
luaL_argcheck
(
L
,
pixbuf_channels
(
buffer
)
==
3
,
1
,
"Bad pixbuf format"
);
luaL_argcheck
(
L
,
pixbuf_channels
(
buffer
)
==
3
||
pixbuf_channels
(
buffer
)
==
4
,
1
,
"Bad pixbuf format"
);
buffer1
=
buffer
->
values
;
buffer1
=
buffer
->
values
;
length1
=
pixbuf_size
(
buffer
);
length1
=
pixbuf_size
(
buffer
);
}
}
...
@@ -163,7 +163,7 @@ static int ws2812_write(lua_State* L) {
...
@@ -163,7 +163,7 @@ static int ws2812_write(lua_State* L) {
else
if
(
type
==
LUA_TUSERDATA
)
else
if
(
type
==
LUA_TUSERDATA
)
{
{
pixbuf
*
buffer
=
pixbuf_from_lua_arg
(
L
,
2
);
pixbuf
*
buffer
=
pixbuf_from_lua_arg
(
L
,
2
);
luaL_argcheck
(
L
,
pixbuf_channels
(
buffer
)
==
3
,
2
,
"Bad pixbuf format"
);
luaL_argcheck
(
L
,
pixbuf_channels
(
buffer
)
==
3
||
pixbuf_channels
(
buffer
)
==
4
,
2
,
"Bad pixbuf format"
);
buffer2
=
buffer
->
values
;
buffer2
=
buffer
->
values
;
length2
=
pixbuf_size
(
buffer
);
length2
=
pixbuf_size
(
buffer
);
}
}
...
...
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