Refactor global pins settings using dropdowns and add to rotary_encoder
- replace rOption by xOption (extend option) to show default value (⎌) - Usermod rotary_encoder: add appendConfigData function and show help and default functions - Settings.htm: Move Usermods(pins) below the usermods Settings_um.htm - remove SDAPin etc - comment check(0,k) as not used anymore - add xOption - add generated global pin fields (using addField) in ldS - remove hard coded global pin fields set.cpp: set i2c_sda etc using new generated fields xml.cpp: set generated fields values using i2c_sda etc and show defaults
This commit is contained in:
@@ -865,6 +865,21 @@ public:
|
||||
DEBUG_PRINTLN(F("Rotary Encoder config saved."));
|
||||
}
|
||||
|
||||
//WLEDMM: add appendConfigData
|
||||
void appendConfigData()
|
||||
{
|
||||
oappend(SET_F("addInfo('Rotary-Encoder:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/Rotary-Encoder"\" type=\"button\">?</button>');")); // 0 is field type, 1 is actual field
|
||||
#ifdef ENCODER_DT_PIN
|
||||
oappend(SET_F("xOption('Rotary-Encoder:DT-pin',1,' ⎌',")); oappendi(ENCODER_DT_PIN); oappend(");");
|
||||
#endif
|
||||
#ifdef ENCODER_CLK_PIN
|
||||
oappend(SET_F("xOption('Rotary-Encoder:CLK-pin',1,' ⎌',")); oappendi(ENCODER_CLK_PIN); oappend(");");
|
||||
#endif
|
||||
#ifdef ENCODER_SW_PIN
|
||||
oappend(SET_F("xOption('Rotary-Encoder:SW-pin',1,' ⎌',")); oappendi(ENCODER_SW_PIN); oappend(");");
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* readFromConfig() is called before setup() to populate properties from values stored in cfg.json
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user