Skip to content

Commit

Permalink
Merge branch 'mega' into UweKaditz
Browse files Browse the repository at this point in the history
  • Loading branch information
uwekaditz authored Aug 29, 2023
2 parents 260a588 + cf13abf commit 8469b1d
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 22 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ESPEasy_mega\_*[releasedate]*\_*[build-type]*\_*[opt-arduino-library]*\_*[hardwa
*[build-type]* can be any of:
Build type | Description | included plugins |
-------------|-------------------------------------------|----------------------------------|
climate | All plugins related to climate measurement| Stable + Climate |
custom | Custom predefined set/Defined in Custom.h | Specific |
normal | Standard plugins | Stable |
collection_A | Normal + plugin collection A | Stable + Collection base + set A |
Expand Down
27 changes: 14 additions & 13 deletions docs/source/Plugin/P036_commands.repl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@
Set the global align option for content to centre (0), left (1) or right (2).
"
"
``oledframedcmd,userDef1,'<user Defined Header1>'``
","
Set the user defined header nr. 1 with any desired text value.

Use ``$<sysvar>$`` instead of ``%<sysvar>%`` to use system variables.
"
"
``oledframedcmd,userDef2,'<user Defined Header2>'``
","
Set the user defined header nr. 2 with any desired text value.

Use ``$<sysvar>$`` instead of ``%<sysvar>%`` to use system variables.
"
"
``oledframedcmd,restore,<line>``
","
If the <line> parameter is set to 0 all line contents will be restored from the settings.
Expand All @@ -88,17 +102,4 @@
The <speed> parameter corresponds with the line number of the scroll parameter of the settings (1=Very slow ... 6=Ticker).
After applying the new scroll speed the display restarts with the first page.
"
"
``oledframedcmd,userDef1,"<user Defined Header1>"``
","
Set the user defined header nr. 1 with any desired text value.

Use ``$<sysvar>$`` instead of ``%<sysvar>%`` to use system variables.
"
"
``oledframedcmd,userDef2,"<user Defined Header2>"``
","
Set the user defined header nr. 2 with any desired text value.

Use ``$<sysvar>$`` instead of ``%<sysvar>%`` to use system variables.
"
3 changes: 2 additions & 1 deletion src/_P153_SHT4x.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// #######################################################################################################

/**
* 2023-08-26 tonhuisman: BUGFIX: Fixed wrong VType to correctly use SENSOR_TYPE_TEMP_HUM, so it will send data correctly to Domoticz
* 2023-06-10 tonhuisman: Return NaN values if there is an error connecting to the sensor, or a checksum error is reported
* 2023-06-10 tonhuisman: BUGFIX: The switch to Normal configuration wasn't working, resulting in checksum errors
* 2023-04-24 tonhuisman: Rename Boot configuration to Startup configuration, add PLUGIN_WRITE support for commands
Expand Down Expand Up @@ -55,7 +56,7 @@ boolean Plugin_153(uint8_t function, struct EventStruct *event, String& string)
{
Device[++deviceCount].Number = PLUGIN_ID_153;
Device[deviceCount].Type = DEVICE_TYPE_I2C;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_DUAL;
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_TEMP_HUM;
Device[deviceCount].Ports = 0;
Device[deviceCount].PullUpOption = false;
Device[deviceCount].InverseLogicOption = false;
Expand Down
3 changes: 1 addition & 2 deletions src/src/Helpers/ESPEasy_Storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ fs::File tryOpenFile(const String& fname, const String& mode, FileDestination_e
# if FEATURE_SD

if (!f && ((destination == FileDestination_e::ANY) || (destination == FileDestination_e::SD))) {
// FIXME TD-er: Should this fallback to SD only be done on "r" mode?
f = SD.open(fname.c_str(), mode.c_str());
f = SD.open(patch_fname(fname).c_str(), mode.c_str());
}
# endif // if FEATURE_SD

Expand Down
12 changes: 12 additions & 0 deletions src/src/Helpers/StringGenerator_GPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ const __FlashStringHelper* getConflictingUse(int gpio, PinSelectPurpose purpose)

bool includeI2C = true;
bool includeSPI = true;
#if FEATURE_SD
bool includeSDCard = true;
#endif
#if FEATURE_DEFINE_SERIAL_CONSOLE_PORT
// FIXME TD-er: Must check whether this can be a conflict.
bool includeSerial = false;
Expand Down Expand Up @@ -241,6 +244,11 @@ const __FlashStringHelper* getConflictingUse(int gpio, PinSelectPurpose purpose)
case PinSelectPurpose::Generic_bidir:
case PinSelectPurpose::DAC:
break;
#if FEATURE_SD
case PinSelectPurpose::SD_Card:
includeSDCard = false;
break;
#endif
}

if (includeI2C && Settings.isI2C_pin(gpio)) {
Expand All @@ -265,6 +273,10 @@ const __FlashStringHelper* getConflictingUse(int gpio, PinSelectPurpose purpose)
}
}

#if FEATURE_SD
if (Settings.Pin_sd_cs == gpio && includeSDCard) { return F("SD-Card CS"); }
#endif // if FEATURE_SD


#if FEATURE_ETHERNET

Expand Down
5 changes: 4 additions & 1 deletion src/src/Helpers/StringGenerator_GPIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ enum class PinSelectPurpose : uint8_t {
Ethernet,
Serial_input,
Serial_output,
DAC
DAC,
#if FEATURE_SD
SD_Card,
#endif

};

Expand Down
5 changes: 1 addition & 4 deletions src/src/WebServer/FileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,9 @@ void handle_SDfilelist() {
// size_t entrynameLength = strlen(entry.name());
if (entry.isDirectory())
{
char SDcardChildDir[80];

// take a look in the directory for entries
String child_dir = current_dir + entry.name();
child_dir.toCharArray(SDcardChildDir, child_dir.length() + 1);
fs::File child = SD.open(SDcardChildDir);
fs::File child = SD.open(child_dir.c_str());
fs::File dir_has_entry = child.openNextFile();

// when the directory is empty, display the button to delete them
Expand Down
2 changes: 1 addition & 1 deletion src/src/WebServer/HardwarePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void handle_hardware() {

#if FEATURE_SD
addFormSubHeader(F("SD Card"));
addFormPinSelect(PinSelectPurpose::Generic_output, formatGpioName_output(F("SD Card CS")), F("sd"), Settings.Pin_sd_cs);
addFormPinSelect(PinSelectPurpose::SD_Card, formatGpioName_output(F("SD Card CS")), F("sd"), Settings.Pin_sd_cs);
#endif // if FEATURE_SD

#if FEATURE_ETHERNET
Expand Down
17 changes: 17 additions & 0 deletions src/src/WebServer/Markup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ void addPinSelector_Item(PinSelectPurpose purpose, const String& gpio_label, int
#if FEATURE_ETHERNET
bool includeEthernet = true;
#endif // if FEATURE_ETHERNET
#if FEATURE_SD
bool includeSDCard = true;
#endif // if FEATURE_SD

switch (purpose) {
case PinSelectPurpose::SPI:
Expand Down Expand Up @@ -341,6 +344,14 @@ void addPinSelector_Item(PinSelectPurpose purpose, const String& gpio_label, int
return;
}
break;
#if FEATURE_SD
case PinSelectPurpose::SD_Card:
includeSDCard = false;
if (!output) {
return;
}
break;
#endif
}

if (includeI2C && Settings.isI2C_pin(gpio)) {
Expand All @@ -361,6 +372,12 @@ void addPinSelector_Item(PinSelectPurpose purpose, const String& gpio_label, int
disabled = true;
}
#endif // if FEATURE_ETHERNET

#if FEATURE_SD
if (includeSDCard && (Settings.Pin_sd_cs == gpio)) {
disabled = true;
}
#endif
}
}

Expand Down

0 comments on commit 8469b1d

Please sign in to comment.