Bring back snprintf for ledstate
This commit is contained in:
parent
18bac7dcc7
commit
630943ec54
1 changed files with 2 additions and 0 deletions
|
@ -576,6 +576,7 @@ void saveLedState()
|
||||||
{
|
{
|
||||||
int pixelColor = pixels.getPixelColor(i);
|
int pixelColor = pixels.getPixelColor(i);
|
||||||
char key[12];
|
char key[12];
|
||||||
|
snprintf(key, 12, "%s%d", "ledColor_", i);
|
||||||
preferences.putUInt(key, pixelColor);
|
preferences.putUInt(key, pixelColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -587,6 +588,7 @@ void restoreLedState()
|
||||||
for (int i = 0; i < pixels.numPixels(); i++)
|
for (int i = 0; i < pixels.numPixels(); i++)
|
||||||
{
|
{
|
||||||
char key[12];
|
char key[12];
|
||||||
|
snprintf(key, 12, "%s%d", "ledColor_", i);
|
||||||
uint pixelColor = preferences.getUInt(key, pixels.Color(0, 0, 0));
|
uint pixelColor = preferences.getUInt(key, pixels.Color(0, 0, 0));
|
||||||
pixels.setPixelColor(i, pixelColor);
|
pixels.setPixelColor(i, pixelColor);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue