Increase ESP32 SwitchText to 28

This commit is contained in:
Theo Arends 2021-02-05 16:36:25 +01:00
parent 8d13e913dd
commit e05b77c372
5 changed files with 22 additions and 16 deletions

View File

@ -6,9 +6,9 @@ All notable changes to this project will be documented in this file.
## [9.2.0.6]
### Changed
- Removed migration support for versions before v8.1.0 (Doris)
- Increase number of switch GPIOs from 8 to 28
- Increase number of button GPIOs from 4 to 8
- ESP32 Increase number of switch GPIOs from 8 to 28
- ESP32 Increase number of interlock groups from 4 to 14
- Increase number of button GPIOs from 4 to 8
## [9.2.0.5] 20210205
### Changed

View File

@ -121,8 +121,8 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Force initial default state ``SetOption57 1`` to scan wifi network every 44 minutes for strongest signal [#10395](https://github.com/arendst/Tasmota/issues/10395)
- PubSubClient MQTT_SOCKET_TIMEOUT from 15 to 4 seconds
- Domoticz fixed 2 decimals resolution by user selectable ``TempRes``, ``HumRes`` and ``PressRes`` resolutions
- Increase number of switch GPIOs from 8 to 28
- Increase number of button GPIOs from 4 to 8
- ESP32 Increase number of switch GPIOs from 8 to 28
- ESP32 increase number of relay GPIOs from 8 to 28
- ESP32 Increase number of interlock groups from 4 to 14

View File

@ -343,8 +343,7 @@ struct {
// Start of char array storing all parameter strings ********
char text_pool[101]; // 017 Was ota_url[101] - size is settings_text_size
uint8_t text_pool_07c[37]; // 07C
char text_pool[138]; // 017 Size is settings_text_size
char ex_sta_ssid[2][33]; // 0A1
char ex_sta_pwd[2][65]; // 0E3
uint8_t text_pool_165[132]; // 165
@ -467,7 +466,7 @@ struct {
uint8_t knx_GA_registered; // 4A5 Number of Group Address to read
uint16_t light_wakeup; // 4A6
uint8_t knx_CB_registered; // 4A8 Number of Group Address to write
uint8_t switchmode[MAX_SWITCHES]; // 4A9
uint8_t switchmode[MAX_SWITCHES_SET]; // 4A9
uint8_t free_4c5[5]; // 4C5
@ -475,7 +474,7 @@ struct {
uint8_t free_4ce[2]; // 4CE
power_t interlock[MAX_INTERLOCK_GROUPS]; // 4D0 MAX_INTERLOCKS = MAX_RELAYS / 2
power_t interlock[MAX_INTERLOCKS_SET]; // 4D0 MAX_INTERLOCKS = MAX_RELAYS / 2
uint8_t free_508[41]; // 508

View File

@ -821,7 +821,7 @@ void SettingsDefaultSet2(void) {
Settings.param[P_HOLD_TIME] = KEY_HOLD_TIME; // Default 4 seconds hold time
// Switch
for (uint32_t i = 0; i < MAX_SWITCHES; i++) { Settings.switchmode[i] = SWITCH_MODE; }
for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) { Settings.switchmode[i] = SWITCH_MODE; }
// MQTT
flag.mqtt_enabled |= MQTT_USE;
@ -1225,10 +1225,10 @@ void SettingsDelta(void) {
Settings.flag3.use_wifi_rescan = true; // As a result of #10395
}
if (Settings.version < 0x09020006) {
for (uint32_t i = 0; i < MAX_SWITCHES; i++) {
for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) {
Settings.switchmode[i] = (i < 8) ? Settings.ex_switchmode[i] : SWITCH_MODE;
}
for (uint32_t i = 0; i < MAX_INTERLOCK_GROUPS; i++) {
for (uint32_t i = 0; i < MAX_INTERLOCKS_SET; i++) {
Settings.interlock[i] = (i < 4) ? Settings.ex_interlock[i] : 0;
}
}

View File

@ -50,17 +50,19 @@ const uint32_t POWER_MASK = 0xffffffffUL; // Power (Relay) full mask
#ifdef ESP8266
const uint8_t MAX_RELAYS = 8; // Max number of relays (up to 28)
const uint8_t MAX_INTERLOCKS = 4; // Max number of interlock groups (up to MAX_INTERLOCK_GROUPS)
const uint8_t MAX_INTERLOCKS = 4; // Max number of interlock groups (up to MAX_INTERLOCKS_SET)
const uint8_t MAX_SWITCHES = 8; // Max number of switches (up to MAX_SWITCHES_SET)
#endif // ESP8266
#ifdef ESP32
const uint8_t MAX_RELAYS = 28; // Max number of relays (up to 28)
const uint8_t MAX_INTERLOCKS = 14; // Max number of interlock groups (up to MAX_INTERLOCK_GROUPS)
const uint8_t MAX_INTERLOCKS = 14; // Max number of interlock groups (up to MAX_INTERLOCKS_SET)
const uint8_t MAX_SWITCHES = 28; // Max number of switches (up to MAX_SWITCHES_SET)
#endif // ESP32
const uint8_t MAX_KEYS = 8; // Max number of keys or buttons (up to 28)
// Changes to the following MAX_ defines will impact settings layout
const uint8_t MAX_INTERLOCK_GROUPS = 14; // Max number of interlock groups (MAX_RELAYS / 2)
const uint8_t MAX_SWITCHES = 28; // Max number of switches
const uint8_t MAX_INTERLOCKS_SET = 14; // Max number of interlock groups (MAX_RELAYS / 2)
const uint8_t MAX_SWITCHES_SET = 28; // Max number of switches
const uint8_t MAX_LEDS = 4; // Max number of leds
const uint8_t MAX_PWMS = 5; // Max number of PWM channels
const uint8_t MAX_COUNTERS = 4; // Max number of counter sensors
@ -94,11 +96,12 @@ const uint8_t MAX_GROUP_TOPICS = 4; // Max number of Group Topics
const uint8_t MAX_DEV_GROUP_NAMES = 4; // Max number of Device Group names
#ifdef ESP8266
const uint8_t MAX_ADCS = 1; // Max number of ESP8266 ADC pins
const uint8_t MAX_SWITCHES_TXT = 8; // Max number of switches user text
#endif // ESP8266
#ifdef ESP32
const uint8_t MAX_ADCS = 8; // Max number of ESP32 ADC pins (ADC2 pins are unusable with Wifi enabled)
const uint8_t MAX_SWITCHES_TXT = 28; // Max number of switches user text
#endif // ESP32
const uint8_t MAX_SWITCHES_TXT = 8; // Max number of switches user text
const uint8_t MAX_HUE_DEVICES = 15; // Max number of Philips Hue device per emulation
const uint8_t MAX_ROTARIES = 2; // Max number of Rotary Encoders
@ -318,11 +321,15 @@ enum SettingsTextIndex { SET_OTAURL,
SET_TELEGRAM_TOKEN, SET_TELEGRAM_CHATID,
#ifdef ESP8266
SET_ADC_PARAM1,
SET_SWITCH_TXT1, SET_SWITCH_TXT2, SET_SWITCH_TXT3, SET_SWITCH_TXT4, SET_SWITCH_TXT5, SET_SWITCH_TXT6, SET_SWITCH_TXT7, SET_SWITCH_TXT8, // MAX_SWITCHES_TXT
#endif // ESP8266
#ifdef ESP32
SET_ADC_PARAM1, SET_ADC_PARAM2, SET_ADC_PARAM3, SET_ADC_PARAM4, SET_ADC_PARAM5, SET_ADC_PARAM6, SET_ADC_PARAM7, SET_ADC_PARAM8, // MAX_ADCS
#endif // ESP32
SET_SWITCH_TXT1, SET_SWITCH_TXT2, SET_SWITCH_TXT3, SET_SWITCH_TXT4, SET_SWITCH_TXT5, SET_SWITCH_TXT6, SET_SWITCH_TXT7, SET_SWITCH_TXT8, // MAX_SWITCHES_TXT
SET_SWITCH_TXT9, SET_SWITCH_TXT10, SET_SWITCH_TXT11, SET_SWITCH_TXT12, SET_SWITCH_TXT13, SET_SWITCH_TXT14, SET_SWITCH_TXT15, SET_SWITCH_TXT16, // MAX_SWITCHES_TXT
SET_SWITCH_TXT17, SET_SWITCH_TXT18, SET_SWITCH_TXT19, SET_SWITCH_TXT20, SET_SWITCH_TXT21, SET_SWITCH_TXT22, SET_SWITCH_TXT23, SET_SWITCH_TXT24, // MAX_SWITCHES_TXT
SET_SWITCH_TXT25, SET_SWITCH_TXT26, SET_SWITCH_TXT27, SET_SWITCH_TXT28, // MAX_SWITCHES_TXT
#endif // ESP32
SET_SHD_PARAM,
SET_MAX };