Skip to content

Commit

Permalink
add ws2812 4 channels for RGBW strips + diagnostic output (#3637)
Browse files Browse the repository at this point in the history
  • Loading branch information
HHHartmann authored Feb 18, 2024
1 parent 68ffcfe commit 42ec384
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit 42ec384

Please sign in to comment.