mirror of
https://github.com/wled/WLED.git
synced 2025-07-18 16:26:32 +00:00
Some more optimisations.
This commit is contained in:
parent
86be5df475
commit
84dd26c1b7
@ -147,9 +147,7 @@ void appendGPIOinfo(Print& settingsScript) {
|
|||||||
settingsScript.print(F("];"));
|
settingsScript.print(F("];"));
|
||||||
|
|
||||||
// add info about max. # of pins
|
// add info about max. # of pins
|
||||||
settingsScript.print(F("d.max_gpio="));
|
settingsScript.printf_P(PSTR("d.max_gpio=%d;"),WLED_NUM_PINS);
|
||||||
settingsScript.print(WLED_NUM_PINS);
|
|
||||||
settingsScript.print(';');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//get values for settings form in javascript
|
//get values for settings form in javascript
|
||||||
@ -269,7 +267,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
|
|||||||
{
|
{
|
||||||
appendGPIOinfo(settingsScript);
|
appendGPIOinfo(settingsScript);
|
||||||
|
|
||||||
settingsScript.print(F("d.ledTypes=")); settingsScript.print(BusManager::getLEDTypesJSONString().c_str()); settingsScript.print(";");
|
settingsScript.printf_P(PSTR("d.ledTypes=%s;"), BusManager::getLEDTypesJSONString().c_str());
|
||||||
|
|
||||||
// set limits
|
// set limits
|
||||||
settingsScript.printf_P(PSTR("bLimits(%d,%d,%d,%d,%d,%d,%d,%d);"),
|
settingsScript.printf_P(PSTR("bLimits(%d,%d,%d,%d,%d,%d,%d,%d);"),
|
||||||
@ -653,8 +651,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
|
|||||||
{
|
{
|
||||||
printSetFormValue(settingsScript,PSTR("SOMP"),strip.isMatrix);
|
printSetFormValue(settingsScript,PSTR("SOMP"),strip.isMatrix);
|
||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
settingsScript.printf_P(PSTR("maxPanels=%d;"),WLED_MAX_PANELS);
|
settingsScript.printf_P(PSTR("maxPanels=%d;resetPanels();"),WLED_MAX_PANELS);
|
||||||
settingsScript.print(F("resetPanels();"));
|
|
||||||
if (strip.isMatrix) {
|
if (strip.isMatrix) {
|
||||||
if(strip.panels>0){
|
if(strip.panels>0){
|
||||||
printSetFormValue(settingsScript,PSTR("PW"),strip.panel[0].width); //Set generator Width and Height to first panel size for convenience
|
printSetFormValue(settingsScript,PSTR("PW"),strip.panel[0].width); //Set generator Width and Height to first panel size for convenience
|
||||||
@ -664,11 +661,9 @@ void getSettingsJS(byte subPage, Print& settingsScript)
|
|||||||
// panels
|
// panels
|
||||||
for (unsigned i=0; i<strip.panels; i++) {
|
for (unsigned i=0; i<strip.panels; i++) {
|
||||||
char n[5];
|
char n[5];
|
||||||
settingsScript.print(F("addPanel("));
|
settingsScript.printf_P(PSTR("addPanel(%d);"), itoa(i,n,10));
|
||||||
settingsScript.print(itoa(i,n,10));
|
|
||||||
settingsScript.print(F(");"));
|
|
||||||
char pO[8] = { '\0' };
|
char pO[8] = { '\0' };
|
||||||
snprintf_P(pO, 7, PSTR("P%d"), i); // MAX_PANELS is 64 so pO will always only be 4 characters or less
|
snprintf_P(pO, 7, PSTR("P%d"), i); // WLED_MAX_PANELS is 18 so pO will always only be 4 characters or less
|
||||||
pO[7] = '\0';
|
pO[7] = '\0';
|
||||||
unsigned l = strlen(pO);
|
unsigned l = strlen(pO);
|
||||||
// create P0B, P1B, ..., P63B, etc for other PxxX
|
// create P0B, P1B, ..., P63B, etc for other PxxX
|
||||||
|
Loading…
x
Reference in New Issue
Block a user