6.2.1.19 Rename user_config.h

6.2.1.19 20181023
* Fix header file execution order by renaming user_config.h to my_user_config.h
* Fix Arduino IDE compilation warning regarding e-paper library
This commit is contained in:
Theo Arends 2018-10-23 15:51:51 +02:00
parent af5a4826ee
commit 2c02532e1c
9 changed files with 47 additions and 22 deletions

1
API.md
View File

@ -8,6 +8,7 @@ The following table lists Callback Ids and their availability for a Driver, Sens
Callback Id | Bool | Version | xdrv | xsns | xnrg | Description
----------------------------|------|----------|------|------|------|----------------------------------
FUNC_SETTINGS_OVERRIDE | | 6.2.1.19 | x | | | Override start-up settings
FUNC_MODULE_INIT | x | 6.2.1.17 | x | | | Init module specific parameters
FUNC_PRE_INIT | | | x | | x | Once GPIO have been established
FUNC_INIT | | | x | x | x | At end of initialisation

View File

@ -0,0 +1,9 @@
name=Waveshare esp 2.9 inch e-paper display driver
version=1.0
author=Gerhard Muntz
maintainer=Gerhard Muntz
sentence=ESP8266 library for Waveshare e-paper display.
paragraph=
category=Display
url=https://github.com/gemu2015/Sonoff-Tasmota/tree/displays/lib/esp-epaper-29-ws-20171230-gemu-1.0#
architectures=esp8266

View File

@ -1,4 +1,7 @@
/* 6.2.1.18 20181019
/* 6.2.1.19 20181023
* Fix header file execution order by renaming user_config.h to my_user_config.h
*
* 6.2.1.18 20181019
* Add more API callbacks and document API.md
* Add support for La Crosse TX20 Anemometer (#2654, #3146)
* Add optional HX711 scale interface to web GUI demonstrating easy GUI plug-in

View File

@ -1,5 +1,5 @@
/*
user_config.h - user specific configuration for Sonoff-Tasmota
my_user_config.h - user specific configuration for Sonoff-Tasmota
Copyright (C) 2018 Theo Arends
@ -17,8 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _USER_CONFIG_H_
#define _USER_CONFIG_H_
#ifndef _MY_USER_CONFIG_H_
#define _MY_USER_CONFIG_H_
/*********************************************************************************************\
* This file consists of TWO sections.
@ -410,4 +410,4 @@
#error "Select either USE_MQTT_TLS or USE_WEBSERVER as there is just not enough memory to play with"
#endif
#endif // _USER_CONFIG_H_
#endif // _MY_USER_CONFIG_H_

View File

@ -212,10 +212,13 @@ enum LightTypes {LT_BASIC, LT_PWM1, LT_PWM2, LT_PWM3, LT_PWM4, LT_PWM5, LT_PWM6,
enum LichtSubtypes {LST_NONE, LST_SINGLE, LST_COLDWARM, LST_RGB, LST_RGBW, LST_RGBWC};
enum LichtSchemes {LS_POWER, LS_WAKEUP, LS_CYCLEUP, LS_CYCLEDN, LS_RANDOM, LS_MAX};
enum XsnsFunctions {FUNC_MODULE_INIT, FUNC_PRE_INIT, FUNC_INIT, FUNC_LOOP, FUNC_EVERY_50_MSECOND, FUNC_EVERY_100_MSECOND, FUNC_EVERY_200_MSECOND, FUNC_EVERY_250_MSECOND, FUNC_EVERY_SECOND,
enum XsnsFunctions {FUNC_SETTINGS_OVERRIDE, FUNC_MODULE_INIT, FUNC_PRE_INIT, FUNC_INIT,
FUNC_LOOP, FUNC_EVERY_50_MSECOND, FUNC_EVERY_100_MSECOND, FUNC_EVERY_200_MSECOND, FUNC_EVERY_250_MSECOND, FUNC_EVERY_SECOND,
FUNC_PREP_BEFORE_TELEPERIOD, FUNC_JSON_APPEND, FUNC_WEB_APPEND, FUNC_SAVE_BEFORE_RESTART, FUNC_COMMAND,
FUNC_MQTT_SUBSCRIBE, FUNC_MQTT_INIT, FUNC_MQTT_DATA, FUNC_SET_POWER, FUNC_SET_DEVICE_POWER, FUNC_SHOW_SENSOR,
FUNC_RULES_PROCESS, FUNC_SERIAL, FUNC_FREE_MEM, FUNC_BUTTON_PRESSED, FUNC_WEB_ADD_BUTTON, FUNC_WEB_ADD_MAIN_BUTTON, FUNC_WEB_ADD_HANDLER};
FUNC_MQTT_SUBSCRIBE, FUNC_MQTT_INIT, FUNC_MQTT_DATA,
FUNC_SET_POWER, FUNC_SET_DEVICE_POWER, FUNC_SHOW_SENSOR,
FUNC_RULES_PROCESS, FUNC_SERIAL, FUNC_FREE_MEM, FUNC_BUTTON_PRESSED,
FUNC_WEB_ADD_BUTTON, FUNC_WEB_ADD_MAIN_BUTTON, FUNC_WEB_ADD_HANDLER};
const uint8_t kDefaultRfCode[9] PROGMEM = { 0x21, 0x16, 0x01, 0x0E, 0x03, 0x48, 0x2E, 0x1A, 0x00 };

View File

@ -28,13 +28,13 @@
// Location specific includes
#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)
#include "sonoff_version.h" // Sonoff-Tasmota version information
#include "sonoff.h" // Enumeration used in user_config.h
#include "user_config.h" // Fixed user configurable options
#include "sonoff.h" // Enumeration used in my_user_config.h
#include "my_user_config.h" // Fixed user configurable options
#ifdef USE_CONFIG_OVERRIDE
#include "user_config_override.h" // Configuration overrides for user_config.h
#include "user_config_override.h" // Configuration overrides for my_user_config.h
#endif
#include "sonoff_post.h" // Configuration overrides for all previous includes
#include "i18n.h" // Language support configured by user_config.h
#include "i18n.h" // Language support configured by my_user_config.h
#include "sonoff_template.h" // Hardware configuration
#ifdef ARDUINO_ESP8266_RELEASE_2_4_0
@ -2575,6 +2575,10 @@ void setup()
GetFeatures();
if (1 == RtcReboot.fast_reboot_count) { // Allow setting override only when all is well
XdrvCall(FUNC_SETTINGS_OVERRIDE);
}
baudrate = Settings.baudrate * 1200;
seriallog_level = Settings.seriallog_level;
seriallog_timer = SERIALLOG_TIMER;
@ -2587,19 +2591,19 @@ void setup()
sleep = Settings.sleep;
// Disable functionality as possible cause of fast restart within BOOT_LOOP_TIME seconds (Exception, WDT or restarts)
if (RtcReboot.fast_reboot_count > 1) { // Restart twice
if (RtcReboot.fast_reboot_count > 1) { // Restart twice
Settings.flag3.user_esp8285_enable = 0; // Disable ESP8285 Generic GPIOs interfering with flash SPI
if (RtcReboot.fast_reboot_count > 2) { // Restart 3 times
if (RtcReboot.fast_reboot_count > 2) { // Restart 3 times
for (byte i = 0; i < MAX_RULE_SETS; i++) {
if (bitRead(Settings.rule_stop, i)) {
bitWrite(Settings.rule_enabled, i, 0); // Disable rules causing boot loop
}
}
}
if (RtcReboot.fast_reboot_count > 3) { // Restarted 4 times
if (RtcReboot.fast_reboot_count > 3) { // Restarted 4 times
Settings.rule_enabled = 0; // Disable all rules
}
if (RtcReboot.fast_reboot_count > 4) { // Restarted 5 times
if (RtcReboot.fast_reboot_count > 4) { // Restarted 5 times
Settings.module = SONOFF_BASIC; // Reset module to Sonoff Basic
Settings.last_module = SONOFF_BASIC;
for (byte i = 0; i < MAX_GPIO_PIN; i++) {

View File

@ -1,5 +1,5 @@
/*
user_config_override.h - user configuration overrides user_config.h for Sonoff-Tasmota
user_config_override.h - user configuration overrides my_user_config.h for Sonoff-Tasmota
Copyright (C) 2018 Theo Arends
@ -25,7 +25,7 @@
/*****************************************************************************************************\
* USAGE:
* To modify the stock configuration without changing the user_config.h file:
* To modify the stock configuration without changing the my_user_config.h file:
* (1) copy this file to "user_config_override.h" (It will be ignored by Git)
* (2) define your own settings below
* (3) for platformio:
@ -33,12 +33,12 @@
* ie1 : export PLATFORMIO_BUILD_FLAGS='-DUSE_CONFIG_OVERRIDE'
* ie2 : enable in file platformio.ini "build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CONFIG_OVERRIDE"
* for Arduino IDE:
* enable define USE_CONFIG_OVERRIDE in user_config.h
* enable define USE_CONFIG_OVERRIDE in my_user_config.h
******************************************************************************************************
* ATTENTION:
* - Changes to SECTION1 PARAMETER defines will only override flash settings if you change define CFG_HOLDER.
* - Expect compiler warnings when no ifdef/undef/endif sequence is used.
* - You still need to update user_config.h for major define USE_MQTT_TLS.
* - You still need to update my_user_config.h for major define USE_MQTT_TLS.
* - All parameters can be persistent changed online using commands via MQTT, WebConsole or Serial.
\*****************************************************************************************************/

View File

@ -141,7 +141,7 @@ void MP3PlayerInit(void) {
delay(1000);
MP3_CMD(MP3_CMD_RESET, MP3_CMD_RESET_VALUE); // reset the player to defaults
delay(3000);
MP3_CMD(MP3_CMD_VOLUME, MP3_VOLUME); // after reset set volume depending on the entry in the user_config.h
MP3_CMD(MP3_CMD_VOLUME, MP3_VOLUME); // after reset set volume depending on the entry in the my_user_config.h
}
return;
}
@ -167,7 +167,7 @@ void MP3_CMD(uint8_t mp3cmd,uint16_t val) {
MP3Player->write(cmd, sizeof(cmd)); // write mp3 data array to player
delay(1000);
if (mp3cmd == MP3_CMD_RESET) {
MP3_CMD(MP3_CMD_VOLUME, MP3_VOLUME); // after reset set volume depending on the entry in the user_config.h
MP3_CMD(MP3_CMD_VOLUME, MP3_VOLUME); // after reset set volume depending on the entry in the my_user_config.h
}
return;
}

View File

@ -215,6 +215,11 @@ bool HxCommand()
/*********************************************************************************************/
long HxWeight()
{
return (hx_calibrate_step < HX_CAL_FAIL) ? hx_weight : 0;
}
void HxInit()
{
hx_type = 0;