chore: fix build warnings from compiler-flagged always-true/dead-code issues (#7697)

Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Peter Feerick
2026-08-24 20:37:15 +10:00
committed by GitHub
co-authored by Peter Feerick Claude Sonnet 5
parent 5d69da66fe
commit a5ac9bf06b
6 changed files with 14 additions and 112 deletions
+12 -10
View File
@@ -2935,18 +2935,20 @@ static int luaSetRgbLedColor(lua_State * L)
uint8_t b = luaL_checkunsigned(L, 4);
#if CFS_LED_STRIP_LENGTH > 0
if (id >= BLING_LED_STRIP_LENGTH) {
id -= BLING_LED_STRIP_LENGTH;
uint8_t swIdx = switchGetSwitchFromCustomIdx(id / CFS_LEDS_PER_SWITCH);
if (g_model.getSwitchType(swIdx) == SWITCH_NONE) {
rgbSetLedColor(id + CFS_LED_STRIP_START, r, g, b);
} else {
lua_pushboolean(L, false);
return 1;
}
} else {
#if BLING_LED_STRIP_LENGTH > 0
if (id < BLING_LED_STRIP_LENGTH) {
rgbSetLedColor(id + BLING_LED_STRIP_START, r, g, b);
lua_pushboolean(L, true);
return 1;
}
id -= BLING_LED_STRIP_LENGTH;
#endif
uint8_t swIdx = switchGetSwitchFromCustomIdx(id / CFS_LEDS_PER_SWITCH);
if (g_model.getSwitchType(swIdx) != SWITCH_NONE) {
lua_pushboolean(L, false);
return 1;
}
rgbSetLedColor(id + CFS_LED_STRIP_START, r, g, b);
#else
rgbSetLedColor(id + BLING_LED_STRIP_START, r, g, b);
#endif