Merge branch 'mega' into feature/SPI-add-support-for-multiple-buses

This commit is contained in:
TD-er
2026-02-10 10:05:47 +01:00
committed by GitHub
19 changed files with 235 additions and 139 deletions
+14
View File
@@ -4,6 +4,20 @@
For ways to *support* us, see [this announcement on the forum](https://www.letscontrolit.com/forum/viewtopic.php?f=14&t=5787), or have a look at the [Patreon](https://www.patreon.com/GrovkillenTDer), [Ko-Fi](https://ko-fi.com/grovkillentder) or [PayPal](https://www.paypal.me/espeasy) links above.
# ESPEasy, Automate (using) Common Sense, No AI.
The main objective for ESPEasy is to make people realize they can easily control appliances and act on sensor data.
Anyone can use it and you don't need AI.
Only requirement is common sense and appreciate the satisfaction of seeing things just work.
If you can't build it yourself, you don't 'own' it.
So let's make sure YOU control it.
We are more than willing to assist via our [forum](https://www.letscontrolit.com/forum).
# ESPEasy (development branch)
+28 -14
View File
@@ -42,6 +42,9 @@
//
/** History
* 2026-01-17 tonhuisman: Revert to using 'regular' Arduino GPIO functions for TM1637 displays on ESP8266
* 2026-01-12 tonhuisman: Fix initialization of number of digits when upgrading to 20260108 build,
* formatted source with new Uncrustify config
* 2024-09-28 tonhuisman: Switch to using DIRECT_PIN_IO, to get better timing-accuracy for TM1637 displays
* 2024-09-27 tonhuisman: Add option to flash dot on second digit instead of the colon for blinking time
* 2024-08-24 tonhuisman: Add compiletime define P073_USE_74HC595_OVERRIDE that, when, set to 1, allows 74HC595 displays to be included
@@ -96,12 +99,13 @@
# include "src/PluginStructs/P073_data_struct.h"
boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string) {
boolean success = false;
switch (function) {
case PLUGIN_DEVICE_ADD: {
switch (function)
{
case PLUGIN_DEVICE_ADD:
{
auto& dev = Device[++deviceCount];
dev.Number = PLUGIN_ID_073;
dev.Type = DEVICE_TYPE_TRIPLE;
@@ -113,13 +117,15 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
break;
}
case PLUGIN_GET_DEVICENAME: {
case PLUGIN_GET_DEVICENAME:
{
string = F(PLUGIN_NAME_073);
break;
}
# if P073_SCROLL_TEXT || P073_USE_74HC595
case PLUGIN_SET_DEFAULTS: {
case PLUGIN_SET_DEFAULTS:
{
# if P073_SCROLL_TEXT
P073_CFG_SCROLLSPEED = 10; // Default 10 * 0.1 sec scroll speed
# endif // if P073_SCROLL_TEXT
@@ -134,7 +140,8 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
}
# endif // if P073_SCROLL_TEXT || P073_USE_74HC595
case PLUGIN_WEBFORM_LOAD: {
case PLUGIN_WEBFORM_LOAD:
{
addFormNote(F("TM1637: 1st=CLK-Pin, 2nd=DIO-Pin"));
addFormNote(F("MAX7219: 1st=DIN-Pin, 2nd=CLK-Pin, 3rd=CS-Pin"));
# if P073_USE_74HC595
@@ -151,7 +158,7 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
};
constexpr size_t optionCount = NR_ELEMENTS(displtype);
const FormSelectorOptions selector(optionCount, displtype);
selector.addFormSelector(F("Display Type"), F("displtype"), PCONFIG(0));
selector.addFormSelector(F("Display Type"), F("displtype"), P073_CFG_DISPLAYTYPE);
}
# if P073_USE_74HC595
@@ -258,7 +265,8 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
break;
}
case PLUGIN_WEBFORM_SAVE: {
case PLUGIN_WEBFORM_SAVE:
{
P073_CFG_DISPLAYTYPE = getFormItemInt(F("displtype"));
P073_CFG_OUTPUTTYPE = getFormItemInt(F("displout"));
P073_CFG_BRIGHTNESS = getFormItemInt(F("brightness"));
@@ -292,12 +300,14 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
break;
}
case PLUGIN_EXIT: {
case PLUGIN_EXIT:
{
success = true;
break;
}
case PLUGIN_INIT: {
case PLUGIN_INIT:
{
initPluginTaskData(event->TaskIndex, new (std::nothrow) P073_data_struct());
P073_data_struct *P073_data =
static_cast<P073_data_struct *>(getPluginTaskData(event->TaskIndex));
@@ -317,7 +327,8 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
break;
}
case PLUGIN_WRITE: {
case PLUGIN_WRITE:
{
P073_data_struct *P073_data =
static_cast<P073_data_struct *>(getPluginTaskData(event->TaskIndex));
@@ -327,7 +338,8 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
break;
}
case PLUGIN_ONCE_A_SECOND: {
case PLUGIN_ONCE_A_SECOND:
{
P073_data_struct *P073_data =
static_cast<P073_data_struct *>(getPluginTaskData(event->TaskIndex));
@@ -339,7 +351,8 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
}
# if P073_SCROLL_TEXT
case PLUGIN_TEN_PER_SECOND: {
case PLUGIN_TEN_PER_SECOND:
{
P073_data_struct *P073_data =
static_cast<P073_data_struct *>(getPluginTaskData(event->TaskIndex));
@@ -353,7 +366,8 @@ boolean Plugin_073(uint8_t function, struct EventStruct *event, String& string)
# if P073_USE_74HC595
case PLUGIN_TASKTIMER_IN: {
case PLUGIN_TASKTIMER_IN:
{
P073_data_struct *P073_data =
static_cast<P073_data_struct *>(getPluginTaskData(event->TaskIndex));
+2 -1
View File
@@ -77,7 +77,8 @@ boolean Plugin_135(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_GET_DISCOVERY_VTYPES:
{
event->Par1 = static_cast<int>(Sensor_VType::SENSOR_TYPE_CO2_ONLY);
event->Par2 = static_cast<int>(Sensor_VType::SENSOR_TYPE_TEMP_HUM);
event->Par2 = static_cast<int>(Sensor_VType::SENSOR_TYPE_HUM_ONLY);
event->Par3 = static_cast<int>(Sensor_VType::SENSOR_TYPE_TEMP_ONLY);
success = true;
break;
}
+10 -9
View File
@@ -3541,15 +3541,6 @@ To create/register a plugin, you have to :
#endif
#endif
#if FEATURE_MQTT_TLS || FEATURE_EMAIL_TLS || FEATURE_HTTP_TLS
#if defined(FEATURE_TLS) && !FEATURE_TLS
#undef FEATURE_TLS
#endif
#ifndef FEATURE_TLS
#define FEATURE_TLS 1
#endif
#endif
#if !defined(FEATURE_MQTT_DISCOVER) && FEATURE_MQTT
#if defined(LIMIT_BUILD_SIZE) || defined(ESP8266) // Must enable this explicitly for ESP8266 Custom build
@@ -3934,6 +3925,16 @@ To create/register a plugin, you have to :
#endif
#endif // ifndef FEATURE_HTTP_TLS
#if FEATURE_MQTT_TLS || FEATURE_EMAIL_TLS || FEATURE_HTTP_TLS
#if defined(FEATURE_TLS) && !FEATURE_TLS
#undef FEATURE_TLS
#endif
#ifndef FEATURE_TLS
#define FEATURE_TLS 1
#endif
#endif
#ifndef FEATURE_AUTO_DARK_MODE
#ifdef LIMIT_BUILD_SIZE
#define FEATURE_AUTO_DARK_MODE 0
+1 -1
View File
@@ -203,7 +203,7 @@ void Web_StreamingBuffer::startStream(const __FlashStringHelper * content_type,
void Web_StreamingBuffer::startJsonStream() {
startStream(true, F("application/json"), F("*"));
startStream(false, F("application/json"), F(""));
}
void Web_StreamingBuffer::startStream(bool allowOriginAll,
+5
View File
@@ -34,6 +34,11 @@
#include "../Helpers/PeriodicalActions.h"
#include "../Helpers/PortStatus.h"
# if FEATURE_MQTT_TLS
# include <WiFiClientSecureLightBearSSL.h>
# include "../CustomBuild/Certificate_CA.h"
# endif // if FEATURE_MQTT_TLS
constexpr pluginID_t PLUGIN_ID_MQTT_IMPORT(37);
+1
View File
@@ -16,6 +16,7 @@
# if FEATURE_MQTT_TLS
# include <WiFiClientSecureLightBearSSL.h>
# include "../CustomBuild/Certificate_CA.h"
# endif // if FEATURE_MQTT_TLS
# if FEATURE_MQTT_CONNECT_BACKGROUND
+4 -3
View File
@@ -1013,9 +1013,10 @@ bool PluginCall(uint8_t Function, struct EventStruct *event, String& str)
case PLUGIN_GET_UOM_GROUPS:
#endif // if FEATURE_TASKVALUE_UNIT_OF_MEASURE
// PLUGIN_MQTT_xxx functions are directly called from the scheduler.
// case PLUGIN_MQTT_CONNECTION_STATE:
// case PLUGIN_MQTT_IMPORT:
#if FEATURE_MQTT
case PLUGIN_MQTT_CONNECTION_STATE:
case PLUGIN_MQTT_IMPORT:
#endif // if FEATURE_MQTT
{
START_TIMER;
const deviceIndex_t DeviceIndex = getDeviceIndex_from_TaskIndex(event->TaskIndex);
+2 -7
View File
@@ -322,10 +322,6 @@ void scheduleNextMQTTdelayQueue() {
}
void schedule_all_MQTTimport_tasks() {
controllerIndex_t ControllerIndex = firstEnabledMQTT_ControllerIndex();
if (!validControllerIndex(ControllerIndex)) { return; }
constexpr pluginID_t PLUGIN_MQTT_IMPORT(PLUGIN_ID_MQTT_IMPORT);
deviceIndex_t DeviceIndex = getDeviceIndex(PLUGIN_MQTT_IMPORT); // Check if P037_MQTTimport is present in the build
@@ -420,9 +416,6 @@ void updateMQTTclient_connected() {
addLogMove(LOG_LEVEL_ERROR, connectionError);
}
MQTTclient_must_send_LWT_connected = false;
} else {
// Now schedule all tasks using the MQTT controller.
schedule_all_MQTTimport_tasks();
}
if (Settings.UseRules) {
if (MQTTclient_connected) {
@@ -431,6 +424,8 @@ void updateMQTTclient_connected() {
eventQueue.add(F("MQTT#Disconnected"));
}
}
// Now schedule all tasks using the MQTT Import plugin.
schedule_all_MQTTimport_tasks();
}
if (!MQTTclient_connected) {
// As suggested here: https://github.com/letscontrolit/ESPEasy/issues/1356
@@ -435,7 +435,6 @@ void P023_data_struct::sendStrXY(const char *string, int X, int Y) {
for (i = 0; i < char_width && currentPixels < maxPixels; ++i,++currentPixels) { // Prevent display overflow on the pixel-level
sendChar((i == 0 || i > 5) ? 0x00 : pgm_read_byte(baddr + i - 1));
}
currentPixels += char_width;
string++;
}
}
+117 -65
View File
@@ -2,7 +2,9 @@
#ifdef USES_P073
# include <GPIO_Direct_Access.h>
# ifdef ESP32
# include <GPIO_Direct_Access.h>
# endif // ifdef ESP32
uint8_t P073_getDefaultDigits(uint8_t displayModel,
uint8_t digits) {
@@ -34,7 +36,8 @@ uint8_t P073_mapCharToFontPosition(char character,
const String specialChars = F(" -^=/_%@.,;:+*#!?'\"<>\\()|");
const String chnorux = F("CHNORUX");
switch (fontset) {
switch (fontset)
{
case 1: // Siekoo
case 2: // Siekoo with uppercase 'CHNORUX'
@@ -58,16 +61,24 @@ uint8_t P073_mapCharToFontPosition(char character,
if (isDigit(character)) {
position = character - '0';
} else if (isAlpha(character)) {
}
else if (isAlpha(character)) {
position = character - (isLowerCase(character) ? 'a' : 'A') + 16;
} else {
switch (character) {
case ' ': position = 10; break;
case '-': position = 11; break;
case '^': position = 12; break; // degree
case '=': position = 13; break;
case '/': position = 14; break;
case '_': position = 15; break;
switch (character)
{
case ' ': position = 10;
break;
case '-': position = 11;
break;
case '^': position = 12;
break; // degree
case '=': position = 13;
break;
case '/': position = 14;
break;
case '_': position = 15;
break;
}
}
# if P073_EXTRA_FONTS
@@ -85,7 +96,8 @@ uint8_t P073_getFontChar(uint8_t index,
uint8_t fontset) {
# if P073_EXTRA_FONTS
switch (fontset) {
switch (fontset)
{
case 1: // Siekoo
case 2: // Siekoo uppercase CHNORUX
return pgm_read_byte(&(SiekooCharTable[index]));
@@ -143,10 +155,12 @@ void P073_display_output_selector(const __FlashStringHelper *id, int16_t value)
P073_DISP_DATE,
};
const FormSelectorOptions selector(NR_ELEMENTS(disploutOptions), displout, disploutOptions);
selector.addFormSelector(F("Display Output"), id, value);
}
# if P073_EXTRA_FONTS
void P073_font_selector(const __FlashStringHelper *id, int16_t value) {
const __FlashStringHelper *fontset[] = {
F("Default"),
@@ -154,7 +168,8 @@ void P073_font_selector(const __FlashStringHelper *id, int16_t value) {
F("Siekoo with uppercase 'CHNORUX'"),
F("dSEG7"),
};
const FormSelectorOptions selector(NR_ELEMENTS(fontset), fontset);
const FormSelectorOptions selector(NR_ELEMENTS(fontset), fontset);
selector.addFormSelector(F("Font set"), id, value);
addFormNote(F("Check documentation for examples of the font sets."));
}
@@ -202,9 +217,9 @@ void P073_data_struct::init(struct EventStruct *event)
# endif // if P073_SCROLL_TEXT
rightAlignTempMAX7219 = bitRead(P073_CFG_FLAGS, P073_OPTION_RIGHTALIGN);
suppressLeading0 = bitRead(P073_CFG_FLAGS, P073_OPTION_SUPPRESS0);
#if P073_BLINK_DOT
# if P073_BLINK_DOT
blinkdot = bitRead(P073_CFG_FLAGS, P073_OPTION_BLINK_DOT);
#endif // if P073_BLINK_DOT
# endif // if P073_BLINK_DOT
timesep = true;
# if P073_EXTRA_FONTS
fontset = P073_CFG_FONTSET;
@@ -233,11 +248,20 @@ void P073_data_struct::init(struct EventStruct *event)
}
# endif // if P073_USE_74HC595
if (0 == digits) {
digits = P073_getDefaultDigits(P073_CFG_DISPLAYTYPE);
}
if ((digits > 0) && (digits < 4)) {
hideDegree = true; // Hide degree symbol on small displays
}
switch (displayModel) {
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
addLog(LOG_LEVEL_INFO, strformat(F("P073 : Digits: %d, model: %d, pins: %d, %d, %d"), digits, displayModel, pin1, pin2, pin3));
}
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
case P073_TM1637_6DGT:
@@ -275,6 +299,7 @@ void P073_data_struct::init(struct EventStruct *event)
}
# if P073_USE_74HC595
bool P073_data_struct::plugin_fifty_per_second(struct EventStruct *event) {
# ifdef P073_DEBUG
counter50++;
@@ -289,9 +314,7 @@ bool P073_data_struct::plugin_fifty_per_second(struct EventStruct *event) {
return false;
}
bool P073_data_struct::is74HC595Matrix() {
return P073_74HC595_2_8DGT == displayModel && P073_HC595_MULTIPLEX;
}
bool P073_data_struct::is74HC595Matrix() { return P073_74HC595_2_8DGT == displayModel && P073_HC595_MULTIPLEX; }
// ====================================
// ---- 74HC595 specific functions ----
@@ -642,6 +665,7 @@ void P073_data_struct::FillBufferWithString(const String& textToShow,
}
# if P073_SCROLL_TEXT
int P073_data_struct::getEffectiveTextLength(const String& text) {
const int textLength = text.length();
int p = 0;
@@ -757,17 +781,14 @@ void P073_data_struct::setScrollSpeed(uint8_t speed) {
scrollPos = 0;
}
bool P073_data_struct::isScrollEnabled() {
return txtScrolling && scrollAllowed;
}
bool P073_data_struct::isScrollEnabled() { return txtScrolling && scrollAllowed; }
void P073_data_struct::setScrollEnabled(bool scroll) {
scrollAllowed = scroll;
}
void P073_data_struct::setScrollEnabled(bool scroll) { scrollAllowed = scroll; }
# endif // if P073_SCROLL_TEXT
# if P073_7DBIN_COMMAND
void P073_data_struct::setBinaryData(const String& data) {
binaryData = true;
# if P073_SCROLL_TEXT
@@ -783,6 +804,7 @@ void P073_data_struct::setBinaryData(const String& data) {
# endif // if P073_7DBIN_COMMAND
# ifdef P073_DEBUG
void P073_data_struct::LogBufferContent(String prefix) {
String log;
@@ -803,9 +825,7 @@ void P073_data_struct::LogBufferContent(String prefix) {
# endif // ifdef P073_DEBUG
// in case of error show all dashes
void P073_data_struct::FillBufferWithDash() {
memset(showbuffer, 11, sizeof(showbuffer));
}
void P073_data_struct::FillBufferWithDash() { memset(showbuffer, 11, sizeof(showbuffer)); }
void P073_data_struct::ClearBuffer() {
memset(showbuffer,
@@ -820,11 +840,9 @@ void P073_data_struct::ClearBuffer() {
}
uint8_t P073_data_struct::tm1637_getFontChar(uint8_t index,
uint8_t fontset) {
return P073_revert7bits(P073_getFontChar(index, fontset));
}
uint8_t fontset) { return P073_revert7bits(P073_getFontChar(index, fontset)); }
bool P073_data_struct::plugin_once_a_second(struct EventStruct *event) {
bool P073_data_struct::plugin_once_a_second(struct EventStruct *event) {
if (output == P073_DISP_MANUAL) {
return false;
}
@@ -855,16 +873,17 @@ bool P073_data_struct::plugin_once_a_second(struct EventStruct *event) {
);
}
#if P073_BLINK_DOT
# if P073_BLINK_DOT
if (blinkdot &&
((output == P073_DISP_CLOCK24BLNK) ||
(output == P073_DISP_CLOCK12BLNK))) {
showperiods[1] = timesep; // Blink dot on second digit
}
#endif // if P073_BLINK_DOT
# endif // if P073_BLINK_DOT
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
tm1637_ShowTimeTemp4(timesep, 0);
@@ -900,15 +919,18 @@ bool P073_data_struct::plugin_once_a_second(struct EventStruct *event) {
}
# if P073_SCROLL_TEXT
bool P073_data_struct::plugin_ten_per_second(struct EventStruct *event) {
if ((output != P073_DISP_MANUAL) || !isScrollEnabled()) {
return false;
}
if (NextScroll()) {
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS: {
case P073_TM1637_4DGTDOTS:
{
tm1637_ShowBuffer(0, 4
# if P073_7DBIN_COMMAND
, binaryData
@@ -916,7 +938,8 @@ bool P073_data_struct::plugin_ten_per_second(struct EventStruct *event) {
);
break;
}
case P073_TM1637_6DGT: {
case P073_TM1637_6DGT:
{
tm1637_SwapDigitInBuffer(0); // only needed for 6-digits displays
tm1637_ShowBuffer(0, 6
# if P073_7DBIN_COMMAND
@@ -925,13 +948,15 @@ bool P073_data_struct::plugin_ten_per_second(struct EventStruct *event) {
);
break;
}
case P073_MAX7219_8DGT: {
case P073_MAX7219_8DGT:
{
dotpos = -1; // avoid to display the dot
max7219_ShowBuffer();
break;
}
# if P073_USE_74HC595
case P073_74HC595_2_8DGT: {
case P073_74HC595_2_8DGT:
{
hc595_ToOutputBuffer();
if (hc595_Sequential()) { // Sequential displays don't need continuous refreshing
@@ -981,6 +1006,7 @@ enum class p073_commands_e : int8_t {
c7doff,
c7db,
c7output,
};
bool P073_data_struct::plugin_write(struct EventStruct *event,
@@ -1005,7 +1031,8 @@ bool P073_data_struct::plugin_write(struct EventStruct *event,
bool success = false;
bool displayon = false;
switch (cmd) {
switch (cmd)
{
case p073_commands_e::c7dn:
return plugin_write_7dn(event, text);
case p073_commands_e::c7dt:
@@ -1104,7 +1131,8 @@ bool P073_data_struct::plugin_write(struct EventStruct *event,
setScrollEnabled(newScroll);
# endif // if P073_SCROLL_TEXT
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
case P073_TM1637_6DGT:
@@ -1167,7 +1195,8 @@ bool P073_data_struct::plugin_write_7dn(struct EventStruct *event,
}
}
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
tm1637_ShowBuffer(TM1637_4DIGIT, 8);
@@ -1234,7 +1263,8 @@ bool P073_data_struct::plugin_write_7dt(const String& text) {
FillBufferWithTemp(p073_temptemp);
}
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
case P073_TM1637_6DGT:
@@ -1277,6 +1307,7 @@ bool P073_data_struct::plugin_write_7dt(const String& text) {
}
# if P073_7DDT_COMMAND
bool P073_data_struct::plugin_write_7ddt(const String& text) {
if (output != P073_DISP_MANUAL) {
return false;
@@ -1301,7 +1332,8 @@ bool P073_data_struct::plugin_write_7ddt(const String& text) {
}
# endif // ifndef BUILD_NO_DEBUG
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
case P073_TM1637_6DGT:
@@ -1403,7 +1435,8 @@ bool P073_data_struct::plugin_write_7dst(struct EventStruct *event) {
# endif // if P073_SUPPRESS_ZERO
);
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
tm1637_ShowTimeTemp4(timesep, 0);
@@ -1447,7 +1480,8 @@ bool P073_data_struct::plugin_write_7dsd(struct EventStruct *event) {
# endif // if P073_SUPPRESS_ZERO
);
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
tm1637_ShowTimeTemp4(timesep, 0);
@@ -1494,7 +1528,8 @@ bool P073_data_struct::plugin_write_7dtext(const String& text) {
{
FillBufferWithString(text);
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
tm1637_ShowBuffer(0, 4);
@@ -1522,6 +1557,7 @@ bool P073_data_struct::plugin_write_7dtext(const String& text) {
}
# if P073_EXTRA_FONTS
bool P073_data_struct::plugin_write_7dfont(struct EventStruct *event,
const String & text) {
if (!text.isEmpty()) {
@@ -1545,6 +1581,7 @@ bool P073_data_struct::plugin_write_7dfont(struct EventStruct *event,
# endif // if P073_EXTRA_FONTS
# if P073_7DBIN_COMMAND
bool P073_data_struct::plugin_write_7dbin(const String& text) {
if (!text.isEmpty()) {
String data;
@@ -1576,7 +1613,8 @@ bool P073_data_struct::plugin_write_7dbin(const String& text) {
{
FillBufferWithString(data, true);
switch (displayModel) {
switch (displayModel)
{
case P073_TM1637_4DGTCOLON:
case P073_TM1637_4DGTDOTS:
tm1637_ShowBuffer(0, 4);
@@ -1612,10 +1650,17 @@ bool P073_data_struct::plugin_write_7dbin(const String& text) {
// ---- TM1637 specific functions ----
// ===================================
# define CLK_HIGH() DIRECT_pinWrite(this->pin1, HIGH)
# define CLK_LOW() DIRECT_pinWrite(this->pin1, LOW)
# define DIO_HIGH() DIRECT_PINMODE_INPUT(this->pin2)
# define DIO_LOW() DIRECT_PINMODE_OUTPUT(this->pin2) //; DIRECT_pinWrite(this->pin2, LOW)
# ifdef ESP32
# define CLK_HIGH() DIRECT_pinWrite(this->pin1, HIGH)
# define CLK_LOW() DIRECT_pinWrite(this->pin1, LOW)
# define DIO_HIGH() DIRECT_PINMODE_INPUT(this->pin2)
# define DIO_LOW() DIRECT_PINMODE_OUTPUT(this->pin2) // ; DIRECT_pinWrite(this->pin2, LOW)
# else // ifdef ESP32
# define CLK_HIGH() digitalWrite(this->pin1, HIGH)
# define CLK_LOW() digitalWrite(this->pin1, LOW)
# define DIO_HIGH() pinMode(this->pin2, INPUT)
# define DIO_LOW() pinMode(this->pin2, OUTPUT)
# endif // ifdef ESP32
void P073_data_struct::tm1637_i2cStart() {
# ifdef P073_DEBUG
@@ -1642,7 +1687,7 @@ void P073_data_struct::tm1637_i2cStop() {
void P073_data_struct::tm1637_i2cAck() {
CLK_LOW();
pinMode(pin2, INPUT_PULLUP);
pinMode(this->pin2, INPUT_PULLUP);
// DIO_HIGH();
delayMicroseconds(TM1637_CLOCKDELAY);
@@ -1651,7 +1696,11 @@ void P073_data_struct::tm1637_i2cAck() {
# ifdef P073_DEBUG
const bool dummyAck =
# endif // ifdef P073_DEBUG
DIRECT_pinRead(pin2);
# ifdef ESP32
DIRECT_pinRead(this->pin2);
# else
digitalRead(this->pin2);
# endif // ifdef ESP32
# ifdef P073_DEBUG
@@ -1674,12 +1723,12 @@ void P073_data_struct::tm1637_i2cAck() {
void P073_data_struct::tm1637_i2cWrite_ack(uint8_t bytesToPrint[],
uint8_t length) {
#ifdef P073_DEBUG
# ifdef P073_DEBUG
if (loglevelActiveFor(LOG_LEVEL_INFO)) {
addLog(LOG_LEVEL_INFO, concat(F("7DGT : TM1637 databuffer: 0x"), formatToHex_array(bytesToPrint, length)));
}
#endif // ifdef P073_DEBUG
# endif // ifdef P073_DEBUG
tm1637_i2cStart();
for (uint8_t i = 0; i < length; ++i) {
@@ -1697,9 +1746,8 @@ void P073_data_struct::tm1637_i2cWrite(uint8_t bytetoprint) {
# ifdef P073_DEBUG
addLog(LOG_LEVEL_DEBUG, F("7DGT : WriteByte"));
# endif // ifdef P073_DEBUG
uint8_t i;
for (i = 0; i < 8; ++i) {
for (uint8_t i = 0; i < 8; ++i) {
CLK_LOW();
if (bytetoprint & 0b00000001) {
@@ -1726,21 +1774,25 @@ void P073_data_struct::tm1637_SetPowerBrightness(uint8_t brightlvl,
# ifdef P073_DEBUG
addLog(LOG_LEVEL_INFO, F("7DGT : Set BRIGHT"));
# endif // ifdef P073_DEBUG
uint8_t brightvalue = (brightlvl & 0b111);
brightlvl &= 0b111;
if (poweron) {
brightvalue = TM1637_POWER_ON | brightvalue;
brightlvl |= TM1637_POWER_ON;
} else {
brightvalue = TM1637_POWER_OFF | brightvalue;
brightlvl |= TM1637_POWER_OFF;
}
const uint8_t byteToPrint = brightvalue;
tm1637_i2cWrite_ack(byteToPrint);
tm1637_i2cWrite_ack(brightlvl);
}
void P073_data_struct::tm1637_InitDisplay() {
DIRECT_PINMODE_OUTPUT(pin1);
DIRECT_PINMODE_OUTPUT(pin2);
# ifdef ESP32
DIRECT_PINMODE_OUTPUT(this->pin1);
DIRECT_PINMODE_OUTPUT(this->pin2);
# else // ifdef ESP32
pinMode(this->pin1, OUTPUT);
pinMode(this->pin2, OUTPUT);
# endif // ifdef ESP32
CLK_HIGH();
DIO_HIGH();
+5 -5
View File
@@ -308,9 +308,9 @@ public:
bool rightAlignTempMAX7219 = false;
bool suppressLeading0 = false;
uint8_t fontset = 0;
#if P073_BLINK_DOT
# if P073_BLINK_DOT
bool blinkdot = false;
#endif // if P073_BLINK_DOT
# endif // if P073_BLINK_DOT
# if P073_7DBIN_COMMAND
bool binaryData = false;
# endif // P073_7DBIN_COMMAND
@@ -404,12 +404,12 @@ private:
void hc595_ShowBuffer();
void hc595_ToOutputBuffer();
void hc595_AdjustBuffer();
bool hc595_Sequential() {
return P073_HC595_SEQUENTIAL;
}
bool hc595_Sequential() { return P073_HC595_SEQUENTIAL; }
uint8_t outputbuffer[8]{};
# endif // if P073_USE_74HC595
};
#endif // ifdef USES_P073
+2
View File
@@ -377,6 +377,8 @@ void WebServerInit()
#if defined(ESP8266)
web_server.enableCORS(true);
# if FEATURE_SSDP
if (Settings.UseSSDP)
+1 -1
View File
@@ -583,9 +583,9 @@ void handle_json()
PluginTaskData_base *taskData = getPluginTaskDataBaseClassOnly(TaskIndex);
if ((taskData != nullptr) && (taskData->nrSamplesPresent() > 0)) {
stream_comma_newline();
addHtml(F("\"PluginStats\":\n"));
taskData->plot_ChartJS(true);
stream_comma_newline();
}
}
#endif // if FEATURE_PLUGIN_STATS && FEATURE_CHART_JS
+1
View File
@@ -12,6 +12,7 @@
#include "../Helpers/Convert.h"
#include "../Helpers/ESPEasy_UnitOfMeasure.h"
#include "../Helpers/Hardware_GPIO.h"
#include "../Helpers/Hardware_device_info.h"
#include "../Helpers/StringConverter_Numerical.h"
#include "../Helpers/StringConverter.h"
#include "../Helpers/StringGenerator_GPIO.h"
+1
View File
@@ -8,6 +8,7 @@
#include "../Globals/Settings.h"
#include "../Helpers/Hardware_GPIO.h"
#include "../Helpers/Hardware_device_info.h"
#include "../Helpers/Numerical.h"
#include "../Helpers/StringConverter.h"
#include "../Helpers/StringGenerator_GPIO.h"
+10 -5
View File
@@ -454,16 +454,19 @@ textarea,
}
.menubar {
display: flex;
position: inherit;
top: 54px;
width: 100%
max-width: 960px;
}
a.menu {
align-items: center;
display: flex;
height: 46px;
justify-content: center
justify-content: center;
gap: 2px;
width: 100%
}
.menu {
@@ -576,13 +579,15 @@ canvas {
filter: invert(var(--iv)) hue-rotate(var(--ro));
}
@media screen and (max-width:830px) {
@media screen and (max-width:960px) {
.showmenulabel {
display: none
}
a.menu {
width: 11%
.menubar {
width: 100%;
max-width: 700px;
left: 0
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+30 -26
View File
@@ -143,11 +143,13 @@ def parse_filename(file, version, variant, file_suffix):
if 'NotSet' in sub_group:
if 'climate_' in variant:
group = 'Climate'
variant_split = variant.split('_')
group = 'Climate {}'.format(variant_split[1])
elif 'energy_' in variant:
group = 'Energy'
elif 'display_' in variant:
group = 'Display'
variant_split = variant.split('_')
group = 'Display {}'.format(variant_split[1])
elif 'neopixel_' in variant:
group = 'NeoPixel'
elif 'normal_' in variant:
@@ -158,7 +160,7 @@ def parse_filename(file, version, variant, file_suffix):
group = 'Custom'
elif 'collection' in variant:
variant_split = variant.split('_')
group = 'Collection{}'.format(variant_split[1])
group = 'Collection {}'.format(variant_split[1])
# Select based on "4M1M" here to keep any occasional "4M2M" build
# separated in another group
if '_4M1M' in variant:
@@ -174,7 +176,7 @@ def parse_filename(file, version, variant, file_suffix):
specials.append(flash_size)
if '_PSRAM' in variant:
specials.append('PSRAM')
if 'LittleFS' in variant:
if 'LittleFS' in variant and 'ESP32' not in variant:
specials.append('LittleFS')
if '_IRExt' in variant:
specials.append('IRExt')
@@ -220,11 +222,6 @@ def parse_filename(file, version, variant, file_suffix):
# Thus make a separate group for the solo1
main_group = '4M Flash ESP32-solo1'
if 'ESP32' in variant:
main_group += ' ESP32'
else:
main_group += ' ESP8266'
if ".factory.bin" in file_suffix or 'ESP32' not in file:
#print('{:10s}: {:34s}\t{:10s} {} / {}'.format(state, sub_group, chipFamily, version, file))
@@ -244,24 +241,40 @@ def parse_filename(file, version, variant, file_suffix):
manifest['new_install_prompt_erase'] = True
manifest['build_flags'] = build_flags
parts = dict([('path', file), ('offset', 0)])
if add_improv:
builds = dict([('chipFamily', chipFamily), ('chipVariant', chipVariant), ('improv', False), ('parts', [parts])])
if not chipVariant:
if add_improv:
builds = dict([('chipFamily', chipFamily), ('improv', True), ('parts', [parts])])
else:
builds = dict([('chipFamily', chipFamily), ('parts', [parts])])
else:
builds = dict([('chipFamily', chipFamily), ('chipVariant', chipVariant), ('parts', [parts])])
if add_improv:
builds = dict([('chipFamily', chipFamily), ('chipVariant', chipVariant), ('improv', False), ('parts', [parts])])
else:
builds = dict([('chipFamily', chipFamily), ('chipVariant', chipVariant), ('parts', [parts])])
manifest['builds'] = [builds]
manifest_binfiles[main_group][sub_group] = manifest
else:
parts = dict([('path', file), ('offset', 0)])
if add_improv:
builds = dict([('chipFamily', chipFamily), ('chipVariant', chipVariant), ('improv', False), ('parts', [parts])])
if not chipVariant:
if add_improv:
builds = dict([('chipFamily', chipFamily), ('improv', True), ('parts', [parts])])
else:
builds = dict([('chipFamily', chipFamily), ('parts', [parts])])
else:
builds = dict([('chipFamily', chipFamily), ('chipVariant', chipVariant), ('parts', [parts])])
if add_improv:
builds = dict([('chipFamily', chipFamily), ('chipVariant', chipVariant), ('improv', False), ('parts', [parts])])
else:
builds = dict([('chipFamily', chipFamily), ('chipVariant', chipVariant), ('parts', [parts])])
manifest_binfiles[main_group][sub_group]['builds'].append(builds)
manifest_binfiles[main_group][sub_group]['families'].append(chipFamily)
display_string = create_display_text(description, version, manifest_binfiles[main_group][sub_group]['families'])
manifest_binfiles[main_group][sub_group]['displaytext'] = display_string
manifest_binfiles[main_group][sub_group]['manifestfilename'] = '{}{}'.format(sub_group, manifest_suff)
if 'ESP8266' in main_group:
manifest_binfiles[main_group][sub_group]['manifestfilename'] = '{}_ESP8266{}'.format(sub_group, manifest_suff)
else:
manifest_binfiles[main_group][sub_group]['manifestfilename'] = '{}{}'.format(sub_group, manifest_suff)
@@ -305,15 +318,6 @@ def generate_manifest_files(bin_folder, output_prefix):
'Custom Misc',
'Misc']
main_group_list_littlefs = []
main_group_list_spiffs = []
for main_group in main_group_list:
main_group_list_littlefs.append("{} {}".format(main_group, 'ESP32'))
main_group_list_spiffs.append("{} {}".format(main_group, 'ESP8266'))
main_group_list_littlefs.extend(main_group_list_spiffs)
main_group_list = main_group_list_littlefs
for main_group in main_group_list:
if main_group in manifest_binfiles:
@@ -379,7 +383,7 @@ def generate_manifest_files(bin_folder, output_prefix):
' </style>\n',
' <script\n',
' type="module"\n',
' src="https://unpkg.com/tasmota-esp-web-tools@8.1.14/dist/web/install-button.js?module"\n',
' src="https://unpkg.com/tasmota-esp-web-tools@10.0.3/dist/web/install-button.js?module"\n',
' ></script>\n',
' </head>\n',
' <body>\n',