New esp8266_4MB_max entry to test usermods / i2c

pio.ini: add esp8266_4MB_max with pir, dallas, relay  games (to test IMU) 

addHB: use string literal instead of var

appendConfigData to um multirelay
This commit is contained in:
Ewoud
2023-01-17 13:07:50 +01:00
parent 9065b684b3
commit 357e3638d4
16 changed files with 236 additions and 203 deletions

View File

@@ -414,7 +414,7 @@ class Animated_Staircase : public Usermod {
}
void appendConfigData() {
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('staircase');"));
//oappend(SET_F("dd=addDropdown('staircase','selectfield');"));
//oappend(SET_F("addOption(dd,'1st value',0);"));

View File

@@ -226,7 +226,7 @@ public:
}
void appendConfigData() {
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('BH1750');");
// WLEDMM this usermod can ONLY use HW_I2C - so always use globals
//oappend(SET_F("addInfo('BH1750:pin[]',0,'','I2C SCL');"));
//oappend(SET_F("rOption('BH1750:pin[]',0,'use global (")); oappendi(i2c_scl); oappend(")',-1);");

View File

@@ -401,7 +401,7 @@ public:
}
void appendConfigData() {
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('BME280/BMP280');"));
oappend(SET_F("addInfo('BME280/BMP280:pin[]',0,'','I2C/SPI CLK');"));
oappend(SET_F("disableRO('BME280/BMP280:pin[]',0);"));

View File

@@ -378,7 +378,7 @@ class UsermodBattery : public Usermod
void appendConfigData()
{
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('Battery');"));
oappend(SET_F("addInfo('Battery:min-voltage', 1, 'v');"));
oappend(SET_F("addInfo('Battery:max-voltage', 1, 'v');"));

View File

@@ -414,7 +414,7 @@ public:
void appendConfigData()
{
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('PIRsensorSwitch');"));
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

View File

@@ -287,9 +287,9 @@ class PWMFanUsermod : public Usermod {
}
void appendConfigData() {
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('PWM-fan');"));
}
/*
* addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object.
* It will be called by WLED when settings are actually saved (for example, LED settings are saved)

View File

@@ -306,7 +306,7 @@ class UsermodTemperature : public Usermod {
//}
void appendConfigData() {
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('Temperature');"));
}
/**

View File

@@ -303,7 +303,7 @@ class BobLightUsermod : public Usermod {
}
void appendConfigData() {
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('BobLight');"));
//oappend(SET_F("dd=addDropdown('usermod','selectfield');"));
//oappend(SET_F("addOption(dd,'1st value',0);"));

View File

@@ -571,6 +571,11 @@ class MultiRelay : public Usermod {
DEBUG_PRINTLN(F("MultiRelay config saved."));
}
void appendConfigData()
{
oappend(SET_F("addHB('MultiRelay');"));
}
/**
* restore the changeable values
* readFromConfig() is called before setup() to populate properties from values stored in cfg.json

View File

@@ -205,7 +205,7 @@ class AutoSaveUsermod : public Usermod {
}
void appendConfigData() {
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('Autosave');"));
}
/*

View File

@@ -1044,7 +1044,7 @@ class FourLineDisplayUsermod : public Usermod {
//}
void appendConfigData() {
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('4LineDisplay');"));
oappend(SET_F("dd=addDropdown('4LineDisplay','type');"));
oappend(SET_F("addOption(dd,'None',0);"));

View File

@@ -264,6 +264,7 @@ class Frame3D {
points.push_back(voxel);
}
void drawLineXYZ(Voxel from, Voxel to, uint32_t col) {
//causes crash on ESP8266: StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores, maybe not enough free heap
for (float x=MIN(from.x, to.x); x<=MAX(from.x, to.x); x+=.05)
for (float y=MIN(from.y, to.y); y<=MAX(from.y, to.y); y+=.05)
for (float z=MIN(from.z, to.z); z<=MAX(from.z, to.z); z+=.05)
@@ -329,9 +330,9 @@ class GamesUsermod : public Usermod {
strip.addEffect(255, &mode_pongGame, _data_FX_MODE_PONGGAME);
#ifdef USERMOD_MPU6050_IMU
IMU = (MPU6050Driver *)usermods.lookup(USERMOD_ID_IMU);
#ifdef WLED_DEBUG
// #ifdef WLED_DEBUG
strip.addEffect(255, &mode_IMUTest, _data_FX_MODE_IMUTest);
#endif
// #endif
#endif
strip.addEffect(255, &mode_3DIMUCube, _data_FX_MODE_3DIMUCube); //works also without IMU
}

View File

@@ -872,7 +872,7 @@ public:
//WLEDMM: add appendConfigData
void appendConfigData()
{
oappend(SET_F("addHB('")); oappend(_name); oappend("');");
oappend(SET_F("addHB('Rotary-Encoder');"));
#ifdef ENCODER_DT_PIN
oappend(SET_F("xOption('Rotary-Encoder:DT-pin',1,' ⎌',")); oappendi(ENCODER_DT_PIN); oappend(");");