change buffer log to first byte, probably safe to assume there will be atleast 1 byte in the buffer.

This commit is contained in:
Paul Dino Jones 2025-03-23 18:10:03 -04:00
parent 8c764358b7
commit 336d240be4
1 changed files with 5 additions and 5 deletions

View File

@ -167,7 +167,7 @@ int set_led_range_to_color(lua_State *L)
lua_gettable(L, LUA_REGISTRYINDEX); lua_gettable(L, LUA_REGISTRYINDEX);
char* bytes = lua_touserdata(L, -1); char* bytes = lua_touserdata(L, -1);
slogt("tenth byte of buff is x%02x", bytes[10]); slogt("first byte of buff is x%02x", bytes[0]);
uint8_t color0 = get_color_rgb_value(color, 0); uint8_t color0 = get_color_rgb_value(color, 0);
uint8_t color1 = get_color_rgb_value(color, 1); uint8_t color1 = get_color_rgb_value(color, 1);
@ -228,7 +228,7 @@ int set_led_range_to_rgb_color(lua_State *L)
lua_gettable(L, LUA_REGISTRYINDEX); lua_gettable(L, LUA_REGISTRYINDEX);
char* bytes = lua_touserdata(L, -1); char* bytes = lua_touserdata(L, -1);
slogt("tenth byte of buff is x%02x", bytes[10]); slogt("first byte of buff is x%02x", bytes[0]);
for( int i = range_start; i < range_end; i++) for( int i = range_start; i < range_end; i++)
{ {
@ -268,7 +268,7 @@ int set_led_to_color(lua_State *L)
lua_gettable(L, LUA_REGISTRYINDEX); lua_gettable(L, LUA_REGISTRYINDEX);
char* bytes = lua_touserdata(L, -1); char* bytes = lua_touserdata(L, -1);
slogt("tenth byte of buff is x%02x", bytes[10]); slogt("first byte of buff is x%02x", bytes[0]);
uint8_t color0 = get_color_rgb_value(color, 0); uint8_t color0 = get_color_rgb_value(color, 0);
uint8_t color1 = get_color_rgb_value(color, 1); uint8_t color1 = get_color_rgb_value(color, 1);
@ -316,7 +316,7 @@ int set_led_to_rgb_color(lua_State *L)
lua_gettable(L, LUA_REGISTRYINDEX); lua_gettable(L, LUA_REGISTRYINDEX);
char* bytes = lua_touserdata(L, -1); char* bytes = lua_touserdata(L, -1);
slogt("tenth byte of buff is x%02x", bytes[10]); slogt("first byte of buff is x%02x", bytes[0]);
bytes[(led * 3) + 0] = color0; bytes[(led * 3) + 0] = color0;
bytes[(led * 3) + 1] = color1; bytes[(led * 3) + 1] = color1;
@ -342,7 +342,7 @@ int led_clear_all(lua_State *L)
lua_gettable(L, LUA_REGISTRYINDEX); lua_gettable(L, LUA_REGISTRYINDEX);
char* bytes = lua_touserdata(L, -1); char* bytes = lua_touserdata(L, -1);
slogt("tenth byte of buff is x%02x", bytes[10]); slogt("first byte of buff is x%02x", bytes[0]);
for( int i = 0; i < numlights; i++) for( int i = 0; i < numlights; i++)
{ {