mirror of https://github.com/arendst/Tasmota.git
v6.0.0b - Support up to 8 switches
6.0.0b * Change number of switches from 4 to 8 (#2885, #3086)
This commit is contained in:
parent
20a53950ff
commit
6e9602418d
|
@ -1,4 +1,7 @@
|
|||
/* 6.0.0a
|
||||
/* 6.0.0b
|
||||
* Change number of switches from 4 to 8 (#2885, #3086)
|
||||
*
|
||||
* 6.0.0a
|
||||
* Add support for APDS9960 proximity sensor (#3051)
|
||||
* Add increment and decrement value to command Counter (#2838)
|
||||
* Add option 0 to command Timers disarming all timers (#2962)
|
||||
|
|
|
@ -216,8 +216,9 @@ struct SYSCFG {
|
|||
uint16_t blinkcount; // 39C
|
||||
uint16_t light_rotation; // 39E
|
||||
|
||||
byte free_3A0[12]; // 3A9
|
||||
byte free_3A0[4]; // 3A0
|
||||
|
||||
uint8_t switchmode[MAX_SWITCHES]; // 3A4 (6.0.0b - moved from 0x4CA)
|
||||
char friendlyname[MAX_FRIENDLYNAMES][33]; // 3AC
|
||||
char switch_topic[33]; // 430
|
||||
char serial_delimiter; // 451
|
||||
|
@ -243,7 +244,9 @@ struct SYSCFG {
|
|||
uint16_t light_wakeup; // 4A6
|
||||
byte knx_CB_registered; // 4A8 Number of Group Address to write
|
||||
char web_password[33]; // 4A9
|
||||
uint8_t switchmode[MAX_SWITCHES]; // 4CA
|
||||
|
||||
uint8_t ex_switchmode[4]; // 4CA Free since 6.0.0a
|
||||
|
||||
char ntp_server[3][33]; // 4CE
|
||||
byte ina219_mode; // 531
|
||||
uint16_t pulse_timer[MAX_PULSETIMERS]; // 532
|
||||
|
|
|
@ -763,6 +763,20 @@ void SettingsDelta()
|
|||
Settings.cfg_size = sizeof(SYSCFG);
|
||||
Settings.cfg_crc = GetSettingsCrc();
|
||||
}
|
||||
if (Settings.version < 0x06000002) {
|
||||
for (byte i = 0; i < MAX_SWITCHES; i++) {
|
||||
if (i < 4) {
|
||||
Settings.switchmode[i] = Settings.ex_switchmode[i];
|
||||
} else {
|
||||
Settings.switchmode[i] = SWITCH_MODE;
|
||||
}
|
||||
}
|
||||
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
||||
if (Settings.my_gp.io[i] >= GPIO_SWT5) { // Move up from GPIO_SWT5 to GPIO_KEY1
|
||||
Settings.my_gp.io[i] += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Settings.version = VERSION;
|
||||
SettingsSave(1);
|
||||
|
|
|
@ -37,10 +37,10 @@ typedef unsigned long power_t; // Power (Relay) type
|
|||
\*********************************************************************************************/
|
||||
|
||||
// Changes to the following MAX_ defines will impact settings layout
|
||||
#define MAX_SWITCHES 8 // Max number of switches
|
||||
#define MAX_RELAYS 8 // Max number of relays
|
||||
#define MAX_LEDS 4 // Max number of leds
|
||||
#define MAX_KEYS 4 // Max number of keys or buttons
|
||||
#define MAX_SWITCHES 4 // Max number of switches
|
||||
#define MAX_PWMS 5 // Max number of PWM channels
|
||||
#define MAX_COUNTERS 4 // Max number of counter sensors
|
||||
#define MAX_TIMERS 16 // Max number of Timers
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
||||
====================================================*/
|
||||
|
||||
#define VERSION 0x06000001 // 6.0.0a
|
||||
#define VERSION 0x06000002 // 6.0.0b
|
||||
|
||||
// Location specific includes
|
||||
#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)
|
||||
|
|
|
@ -35,6 +35,10 @@ enum UserSelectablePins {
|
|||
GPIO_SWT2,
|
||||
GPIO_SWT3,
|
||||
GPIO_SWT4,
|
||||
GPIO_SWT5,
|
||||
GPIO_SWT6,
|
||||
GPIO_SWT7,
|
||||
GPIO_SWT8,
|
||||
GPIO_KEY1, // Button usually connected to GPIO0
|
||||
GPIO_KEY2,
|
||||
GPIO_KEY3,
|
||||
|
@ -124,7 +128,7 @@ const char kSensorNames[] PROGMEM =
|
|||
D_SENSOR_I2C_SCL "|" D_SENSOR_I2C_SDA "|"
|
||||
D_SENSOR_WS2812 "|"
|
||||
D_SENSOR_IRSEND "|"
|
||||
D_SENSOR_SWITCH "1|" D_SENSOR_SWITCH "2|" D_SENSOR_SWITCH "3|" D_SENSOR_SWITCH "4|"
|
||||
D_SENSOR_SWITCH "1|" D_SENSOR_SWITCH "2|" D_SENSOR_SWITCH "3|" D_SENSOR_SWITCH "4|" D_SENSOR_SWITCH "5|" D_SENSOR_SWITCH "6|" D_SENSOR_SWITCH "7|" D_SENSOR_SWITCH "8|"
|
||||
D_SENSOR_BUTTON "1|" D_SENSOR_BUTTON "2|" D_SENSOR_BUTTON "3|" D_SENSOR_BUTTON "4|"
|
||||
D_SENSOR_RELAY "1|" D_SENSOR_RELAY "2|" D_SENSOR_RELAY "3|" D_SENSOR_RELAY "4|" D_SENSOR_RELAY "5|" D_SENSOR_RELAY "6|" D_SENSOR_RELAY "7|" D_SENSOR_RELAY "8|"
|
||||
D_SENSOR_RELAY "1i|" D_SENSOR_RELAY "2i|" D_SENSOR_RELAY "3i|" D_SENSOR_RELAY "4i|" D_SENSOR_RELAY "5i|" D_SENSOR_RELAY "6i|" D_SENSOR_RELAY "7i|" D_SENSOR_RELAY "8i|"
|
||||
|
|
Loading…
Reference in New Issue