i2c_sda, i2c_scl, spi_mosi, spi_miso, spi_sclk without HW_PIN_*, bh1750
platformio: - add bh1750 to _max - define rotary defaults for wemos usermod_bh1750 - Remove HW_PIN_* and replace by i2c_sda etc - add appendConfigData usermods mpu6050_imu, rtc, 4ld, pinmanager - Remove HW_PIN_* change SDA2:pin (etc) to SDA:pin
This commit is contained in:
@@ -625,7 +625,7 @@ lib_deps_min =
|
||||
; monitor_filters = esp32_exception_decoder ; used to show crash details
|
||||
|
||||
build_flags_max =
|
||||
-D WLED_MAX_USERMODS=10 ; default only 4-6
|
||||
-D WLED_MAX_USERMODS=11 ; default only 4-6
|
||||
;; -D ARDUINO_USB_CDC_ON_BOOT=0 ; needed for arduino-esp32 >=2.0.4 ewowi to softhack: move to build_flags_min? - We need a different solution
|
||||
-D WLED_USE_MY_CONFIG ; include custom my_config.h ewowi to softhack: redundant as also in build_flags_min?
|
||||
-D USERMOD_DALLASTEMPERATURE
|
||||
@@ -638,11 +638,13 @@ build_flags_max =
|
||||
-D USERMOD_GAMES ; WLEDMM usermod
|
||||
-D USERMOD_BATTERY ;; enable Battery usermod
|
||||
-D USERMOD_BATTERY_USE_LIPO ;; use new "decharging curve" for LiPo cells
|
||||
-D USERMOD_BH1750
|
||||
|
||||
lib_deps_max =
|
||||
OneWire@~2.3.5 ; used for USERMOD_FOUR_LINE_DISPLAY and USERMOD_DALLASTEMPERATURE
|
||||
olikraus/U8g2 @ ^2.28.8 ; used for USERMOD_FOUR_LINE_DISPLAY
|
||||
ElectronicCats/MPU6050 @ 0.6.0 ; used for USERMOD_MPU6050_IMU
|
||||
claws/BH1750 @^1.2.0 ; used for USERMOD_BH1750
|
||||
|
||||
; end of common
|
||||
|
||||
@@ -963,8 +965,7 @@ build_flags = ${esp32_4MB_max_base.build_flags}
|
||||
-D TEMPERATURE_PIN=23
|
||||
-D FLD_PIN_SCL=22 -D FLD_PIN_SDA=21
|
||||
-D HW_PIN_SCL=22 -D HW_PIN_SDA=21
|
||||
; -D ENCODER_DT_PIN=18 -D ENCODER_CLK_PIN=5 -D ENCODER_SW_PIN=19
|
||||
-D ENCODER_DT_PIN=25 -D ENCODER_CLK_PIN=5 -D ENCODER_SW_PIN=26
|
||||
-D ENCODER_DT_PIN=35 -D ENCODER_CLK_PIN=5 -D ENCODER_SW_PIN=39 ;WLEDMM spec by @SERG74: use 35 and 39 instead of 18 and 19 (conflicts)
|
||||
; -D WLED_USE_MY_CONFIG
|
||||
|
||||
[env:wemos_shield_esp32_4MB_max]
|
||||
|
||||
@@ -414,7 +414,7 @@ class Animated_Staircase : public Usermod {
|
||||
}
|
||||
|
||||
void appendConfigData() {
|
||||
oappend(SET_F("addInfo('staircase:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/staircase"\" type=\"button\">?</button>');")); // 0 is field type, 1 is actual field
|
||||
oappend(SET_F("addInfo('staircase:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/staircase"\" type=\"button\">?</button>');"));
|
||||
|
||||
//oappend(SET_F("dd=addDropdown('staircase','selectfield');"));
|
||||
//oappend(SET_F("addOption(dd,'1st value',0);"));
|
||||
|
||||
@@ -55,17 +55,17 @@ private:
|
||||
static const char _HomeAssistantDiscovery[];
|
||||
|
||||
// set the default pins based on the architecture, these get overridden by Usermod menu settings
|
||||
#ifdef ARDUINO_ARCH_ESP32 // ESP32 boards -- WLEDMM: don't override already defined HW pins
|
||||
#ifndef HW_PIN_SDA
|
||||
#define HW_PIN_SCL 22
|
||||
#endif
|
||||
#ifndef HW_PIN_SDA
|
||||
#define HW_PIN_SDA 21
|
||||
#endif
|
||||
#else // ESP8266 boards
|
||||
#define HW_PIN_SCL 5
|
||||
#define HW_PIN_SDA 4
|
||||
#endif
|
||||
// #ifdef ARDUINO_ARCH_ESP32 // ESP32 boards -- WLEDMM: don't override already defined HW pins
|
||||
// #ifndef HW_PIN_SDA
|
||||
// #define HW_PIN_SCL 22
|
||||
// #endif
|
||||
// #ifndef HW_PIN_SDA
|
||||
// #define HW_PIN_SDA 21
|
||||
// #endif
|
||||
// #else // ESP8266 boards
|
||||
// #define HW_PIN_SCL 5
|
||||
// #define HW_PIN_SDA 4
|
||||
// #endif
|
||||
//int8_t ioPin[2] = {HW_PIN_SCL, HW_PIN_SDA}; // I2C pins: SCL, SDA...defaults to Arch hardware pins but overridden at setup()
|
||||
int8_t ioPin[2] = {-1, -1}; // WLEDMM - I2C pins: wait until hw pins get allocated
|
||||
bool initDone = false;
|
||||
@@ -126,7 +126,7 @@ private:
|
||||
public:
|
||||
void setup()
|
||||
{
|
||||
bool HW_Pins_Used = (ioPin[0]==HW_PIN_SCL && ioPin[1]==HW_PIN_SDA); // note whether architecture-based hardware SCL/SDA pins used
|
||||
bool HW_Pins_Used = (ioPin[0]==i2c_scl && ioPin[1]==i2c_sda); // note whether architecture-based hardware SCL/SDA pins used
|
||||
PinOwner po = PinOwner::UM_BH1750; // defaults to being pinowner for SCL/SDA pins
|
||||
if (HW_Pins_Used) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
|
||||
if ((i2c_scl >= 0) && (i2c_sda >=0)) { // WLEDMM: make sure that global HW pins are used if defined
|
||||
@@ -220,6 +220,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void appendConfigData() {
|
||||
oappend(SET_F("addInfo('BH1750:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/BH1750"\" type=\"button\">?</button>');"));
|
||||
oappend(SET_F("addInfo('BH1750:pin[]',1,'','I2C SDA');"));
|
||||
oappend(SET_F("rOption('BH1750:pin[]',1,'use global (")); oappendi(i2c_sda); oappend(")',-1);");
|
||||
oappend(SET_F("addInfo('BH1750:pin[]',0,'','I2C SCL');"));
|
||||
oappend(SET_F("rOption('BH1750:pin[]',0,'use global (")); oappendi(i2c_scl); oappend(")',-1);");
|
||||
}
|
||||
|
||||
// (called from set.cpp) stores persistent properties to cfg.json
|
||||
void addToConfig(JsonObject &root)
|
||||
{
|
||||
@@ -232,7 +240,7 @@ public:
|
||||
top[FPSTR(_offset)] = offset;
|
||||
JsonArray io_pin = top.createNestedArray(F("pin"));
|
||||
for (byte i=0; i<2; i++) io_pin.add(ioPin[i]);
|
||||
top[F("help4Pins")] = F("SCL,SDA"); // help for Settings page
|
||||
// top[F("help4Pins")] = F("SCL,SDA"); // help for Settings page
|
||||
|
||||
DEBUG_PRINTLN(F("BH1750 config saved."));
|
||||
}
|
||||
@@ -272,7 +280,7 @@ public:
|
||||
for (byte i=0; i<2; i++) if (ioPin[i] != newPin[i]) { pinsChanged = true; break; } // check if any pins changed
|
||||
if (pinsChanged) { //if pins changed, deallocate old pins and allocate new ones
|
||||
PinOwner po = PinOwner::UM_BH1750;
|
||||
if (ioPin[0]==HW_PIN_SCL && ioPin[1]==HW_PIN_SDA) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
|
||||
if (ioPin[0]==i2c_scl && ioPin[1]==i2c_sda) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
|
||||
pinManager.deallocateMultiplePins((const uint8_t *)ioPin, 2, po); // deallocate pins
|
||||
for (byte i=0; i<2; i++) ioPin[i] = newPin[i];
|
||||
setup();
|
||||
|
||||
@@ -414,7 +414,7 @@ public:
|
||||
|
||||
void appendConfigData()
|
||||
{
|
||||
oappend(SET_F("addInfo('PIRsensorSwitch:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/PIRsensorSwitch"\" type=\"button\">?</button>');")); // 0 is field type, 1 is actual field
|
||||
oappend(SET_F("addInfo('PIRsensorSwitch:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/PIRsensorSwitch"\" type=\"button\">?</button>');"));
|
||||
|
||||
oappend(SET_F("addInfo('PIRsensorSwitch:HA-discovery',1,'HA=Home Assistant');")); // 0 is field type, 1 is actual field
|
||||
oappend(SET_F("addInfo('PIRsensorSwitch:notifications',1,'Periodic WS updates');")); // 0 is field type, 1 is actual field
|
||||
|
||||
@@ -16,10 +16,6 @@ class RTCUsermod : public Usermod {
|
||||
|
||||
void setup() {
|
||||
PinManagerPinType pins[2] = { { i2c_scl, true }, { i2c_sda, true } };
|
||||
#if defined(ARDUINO_ARCH_ESP32) && defined(HW_PIN_SDA) && defined(HW_PIN_SCL)
|
||||
//if (pins[0].pin < 0) pins[0].pin = HW_PIN_SCL; //WLEDMM
|
||||
//if (pins[1].pin < 0) pins[1].pin = HW_PIN_SDA; //WLEDMM
|
||||
#endif
|
||||
if (pins[1].pin < 0 || pins[0].pin < 0) { disabled=true; return; } //WLEDMM bugfix - ensure that "final" GPIO are valid and no "-1" sneaks trough
|
||||
if (!pinManager.allocateMultiplePins(pins, 2, PinOwner::HW_I2C)) { disabled = true; return; }
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
|
||||
@@ -1968,7 +1968,7 @@ class AudioReactive : public Usermod {
|
||||
|
||||
void appendConfigData()
|
||||
{
|
||||
oappend(SET_F("addInfo('AudioReactive:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/soundreactive/Sound-Settings"\" type=\"button\">?</button>');")); // 0 is field type, 1 is actual field
|
||||
oappend(SET_F("addInfo('AudioReactive:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/soundreactive/Sound-Settings"\" type=\"button\">?</button>');"));
|
||||
|
||||
//WLEDMM: add defaults
|
||||
#ifdef AUDIOPIN
|
||||
|
||||
@@ -303,7 +303,7 @@ class BobLightUsermod : public Usermod {
|
||||
}
|
||||
|
||||
void appendConfigData() {
|
||||
oappend(SET_F("addInfo('BobLight:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/BobLight"\" type=\"button\">?</button>');")); // 0 is field type, 1 is actual field
|
||||
oappend(SET_F("addInfo('BobLight:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/BobLight"\" type=\"button\">?</button>');"));
|
||||
|
||||
//oappend(SET_F("dd=addDropdown('usermod','selectfield');"));
|
||||
//oappend(SET_F("addOption(dd,'1st value',0);"));
|
||||
|
||||
@@ -119,13 +119,8 @@ class MPU6050Driver : public Usermod {
|
||||
void setup() {
|
||||
// WLEDMM begin
|
||||
USER_PRINTLN(F("mpu setup"));
|
||||
#if 0 // WLEDMM: delay I2C pin alloc
|
||||
int8_t hw_scl = i2c_scl<0 ? HW_PIN_SCL : i2c_scl;
|
||||
int8_t hw_sda = i2c_sda<0 ? HW_PIN_SDA : i2c_sda;
|
||||
#else
|
||||
int8_t hw_scl = i2c_scl;
|
||||
int8_t hw_sda = i2c_sda;
|
||||
#endif
|
||||
|
||||
PinManagerPinType pins[2] = { { hw_scl, true }, { hw_sda, true } };
|
||||
if ((hw_scl < 0) || (hw_sda < 0)) {
|
||||
|
||||
@@ -321,8 +321,8 @@ class FourLineDisplayUsermod : public Usermod {
|
||||
bool isHW, isSPI = (type == SSD1306_SPI || type == SSD1306_SPI64);
|
||||
PinOwner po = PinOwner::UM_FourLineDisplay;
|
||||
if (isSPI) {
|
||||
int8_t hw_sclk = spi_sclk<0 ? HW_PIN_CLOCKSPI : spi_sclk;
|
||||
int8_t hw_mosi = spi_mosi<0 ? HW_PIN_DATASPI : spi_mosi;
|
||||
int8_t hw_sclk = spi_sclk;
|
||||
int8_t hw_mosi = spi_mosi;
|
||||
if (ioPin[0] < 0 || ioPin[1] < 0) {
|
||||
ioPin[0] = hw_sclk;
|
||||
ioPin[1] = hw_mosi;
|
||||
@@ -338,8 +338,8 @@ class FourLineDisplayUsermod : public Usermod {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
int8_t hw_scl = i2c_scl<0 ? HW_PIN_SCL : i2c_scl;
|
||||
int8_t hw_sda = i2c_sda<0 ? HW_PIN_SDA : i2c_sda;
|
||||
int8_t hw_scl = i2c_scl;
|
||||
int8_t hw_sda = i2c_sda;
|
||||
if (ioPin[0] < 0 || ioPin[1] < 0) {
|
||||
ioPin[0] = hw_scl;
|
||||
ioPin[1] = hw_sda;
|
||||
@@ -1036,7 +1036,7 @@ class FourLineDisplayUsermod : public Usermod {
|
||||
//}
|
||||
|
||||
void appendConfigData() {
|
||||
oappend(SET_F("addInfo('4LineDisplay:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/4LineDisplay"\" type=\"button\">?</button>');")); // 0 is field type, 1 is actual field
|
||||
oappend(SET_F("addInfo('4LineDisplay:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/4LineDisplay"\" type=\"button\">?</button>');"));
|
||||
|
||||
oappend(SET_F("dd=addDropdown('4LineDisplay','type');"));
|
||||
oappend(SET_F("addOption(dd,'None',0);"));
|
||||
@@ -1081,11 +1081,11 @@ class FourLineDisplayUsermod : public Usermod {
|
||||
// determine if we are using global HW pins (data & clock)
|
||||
int8_t hw_dta, hw_clk;
|
||||
if ((type == SSD1306_SPI || type == SSD1306_SPI64)) {
|
||||
hw_clk = spi_sclk<0 ? HW_PIN_CLOCKSPI : spi_sclk;
|
||||
hw_dta = spi_mosi<0 ? HW_PIN_DATASPI : spi_mosi;
|
||||
hw_clk = spi_sclk;
|
||||
hw_dta = spi_mosi;
|
||||
} else {
|
||||
hw_clk = i2c_scl<0 ? HW_PIN_SCL : i2c_scl;
|
||||
hw_dta = i2c_sda<0 ? HW_PIN_SDA : i2c_sda;
|
||||
hw_clk = i2c_scl;
|
||||
hw_dta = i2c_sda;
|
||||
}
|
||||
|
||||
JsonObject top = root.createNestedObject(FPSTR(_name));
|
||||
@@ -1167,13 +1167,13 @@ class FourLineDisplayUsermod : public Usermod {
|
||||
bool isSPI = (type == SSD1306_SPI || type == SSD1306_SPI64);
|
||||
if (isSPI) {
|
||||
pinManager.deallocateMultiplePins((const uint8_t *)(&oldPin[2]), 3, po);
|
||||
uint8_t hw_sclk = spi_sclk<0 ? HW_PIN_CLOCKSPI : spi_sclk;
|
||||
uint8_t hw_mosi = spi_mosi<0 ? HW_PIN_DATASPI : spi_mosi;
|
||||
uint8_t hw_sclk = spi_sclk;
|
||||
uint8_t hw_mosi = spi_mosi;
|
||||
bool isHW = (oldPin[0]==hw_sclk && oldPin[1]==hw_mosi);
|
||||
if (isHW) po = PinOwner::HW_SPI;
|
||||
} else {
|
||||
uint8_t hw_scl = i2c_scl<0 ? HW_PIN_SCL : i2c_scl;
|
||||
uint8_t hw_sda = i2c_sda<0 ? HW_PIN_SDA : i2c_sda;
|
||||
uint8_t hw_scl = i2c_scl;
|
||||
uint8_t hw_sda = i2c_sda;
|
||||
bool isHW = (oldPin[0]==hw_scl && oldPin[1]==hw_sda);
|
||||
if (isHW) po = PinOwner::HW_I2C;
|
||||
}
|
||||
|
||||
@@ -868,7 +868,7 @@ public:
|
||||
//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
|
||||
oappend(SET_F("addInfo('Rotary-Encoder:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/usermods/Rotary-Encoder"\" type=\"button\">?</button>');"));
|
||||
#ifdef ENCODER_DT_PIN
|
||||
oappend(SET_F("xOption('Rotary-Encoder:DT-pin',1,' ⎌',")); oappendi(ENCODER_DT_PIN); oappend(");");
|
||||
#endif
|
||||
|
||||
@@ -317,7 +317,7 @@ class WeatherUsermod : public Usermod {
|
||||
|
||||
void appendConfigData()
|
||||
{
|
||||
oappend(SET_F("addInfo('Weather:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/moonmodules/Weather"\" type=\"button\">?</button>');")); // 0 is field type, 1 is actual field
|
||||
oappend(SET_F("addInfo('Weather:help',0,'<button onclick=\"location.href="https://mm.kno.wled.ge/moonmodules/Weather"\" type=\"button\">?</button>');"));
|
||||
|
||||
oappend(SET_F("dd=addDropdown('Weather','units');"));
|
||||
oappend(SET_F("addOption(dd,'Kelvin',0);"));
|
||||
|
||||
@@ -252,13 +252,13 @@
|
||||
urows+="<i style=\"color:orange\">(only changable on ESP32, change requires reboot!)</i>";
|
||||
urows+="<hr class=\"sml\">";
|
||||
urows+="<p><u>Global I2C GPIOs (HW)</u></p>";
|
||||
addField("SDA2", "pin", -1, false);
|
||||
addField("SCL2", "pin", -1, false);
|
||||
addField("SDA", "pin", -1, false);
|
||||
addField("SCL", "pin", -1, false);
|
||||
urows+="<hr class=\"sml\">";
|
||||
urows+="<p><u>Global SPI GPIOs (HW)</u></p>";
|
||||
addField("MOSI2", "pin", -1, false);
|
||||
addField("MISO2", "pin", -1, false);
|
||||
addField("SCLK2", "pin", -1, false);
|
||||
addField("MOSI", "pin", -1, false);
|
||||
addField("MISO", "pin", -1, false);
|
||||
addField("SCLK", "pin", -1, false);
|
||||
}
|
||||
if (isO(umCfg)) {
|
||||
//WLEDMM: read url parameter. e.g. um=AudioReactive and if set only add the usermod with the same name
|
||||
|
||||
@@ -152,11 +152,11 @@ String PinManagerClass::getPinSpecialText(int gpio) { // special purpose PIN in
|
||||
#endif
|
||||
|
||||
// hardware special purpose PINS. part2 - default pins
|
||||
if ((gpio == i2c_sda) || ((gpio == HW_PIN_SDA) && (i2c_sda < 0))) return(F("(default) I2C SDA"));
|
||||
if ((gpio == i2c_scl) || ((gpio == HW_PIN_SCL) && (i2c_scl < 0))) return(F("(default) I2C SCL"));
|
||||
if ((gpio == spi_sclk) || ((gpio == HW_PIN_CLOCKSPI) && (spi_sclk < 0))) return(F("(default) SPI SLK / SCK"));
|
||||
if ((gpio == spi_mosi) || ((gpio == HW_PIN_DATASPI) && (spi_mosi < 0))) return(F("(default) SPI PICO / MOSI"));
|
||||
if ((gpio == spi_miso) || ((gpio == HW_PIN_MISOSPI) && (spi_miso < 0))) return(F("(default) SPI POCI / MISO"));
|
||||
if (gpio == i2c_sda) return(F("(default) I2C SDA"));
|
||||
if (gpio == i2c_scl) return(F("(default) I2C SCL"));
|
||||
if (gpio == spi_sclk) return(F("(default) SPI SLK / SCK"));
|
||||
if (gpio == spi_mosi) return(F("(default) SPI PICO / MOSI"));
|
||||
if (gpio == spi_miso) return(F("(default) SPI POCI / MISO"));
|
||||
//if ((gpio == spi_cs) || ((gpio == HW_PIN_CS) && (spi_cs < 0))) return(F("(default) SPI CS / SS"));
|
||||
#if defined(WLED_USE_SD_MMC) || defined(WLED_USE_SD_SPI) || defined(SD_ADAPTER)
|
||||
if ((gpio == HW_PIN_CSSPI)) return(F("(default) SPI CS / SS")); // no part of usermod default settings, currently only needed by SD_CARD usermod
|
||||
|
||||
@@ -522,11 +522,11 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
||||
AsyncWebParameter* p = request->getParam(i);
|
||||
if (p_prev != nullptr && p->name() == p_prev->name())
|
||||
{
|
||||
if (p->name() == "SDA2:pin") hw_sda_pin = p->value().toInt();
|
||||
if (p->name() == "SCL2:pin") hw_scl_pin = p->value().toInt();
|
||||
if (p->name() == "MOSI2:pin") hw_mosi_pin = p->value().toInt();
|
||||
if (p->name() == "MISO2:pin") hw_miso_pin = p->value().toInt();
|
||||
if (p->name() == "SCLK2:pin") hw_sclk_pin = p->value().toInt();
|
||||
if (p->name() == "SDA:pin") hw_sda_pin = p->value().toInt();
|
||||
if (p->name() == "SCL:pin") hw_scl_pin = p->value().toInt();
|
||||
if (p->name() == "MOSI:pin") hw_mosi_pin = p->value().toInt();
|
||||
if (p->name() == "MISO:pin") hw_miso_pin = p->value().toInt();
|
||||
if (p->name() == "SCLK:pin") hw_sclk_pin = p->value().toInt();
|
||||
}
|
||||
p_prev = p;
|
||||
}
|
||||
|
||||
@@ -704,31 +704,31 @@ void getSettingsJS(AsyncWebServerRequest* request, byte subPage, char* dest) //W
|
||||
// oappend(SET_F("numM="));
|
||||
// oappendi(usermods.getModCount());
|
||||
// oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"SDA2:pin\")[1].value=")); oappendi(i2c_sda); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"SCL2:pin\")[1].value=")); oappendi(i2c_scl); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"MOSI2:pin\")[1].value=")); oappendi(spi_mosi); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"MISO2:pin\")[1].value=")); oappendi(spi_miso); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"SCLK2:pin\")[1].value=")); oappendi(spi_sclk); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"SDA:pin\")[1].value=")); oappendi(i2c_sda); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"SCL:pin\")[1].value=")); oappendi(i2c_scl); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"MOSI:pin\")[1].value=")); oappendi(spi_mosi); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"MISO:pin\")[1].value=")); oappendi(spi_miso); oappend(";");
|
||||
oappend(SET_F("d.getElementsByName(\"SCLK:pin\")[1].value=")); oappendi(spi_sclk); oappend(";");
|
||||
//WLEDMM: add help info showing defaults
|
||||
oappend(SET_F("addInfo('SDA2:pin',0,'', 'SDA');"));
|
||||
oappend(SET_F("addInfo('SDA:pin',0,'', 'SDA');"));
|
||||
#ifdef HW_PIN_SDA
|
||||
oappend(SET_F("xOption('SDA2:pin',1,' ⎌',")); oappendi(HW_PIN_SDA); oappend(");");
|
||||
oappend(SET_F("xOption('SDA:pin',1,' ⎌',")); oappendi(HW_PIN_SDA); oappend(");");
|
||||
#endif
|
||||
oappend(SET_F("addInfo('SCL2:pin',0,'', 'SCL');"));
|
||||
oappend(SET_F("addInfo('SCL:pin',0,'', 'SCL');"));
|
||||
#ifdef HW_PIN_SCL
|
||||
oappend(SET_F("xOption('SCL2:pin',1,' ⎌',")); oappendi(HW_PIN_SCL); oappend(");");
|
||||
oappend(SET_F("xOption('SCL:pin',1,' ⎌',")); oappendi(HW_PIN_SCL); oappend(");");
|
||||
#endif
|
||||
oappend(SET_F("addInfo('MOSI2:pin',0,'', 'MOSI');"));
|
||||
oappend(SET_F("addInfo('MOSI:pin',0,'', 'MOSI');"));
|
||||
#ifdef HW_PIN_DATASPI
|
||||
oappend(SET_F("xOption('MOSI2:pin',1,' ⎌',")); oappendi(HW_PIN_DATASPI); oappend(");");
|
||||
oappend(SET_F("xOption('MOSI:pin',1,' ⎌',")); oappendi(HW_PIN_DATASPI); oappend(");");
|
||||
#endif
|
||||
oappend(SET_F("addInfo('MISO2:pin',0,'', 'MISO');"));
|
||||
oappend(SET_F("addInfo('MISO:pin',0,'', 'MISO');"));
|
||||
#ifdef HW_PIN_MISOSPI
|
||||
oappend(SET_F("xOption('MISO2:pin',1,' ⎌',")); oappendi(HW_PIN_MISOSPI); oappend(");");
|
||||
oappend(SET_F("xOption('MISO:pin',1,' ⎌',")); oappendi(HW_PIN_MISOSPI); oappend(");");
|
||||
#endif
|
||||
oappend(SET_F("addInfo('SCLK2:pin',0,'', 'SCLK');"));
|
||||
oappend(SET_F("addInfo('SCLK:pin',0,'', 'SCLK');"));
|
||||
#ifdef HW_PIN_CLOCKSPI
|
||||
oappend(SET_F("xOption('SCLK2:pin',1,' ⎌',")); oappendi(HW_PIN_CLOCKSPI); oappend(");");
|
||||
oappend(SET_F("xOption('SCLK:pin',1,' ⎌',")); oappendi(HW_PIN_CLOCKSPI); oappend(");");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user