mirror of https://github.com/arendst/Tasmota.git
Fix compile regression
This commit is contained in:
parent
58c8841299
commit
89d99a7851
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Settings->h - setting variables for Tasmota
|
settings.h - setting variables for Tasmota
|
||||||
|
|
||||||
Copyright (C) 2021 Theo Arends
|
Copyright (C) 2021 Theo Arends
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Settings->ino - user settings for Tasmota
|
settings.ino - user settings for Tasmota
|
||||||
|
|
||||||
Copyright (C) 2021 Theo Arends
|
Copyright (C) 2021 Theo Arends
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ String EthernetMacAddress(void);
|
||||||
#define FS_FILE_APPEND "a"
|
#define FS_FILE_APPEND "a"
|
||||||
|
|
||||||
#define TASM_FILE_SETTINGS "/.settings" // Settings binary blob
|
#define TASM_FILE_SETTINGS "/.settings" // Settings binary blob
|
||||||
#define TASM_FILE_SETTINGS_LKG "/.Settings->lkg" // Last Known Good Settings binary blob
|
#define TASM_FILE_SETTINGS_LKG "/.settings.lkg" // Last Known Good Settings binary blob
|
||||||
#define TASM_FILE_DRIVER "/.drvset%03d"
|
#define TASM_FILE_DRIVER "/.drvset%03d"
|
||||||
#define TASM_FILE_SENSOR "/.snsset%03d"
|
#define TASM_FILE_SENSOR "/.snsset%03d"
|
||||||
#define TASM_FILE_TLSKEY "/tlskey" // TLS private key
|
#define TASM_FILE_TLSKEY "/tlskey" // TLS private key
|
||||||
|
|
|
@ -892,7 +892,7 @@ public:
|
||||||
calcLevels();
|
calcLevels();
|
||||||
}
|
}
|
||||||
|
|
||||||
// save the current light state to Settings->
|
// save the current light state to Settings
|
||||||
void saveSettings() {
|
void saveSettings() {
|
||||||
if (Light.pwm_multi_channels) {
|
if (Light.pwm_multi_channels) {
|
||||||
// simply save each channel
|
// simply save each channel
|
||||||
|
|
|
@ -39,7 +39,7 @@ void (* const DomoticzCommand[])(void) PROGMEM = {
|
||||||
const char DOMOTICZ_MESSAGE[] PROGMEM = "{\"idx\":%d,\"nvalue\":%d,\"svalue\":\"%s\",\"Battery\":%d,\"RSSI\":%d}";
|
const char DOMOTICZ_MESSAGE[] PROGMEM = "{\"idx\":%d,\"nvalue\":%d,\"svalue\":\"%s\",\"Battery\":%d,\"RSSI\":%d}";
|
||||||
|
|
||||||
#if MAX_DOMOTICZ_SNS_IDX < DZ_MAX_SENSORS
|
#if MAX_DOMOTICZ_SNS_IDX < DZ_MAX_SENSORS
|
||||||
#error "Domoticz: Too many sensors or change Settings->h layout"
|
#error "Domoticz: Too many sensors or change settings.h layout"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char kDomoticzSensors[] PROGMEM =
|
const char kDomoticzSensors[] PROGMEM =
|
||||||
|
|
|
@ -34,7 +34,7 @@ Constants in tasmota.h
|
||||||
#define MAX_CALLBACKS 10
|
#define MAX_CALLBACKS 10
|
||||||
Both to MAX_KNX_CB
|
Both to MAX_KNX_CB
|
||||||
|
|
||||||
Variables in Settings->h
|
Variables in settings.h
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
bool Settings->flag.knx_enabled Enable/Disable KNX Protocol
|
bool Settings->flag.knx_enabled Enable/Disable KNX Protocol
|
||||||
|
|
|
@ -103,12 +103,12 @@ struct miel_hvac_data {
|
||||||
|
|
||||||
CTASSERT(sizeof(struct miel_hvac_data) == 16);
|
CTASSERT(sizeof(struct miel_hvac_data) == 16);
|
||||||
|
|
||||||
CTASSERT(offsetof(struct miel_hvac_data, data.Settings->power) == 3);
|
CTASSERT(offsetof(struct miel_hvac_data, data.settings.power) == 3);
|
||||||
CTASSERT(offsetof(struct miel_hvac_data, data.Settings->mode) == 4);
|
CTASSERT(offsetof(struct miel_hvac_data, data.settings.mode) == 4);
|
||||||
CTASSERT(offsetof(struct miel_hvac_data, data.Settings->temp) == 5);
|
CTASSERT(offsetof(struct miel_hvac_data, data.settings.temp) == 5);
|
||||||
CTASSERT(offsetof(struct miel_hvac_data, data.Settings->fan) == 6);
|
CTASSERT(offsetof(struct miel_hvac_data, data.settings.fan) == 6);
|
||||||
CTASSERT(offsetof(struct miel_hvac_data, data.Settings->vane) == 7);
|
CTASSERT(offsetof(struct miel_hvac_data, data.settings.vane) == 7);
|
||||||
CTASSERT(offsetof(struct miel_hvac_data, data.Settings->widevane) == 10);
|
CTASSERT(offsetof(struct miel_hvac_data, data.settings.widevane) == 10);
|
||||||
|
|
||||||
CTASSERT(offsetof(struct miel_hvac_data, data.roomtemp.temp) == 3);
|
CTASSERT(offsetof(struct miel_hvac_data, data.roomtemp.temp) == 3);
|
||||||
|
|
||||||
|
@ -854,7 +854,7 @@ static void
|
||||||
miel_hvac_publish_settings(struct miel_hvac_softc *sc)
|
miel_hvac_publish_settings(struct miel_hvac_softc *sc)
|
||||||
{
|
{
|
||||||
const struct miel_hvac_data_settings *set =
|
const struct miel_hvac_data_settings *set =
|
||||||
&sc->sc_Settings->data.settings;
|
&sc->sc_settings.data.settings;
|
||||||
char hex[(sizeof(sc->sc_settings) + 1) * 2];
|
char hex[(sizeof(sc->sc_settings) + 1) * 2];
|
||||||
char temp[33];
|
char temp[33];
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
|
@ -61,16 +61,16 @@ void CmndDrvText(void) {
|
||||||
if (!XdrvMailbox.usridx) {
|
if (!XdrvMailbox.usridx) {
|
||||||
// Command DrvText
|
// Command DrvText
|
||||||
for (uint32_t i = 0; i < DRV98_MAX_DRV_TEXT; i++) {
|
for (uint32_t i = 0; i < DRV98_MAX_DRV_TEXT; i++) {
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("DRV: DrvText%02d %s"), i, Drv98Settings->drv_text[i]);
|
AddLog(LOG_LEVEL_DEBUG, PSTR("DRV: DrvText%02d %s"), i, Drv98Settings.drv_text[i]);
|
||||||
}
|
}
|
||||||
ResponseCmndDone();
|
ResponseCmndDone();
|
||||||
} else {
|
} else {
|
||||||
// Command DrvText<index> <text>
|
// Command DrvText<index> <text>
|
||||||
uint32_t index = XdrvMailbox.index -1;
|
uint32_t index = XdrvMailbox.index -1;
|
||||||
if (XdrvMailbox.data_len > 0) {
|
if (XdrvMailbox.data_len > 0) {
|
||||||
snprintf_P(Drv98Settings->drv_text[index], sizeof(Drv98Settings->drv_text[index]), XdrvMailbox.data);
|
snprintf_P(Drv98Settings.drv_text[index], sizeof(Drv98Settings.drv_text[index]), XdrvMailbox.data);
|
||||||
}
|
}
|
||||||
ResponseCmndIdxChar(Drv98Settings->drv_text[index]);
|
ResponseCmndIdxChar(Drv98Settings.drv_text[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,15 +90,15 @@ void DrvDemoSettingsDefault(void) {
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR("DRV: " D_USE_DEFAULTS));
|
AddLog(LOG_LEVEL_INFO, PSTR("DRV: " D_USE_DEFAULTS));
|
||||||
|
|
||||||
memset(&Drv98Settings, 0x00, sizeof(Drv98Settings));
|
memset(&Drv98Settings, 0x00, sizeof(Drv98Settings));
|
||||||
Drv98Settings->version = DRV98_VERSION;
|
Drv98Settings.version = DRV98_VERSION;
|
||||||
// Init any other parameter in struct Drv98Settings
|
// Init any other parameter in struct Drv98Settings
|
||||||
snprintf_P(Drv98Settings->drv_text[0], sizeof(Drv98Settings->drv_text[0]), PSTR("Azalea"));
|
snprintf_P(Drv98Settings.drv_text[0], sizeof(Drv98Settings.drv_text[0]), PSTR("Azalea"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrvDemoSettingsDelta(void) {
|
void DrvDemoSettingsDelta(void) {
|
||||||
// Fix possible setting deltas
|
// Fix possible setting deltas
|
||||||
|
|
||||||
if (Drv98Settings->version != DRV98_VERSION) { // Fix version dependent changes
|
if (Drv98Settings.version != DRV98_VERSION) { // Fix version dependent changes
|
||||||
|
|
||||||
if (Settings->version < 0x01010100) {
|
if (Settings->version < 0x01010100) {
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR("DRV: Update oldest version restore"));
|
AddLog(LOG_LEVEL_INFO, PSTR("DRV: Update oldest version restore"));
|
||||||
|
@ -110,7 +110,7 @@ void DrvDemoSettingsDelta(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set current version and save settings
|
// Set current version and save settings
|
||||||
Drv98Settings->version = DRV98_VERSION;
|
Drv98Settings.version = DRV98_VERSION;
|
||||||
DrvDemoSettingsSave();
|
DrvDemoSettingsSave();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,15 +142,15 @@ void DrvDemoSettingsLoad(void) {
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR("DRV: ERROR File system not enabled"));
|
AddLog(LOG_LEVEL_INFO, PSTR("DRV: ERROR File system not enabled"));
|
||||||
#endif // USE_UFILESYS
|
#endif // USE_UFILESYS
|
||||||
|
|
||||||
Drv98Settings->crc32 = DrvDemoSettingsCrc32();
|
Drv98Settings.crc32 = DrvDemoSettingsCrc32();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrvDemoSettingsSave(void) {
|
void DrvDemoSettingsSave(void) {
|
||||||
// Called from FUNC_SAVE_SETTINGS every SaveData second and at restart
|
// Called from FUNC_SAVE_SETTINGS every SaveData second and at restart
|
||||||
|
|
||||||
if (DrvDemoSettingsCrc32() != Drv98Settings->crc32) {
|
if (DrvDemoSettingsCrc32() != Drv98Settings.crc32) {
|
||||||
// Try to save file /.drvset098
|
// Try to save file /.drvset098
|
||||||
Drv98Settings->crc32 = DrvDemoSettingsCrc32();
|
Drv98Settings.crc32 = DrvDemoSettingsCrc32();
|
||||||
|
|
||||||
char filename[20];
|
char filename[20];
|
||||||
// Use for sensors:
|
// Use for sensors:
|
||||||
|
|
Loading…
Reference in New Issue