mirror of
https://github.com/btclock/btclock_v3.git
synced 2024-11-19 04:10:01 +01:00
Bring back snprintf for ledstate
This commit is contained in:
parent
18bac7dcc7
commit
630943ec54
@ -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 New Issue
Block a user