Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ws2812 4 channels for RGBW strips + diagnostic output #3637

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/lua/luac_cross/lflashimg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_size = curOffset*WORDSIZE;
printf("Image size: %d\n", fh->flash_size);
if (fh->flash_size>maxSize) {
fatal ("The image is too large for specfied LFS size");
}
Expand Down
4 changes: 2 additions & 2 deletions app/modules/ws2812.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int ws2812_write(lua_State* L) {
else if (type == LUA_TUSERDATA)
{
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;
length1 = pixbuf_size(buffer);
}
Expand All @@ -163,7 +163,7 @@ static int ws2812_write(lua_State* L) {
else if (type == LUA_TUSERDATA)
{
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;
length2 = pixbuf_size(buffer);
}
Expand Down
Loading