Refactor feature list build

This commit is contained in:
Theo Arends 2020-10-28 11:37:59 +01:00
parent 6be04996b4
commit 85d2626e84
7 changed files with 281 additions and 284 deletions

View File

@ -134,6 +134,7 @@
| USE_EZOCO2 | - | - | - | - | - | - | - | | USE_EZOCO2 | - | - | - | - | - | - | - |
| USE_EZOEC | - | - | - | - | - | - | - | | USE_EZOEC | - | - | - | - | - | - | - |
| USE_EZOHUM | - | - | - | - | - | - | - | | USE_EZOHUM | - | - | - | - | - | - | - |
| USE_EZOO2 | - | - | - | - | - | - | - |
| USE_EZOORP | - | - | - | - | - | - | - | | USE_EZOORP | - | - | - | - | - | - | - |
| USE_EZOPH | - | - | - | - | - | - | - | | USE_EZOPH | - | - | - | - | - | - | - |
| USE_EZORTD | - | - | - | - | - | - | - | | USE_EZORTD | - | - | - | - | - | - | - |

View File

@ -5,10 +5,13 @@ All notable changes to this project will be documented in this file.
## [9.0.0.3] ## [9.0.0.3]
### Added ### Added
- TLS in binary tasmota-zbbridge (#9620) - TLS in binary tasmota-zbbridge (#9635)
- Support for EZO O2 sensors by Christopher Tremblay (#9619)
- Zigbee reduce battery drain (#9642)
### Changed ### Changed
- PlatformIO library structure redesigned for compilation speed by Jason2866 - PlatformIO library structure redesigned for compilation speed by Jason2866
- Zigbee flash storage refactor adding commands ``ZbProbe``, ``ZbStatus2`` and ``ZbRestore`` (#9641)
### Fixed ### Fixed
- Rule Break not working as expected when ONCE is enabled (#9245) - Rule Break not working as expected when ONCE is enabled (#9245)

View File

@ -73,9 +73,10 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Support for analog buttons indexed within standard button range - Support for analog buttons indexed within standard button range
- Support for Vietnamese language translations by Tâm.NT - Support for Vietnamese language translations by Tâm.NT
- Support for timers in case of no-sunset permanent day by cybermaus (#9543) - Support for timers in case of no-sunset permanent day by cybermaus (#9543)
- Support for EZO CO2, EC, HUM, ORP, Ph and RTD sensors by Christopher Tremblay - Support for EZO CO2, EC, HUM, O2, ORP, Ph and RTD sensors by Christopher Tremblay
- Support for fixed output Hi or Lo GPIO selection - Support for fixed output Hi or Lo GPIO selection
- TLS in binary tasmota-zbbridge (#9620) - TLS in binary tasmota-zbbridge (#9620)
- Zigbee reduce battery drain (#9642)
- ESP32 support for Wireless-Tag WT32-ETH01 (#9496) - ESP32 support for Wireless-Tag WT32-ETH01 (#9496)
- ESP32 MI32 Beacon support, RSSI at TELEPERIOD, refactoring (#9609) - ESP32 MI32 Beacon support, RSSI at TELEPERIOD, refactoring (#9609)
@ -98,6 +99,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Tasmota Arduino Core v2.7.4.5 allowing webpassword over 47 characters (#9687) - Tasmota Arduino Core v2.7.4.5 allowing webpassword over 47 characters (#9687)
- Webserver code optimizations (#9580, #9590) - Webserver code optimizations (#9580, #9590)
- PlatformIO library structure redesigned for compilation speed by Jason2866 - PlatformIO library structure redesigned for compilation speed by Jason2866
- Zigbee flash storage refactor adding commands ``ZbProbe``, ``ZbStatus2`` and ``ZbRestore`` (#9641)
### Fixed ### Fixed
- Ledlink blink when no network connected regression from v8.3.1.4 (#9292) - Ledlink blink when no network connected regression from v8.3.1.4 (#9292)

View File

@ -488,8 +488,7 @@ void CmndStatus(void)
#ifdef ESP8266 #ifdef ESP8266
",\"" D_JSON_FLASHCHIPID "\":\"%06X\"" ",\"" D_JSON_FLASHCHIPID "\":\"%06X\""
#endif #endif
",\"FlashFrequency\":%d,\"" D_JSON_FLASHMODE "\":%d,\"" ",\"FlashFrequency\":%d,\"" D_JSON_FLASHMODE "\":%d"),
D_JSON_FEATURES "\":[\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\"]"),
ESP_getSketchSize()/1024, ESP.getFreeSketchSpace()/1024, ESP_getFreeHeap()/1024, ESP_getSketchSize()/1024, ESP.getFreeSketchSpace()/1024, ESP_getFreeHeap()/1024,
#ifdef ESP32 #ifdef ESP32
ESP.getPsramSize()/1024, ESP.getFreePsram()/1024, ESP.getPsramSize()/1024, ESP.getFreePsram()/1024,
@ -498,8 +497,8 @@ void CmndStatus(void)
#ifdef ESP8266 #ifdef ESP8266
, ESP.getFlashChipId() , ESP.getFlashChipId()
#endif #endif
, ESP.getFlashChipSpeed()/1000000, ESP.getFlashChipMode(), , ESP.getFlashChipSpeed()/1000000, ESP.getFlashChipMode());
LANGUAGE_LCID, feature_drv1, feature_drv2, feature_sns1, feature_sns2, feature5, feature6, feature7); ResponseAppendFeatures();
XsnsDriverState(); XsnsDriverState();
ResponseAppend_P(PSTR(",\"Sensors\":")); ResponseAppend_P(PSTR(",\"Sensors\":"));
XsnsSensorState(); XsnsSensorState();

View File

@ -21,413 +21,410 @@
* Fill feature list * Fill feature list
\*********************************************************************************************/ \*********************************************************************************************/
void GetFeatures(void) void ResponseAppendFeatures(void)
{ {
feature_drv1 = 0x00000000; static uint32_t feature1 = 0x00000000;
if (!feature1) { // Only fill this once
#if defined(USE_ENERGY_SENSOR) && defined(USE_ENERGY_MARGIN_DETECTION) #if defined(USE_ENERGY_SENSOR) && defined(USE_ENERGY_MARGIN_DETECTION)
feature_drv1 |= 0x00000001; // xdrv_03_energy.ino feature1 |= 0x00000001; // xdrv_03_energy.ino
#endif #endif
#ifdef USE_LIGHT #ifdef USE_LIGHT
feature_drv1 |= 0x00000002; // tasmota.ino, xdrv_04_light.ino feature1 |= 0x00000002; // tasmota.ino, xdrv_04_light.ino
#endif #endif
#ifdef USE_I2C #ifdef USE_I2C
feature_drv1 |= 0x00000004; // tasmota.ino feature1 |= 0x00000004; // tasmota.ino
#endif #endif
#ifdef USE_SPI #ifdef USE_SPI
feature_drv1 |= 0x00000008; // tasmota.ino feature1 |= 0x00000008; // tasmota.ino
#endif #endif
#ifdef USE_DISCOVERY #ifdef USE_DISCOVERY
feature_drv1 |= 0x00000010; // tasmota.ino feature1 |= 0x00000010; // tasmota.ino
#endif #endif
#ifdef USE_ARDUINO_OTA #ifdef USE_ARDUINO_OTA
feature_drv1 |= 0x00000020; // tasmota.ino feature1 |= 0x00000020; // tasmota.ino
#endif #endif
#ifdef USE_MQTT_TLS #ifdef USE_MQTT_TLS
feature_drv1 |= 0x00000040; // xdrv_02_mqtt.ino feature1 |= 0x00000040; // xdrv_02_mqtt.ino
#endif #endif
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
feature_drv1 |= 0x00000080; // xdrv_01_webserver.ino feature1 |= 0x00000080; // xdrv_01_webserver.ino
#endif #endif
#if defined(USE_WEBSERVER) && defined(WEBSERVER_ADVERTISE) #if defined(USE_WEBSERVER) && defined(WEBSERVER_ADVERTISE)
feature_drv1 |= 0x00000100; // xdrv_01_webserver.ino feature1 |= 0x00000100; // xdrv_01_webserver.ino
#endif #endif
#if defined(USE_WEBSERVER) && defined(USE_EMULATION_HUE) #if defined(USE_WEBSERVER) && defined(USE_EMULATION_HUE)
feature_drv1 |= 0x00000200; // xdrv_20_hue.ino feature1 |= 0x00000200; // xdrv_20_hue.ino
#endif #endif
//#if (MQTT_LIBRARY_TYPE == MQTT_PUBSUBCLIENT) //#if (MQTT_LIBRARY_TYPE == MQTT_PUBSUBCLIENT)
feature_drv1 |= 0x00000400; // xdrv_02_mqtt.ino feature1 |= 0x00000400; // xdrv_02_mqtt.ino
//#endif //#endif
//#if (MQTT_LIBRARY_TYPE == MQTT_TASMOTAMQTT) //#if (MQTT_LIBRARY_TYPE == MQTT_TASMOTAMQTT)
// feature_drv1 |= 0x00000800; // xdrv_02_mqtt.ino // feature1 |= 0x00000800; // xdrv_02_mqtt.ino
//#endif //#endif
//#if (MQTT_LIBRARY_TYPE == MQTT_ESPMQTTARDUINO) // Obsolete since 6.2.1.11 //#if (MQTT_LIBRARY_TYPE == MQTT_ESPMQTTARDUINO) // Obsolete since 6.2.1.11
// feature_drv1 |= 0x00001000; // xdrv_02_mqtt.ino // feature1 |= 0x00001000; // xdrv_02_mqtt.ino
//#endif //#endif
#if defined(USE_DISCOVERY) && defined(MQTT_HOST_DISCOVERY) #if defined(USE_DISCOVERY) && defined(MQTT_HOST_DISCOVERY)
feature_drv1 |= 0x00002000; // xdrv_02_mqtt.ino feature1 |= 0x00002000; // xdrv_02_mqtt.ino
#endif #endif
#if defined(USE_LIGHT) && defined(USE_ARILUX_RF) #if defined(USE_LIGHT) && defined(USE_ARILUX_RF)
feature_drv1 |= 0x00004000; // xdrv_04_light.ino feature1 |= 0x00004000; // xdrv_04_light.ino
#endif #endif
#if defined(USE_LIGHT) && defined(USE_WS2812) #if defined(USE_LIGHT) && defined(USE_WS2812)
feature_drv1 |= 0x00008000; // xdrv_04_light.ino feature1 |= 0x00008000; // xdrv_04_light.ino
#endif #endif
#if defined(USE_LIGHT) && defined(USE_WS2812) && defined(USE_WS2812_DMA) #if defined(USE_LIGHT) && defined(USE_WS2812) && defined(USE_WS2812_DMA)
feature_drv1 |= 0x00010000; // xdrv_04_light.ino feature1 |= 0x00010000; // xdrv_04_light.ino
#endif #endif
#if defined(USE_IR_REMOTE) || defined(USE_IR_REMOTE_FULL) #if defined(USE_IR_REMOTE) || defined(USE_IR_REMOTE_FULL)
feature_drv1 |= 0x00020000; // xdrv_05_irremote.ino feature1 |= 0x00020000; // xdrv_05_irremote.ino
#endif #endif
#ifdef USE_IR_HVAC #ifdef USE_IR_HVAC
feature_drv1 |= 0x00040000; // xdrv_05_irremote.ino feature1 |= 0x00040000; // xdrv_05_irremote.ino
#endif #endif
#if defined(USE_IR_REMOTE) && defined(USE_IR_RECEIVE) #if defined(USE_IR_REMOTE) && defined(USE_IR_RECEIVE)
feature_drv1 |= 0x00080000; // xdrv_05_irremote.ino feature1 |= 0x00080000; // xdrv_05_irremote.ino
#endif #endif
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
feature_drv1 |= 0x00100000; // xdrv_07_domoticz.ino feature1 |= 0x00100000; // xdrv_07_domoticz.ino
#endif #endif
#ifdef USE_DISPLAY #ifdef USE_DISPLAY
feature_drv1 |= 0x00200000; // xdrv_13_display.ino feature1 |= 0x00200000; // xdrv_13_display.ino
#endif #endif
#ifdef USE_HOME_ASSISTANT #ifdef USE_HOME_ASSISTANT
feature_drv1 |= 0x00400000; // xdrv_12_home_assistant.ino feature1 |= 0x00400000; // xdrv_12_home_assistant.ino
#endif #endif
#ifdef USE_SERIAL_BRIDGE #ifdef USE_SERIAL_BRIDGE
feature_drv1 |= 0x00800000; // xdrv_08_serial_bridge.ino feature1 |= 0x00800000; // xdrv_08_serial_bridge.ino
#endif #endif
#ifdef USE_TIMERS #ifdef USE_TIMERS
feature_drv1 |= 0x01000000; // xdrv_09_timers.ino feature1 |= 0x01000000; // xdrv_09_timers.ino
#endif #endif
#if defined(USE_TIMERS) && defined(USE_SUNRISE) #if defined(USE_TIMERS) && defined(USE_SUNRISE)
feature_drv1 |= 0x02000000; // xdrv_09_timers.ino feature1 |= 0x02000000; // xdrv_09_timers.ino
#endif #endif
#if defined(USE_TIMERS) && defined(USE_TIMERS_WEB) #if defined(USE_TIMERS) && defined(USE_TIMERS_WEB)
feature_drv1 |= 0x04000000; // xdrv_09_timers.ino feature1 |= 0x04000000; // xdrv_09_timers.ino
#endif #endif
#ifdef USE_RULES #ifdef USE_RULES
feature_drv1 |= 0x08000000; // xdrv_10_rules.ino feature1 |= 0x08000000; // xdrv_10_rules.ino
#endif #endif
#ifdef USE_KNX #ifdef USE_KNX
feature_drv1 |= 0x10000000; // xdrv_11_knx.ino feature1 |= 0x10000000; // xdrv_11_knx.ino
#endif #endif
#ifdef USE_WPS #ifdef USE_WPS
feature_drv1 |= 0x20000000; // support.ino - removed with version 6.6.0.21 feature1 |= 0x20000000; // support.ino - removed with version 6.6.0.21
#endif #endif
#ifdef USE_SMARTCONFIG #ifdef USE_SMARTCONFIG
feature_drv1 |= 0x40000000; // support.ino - removed with version 6.6.0.21 feature1 |= 0x40000000; // support.ino - removed with version 6.6.0.21
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_ENERGY_POWER_LIMIT) #if defined(USE_ENERGY_SENSOR) && defined(USE_ENERGY_POWER_LIMIT)
feature_drv1 |= 0x80000000; // xdrv_03_energy.ino feature1 |= 0x80000000; // xdrv_03_energy.ino
#endif #endif
}
/*********************************************************************************************/ static uint32_t feature2 = 0x00000000;
if (!feature2) { // Only fill this once
feature_drv2 = 0x00000000;
#ifdef USE_CONFIG_OVERRIDE #ifdef USE_CONFIG_OVERRIDE
feature_drv2 |= 0x00000001; // user_config(_override).h feature2 |= 0x00000001; // user_config(_override).h
#endif #endif
#ifdef FIRMWARE_MINIMAL #ifdef FIRMWARE_MINIMAL
feature_drv2 |= 0x00000002; // user_config(_override).h feature2 |= 0x00000002; // user_config(_override).h
#endif #endif
#ifdef FIRMWARE_SENSORS #ifdef FIRMWARE_SENSORS
feature_drv2 |= 0x00000004; // user_config(_override).h feature2 |= 0x00000004; // user_config(_override).h
#endif #endif
#ifdef FIRMWARE_CLASSIC #ifdef FIRMWARE_CLASSIC
feature_drv2 |= 0x00000008; // user_config(_override).h feature2 |= 0x00000008; // user_config(_override).h
#endif #endif
#ifdef FIRMWARE_KNX_NO_EMULATION #ifdef FIRMWARE_KNX_NO_EMULATION
feature_drv2 |= 0x00000010; // user_config(_override).h feature2 |= 0x00000010; // user_config(_override).h
#endif #endif
#if defined(USE_DISPLAY) && defined(USE_DISPLAY_MODES1TO5) #if defined(USE_DISPLAY) && defined(USE_DISPLAY_MODES1TO5)
feature_drv2 |= 0x00000020; // xdrv_13_display.ino feature2 |= 0x00000020; // xdrv_13_display.ino
#endif #endif
#if defined(USE_DISPLAY) && defined(USE_DISPLAY_GRAPH) #if defined(USE_DISPLAY) && defined(USE_DISPLAY_GRAPH)
feature_drv2 |= 0x00000040; // xdrv_13_display.ino feature2 |= 0x00000040; // xdrv_13_display.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_DISPLAY) && defined(USE_DISPLAY_LCD) #if defined(USE_I2C) && defined(USE_DISPLAY) && defined(USE_DISPLAY_LCD)
feature_drv2 |= 0x00000080; // xdsp_01_lcd.ino feature2 |= 0x00000080; // xdsp_01_lcd.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_DISPLAY) && defined(USE_DISPLAY_SSD1306) #if defined(USE_I2C) && defined(USE_DISPLAY) && defined(USE_DISPLAY_SSD1306)
feature_drv2 |= 0x00000100; // xdsp_02_ssd1306.ino feature2 |= 0x00000100; // xdsp_02_ssd1306.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_DISPLAY) && defined(USE_DISPLAY_MATRIX) #if defined(USE_I2C) && defined(USE_DISPLAY) && defined(USE_DISPLAY_MATRIX)
feature_drv2 |= 0x00000200; // xdsp_03_matrix.ino feature2 |= 0x00000200; // xdsp_03_matrix.ino
#endif #endif
#if defined(USE_SPI) && defined(USE_DISPLAY) && defined(USE_DISPLAY_ILI9341) #if defined(USE_SPI) && defined(USE_DISPLAY) && defined(USE_DISPLAY_ILI9341)
feature_drv2 |= 0x00000400; // xdsp_04_ili9341.ino feature2 |= 0x00000400; // xdsp_04_ili9341.ino
#endif #endif
#if defined(USE_SPI) && defined(USE_DISPLAY) && defined(USE_DISPLAY_EPAPER_29) #if defined(USE_SPI) && defined(USE_DISPLAY) && defined(USE_DISPLAY_EPAPER_29)
feature_drv2 |= 0x00000800; // xdsp_05_epaper.ino feature2 |= 0x00000800; // xdsp_05_epaper.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_DISPLAY) && defined(USE_DISPLAY_SH1106) #if defined(USE_I2C) && defined(USE_DISPLAY) && defined(USE_DISPLAY_SH1106)
feature_drv2 |= 0x00001000; // xdsp_06_sh1106.ino feature2 |= 0x00001000; // xdsp_06_sh1106.ino
#endif #endif
#ifdef USE_MP3_PLAYER #ifdef USE_MP3_PLAYER
feature_drv2 |= 0x00002000; // xdrv_14_mp3.ino feature2 |= 0x00002000; // xdrv_14_mp3.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_PCA9685) #if defined(USE_I2C) && defined(USE_PCA9685)
feature_drv2 |= 0x00004000; // xdrv_15_pca9685.ino feature2 |= 0x00004000; // xdrv_15_pca9685.ino
#endif #endif
#if defined(USE_LIGHT) && defined(USE_TUYA_MCU) #if defined(USE_LIGHT) && defined(USE_TUYA_MCU)
feature_drv2 |= 0x00008000; // xdrv_16_tuyadimmer.ino feature2 |= 0x00008000; // xdrv_16_tuyadimmer.ino
#endif #endif
#ifdef USE_RC_SWITCH #ifdef USE_RC_SWITCH
feature_drv2 |= 0x00010000; // xdrv_17_rcswitch.ino feature2 |= 0x00010000; // xdrv_17_rcswitch.ino
#endif #endif
#if defined(USE_LIGHT) && defined(USE_ARMTRONIX_DIMMERS) #if defined(USE_LIGHT) && defined(USE_ARMTRONIX_DIMMERS)
feature_drv2 |= 0x00020000; // xdrv_18_armtronixdimmer.ino feature2 |= 0x00020000; // xdrv_18_armtronixdimmer.ino
#endif #endif
#if defined(USE_LIGHT) && defined(USE_SM16716) #if defined(USE_LIGHT) && defined(USE_SM16716)
feature_drv2 |= 0x00040000; // xdrv_04_light.ino feature2 |= 0x00040000; // xdrv_04_light.ino
#endif #endif
#ifdef USE_SCRIPT #ifdef USE_SCRIPT
feature_drv2 |= 0x00080000; // xdrv_10_scripter.ino feature2 |= 0x00080000; // xdrv_10_scripter.ino
#endif #endif
#if defined(USE_WEBSERVER) && defined(USE_EMULATION_WEMO) #if defined(USE_WEBSERVER) && defined(USE_EMULATION_WEMO)
feature_drv2 |= 0x00100000; // xdrv_21_wemo.ino feature2 |= 0x00100000; // xdrv_21_wemo.ino
#endif #endif
#ifdef USE_SONOFF_IFAN #ifdef USE_SONOFF_IFAN
feature_drv2 |= 0x00200000; // xdrv_22_sonoff_ifan.ino feature2 |= 0x00200000; // xdrv_22_sonoff_ifan.ino
#endif #endif
#ifdef USE_ZIGBEE #ifdef USE_ZIGBEE
feature_drv2 |= 0x00400000; // xdrv_23_zigbee.ino feature2 |= 0x00400000; // xdrv_23_zigbee.ino
#endif #endif
#ifdef NO_EXTRA_4K_HEAP #ifdef NO_EXTRA_4K_HEAP
feature_drv2 |= 0x00800000; // sonoff_post.h feature2 |= 0x00800000; // sonoff_post.h
#endif #endif
#ifdef VTABLES_IN_IRAM #ifdef VTABLES_IN_IRAM
feature_drv2 |= 0x01000000; // platformio.ini feature2 |= 0x01000000; // platformio.ini
#endif #endif
#ifdef VTABLES_IN_DRAM #ifdef VTABLES_IN_DRAM
feature_drv2 |= 0x02000000; // platformio.ini feature2 |= 0x02000000; // platformio.ini
#endif #endif
#ifdef VTABLES_IN_FLASH #ifdef VTABLES_IN_FLASH
feature_drv2 |= 0x04000000; // platformio.ini feature2 |= 0x04000000; // platformio.ini
#endif #endif
#ifdef PIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH #ifdef PIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
feature_drv2 |= 0x08000000; // platformio.ini feature2 |= 0x08000000; // platformio.ini
#endif #endif
#ifdef PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY #ifdef PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
feature_drv2 |= 0x10000000; // platformio.ini feature2 |= 0x10000000; // platformio.ini
#endif #endif
#ifdef PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH #ifdef PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
feature_drv2 |= 0x20000000; // platformio.ini feature2 |= 0x20000000; // platformio.ini
#endif #endif
#ifdef DEBUG_THEO #ifdef DEBUG_THEO
feature_drv2 |= 0x40000000; // xdrv_99_debug.ino feature2 |= 0x40000000; // xdrv_99_debug.ino
#endif #endif
#ifdef USE_DEBUG_DRIVER #ifdef USE_DEBUG_DRIVER
feature_drv2 |= 0x80000000; // xdrv_99_debug.ino feature2 |= 0x80000000; // xdrv_99_debug.ino
#endif #endif
}
/*********************************************************************************************/ static uint32_t feature3 = 0x00000000;
if (!feature3) { // Only fill this once
feature_sns1 = 0x00000000;
#ifdef USE_COUNTER #ifdef USE_COUNTER
feature_sns1 |= 0x00000001; // xsns_01_counter.ino feature3 |= 0x00000001; // xsns_01_counter.ino
#endif #endif
#if defined(USE_ADC_VCC) || defined(USE_ADC) #if defined(USE_ADC_VCC) || defined(USE_ADC)
feature_sns1 |= 0x00000002; // xsns_02_analog.ino feature3 |= 0x00000002; // xsns_02_analog.ino
#endif #endif
#ifdef USE_ENERGY_SENSOR #ifdef USE_ENERGY_SENSOR
feature_sns1 |= 0x00000004; // xdrv_03_energy.ino feature3 |= 0x00000004; // xdrv_03_energy.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_PZEM004T) #if defined(USE_ENERGY_SENSOR) && defined(USE_PZEM004T)
feature_sns1 |= 0x00000008; // xnrg_03_pzem004t.ino feature3 |= 0x00000008; // xnrg_03_pzem004t.ino
#endif #endif
#ifdef USE_DS18B20 #ifdef USE_DS18B20
feature_sns1 |= 0x00000010; // xsns_05_ds18b20.ino - no more support since 6.6.0.18 feature3 |= 0x00000010; // xsns_05_ds18b20.ino - no more support since 6.6.0.18
#endif #endif
#ifdef USE_DS18x20_LEGACY #ifdef USE_DS18x20_LEGACY
feature_sns1 |= 0x00000020; // xsns_05_ds18x20_legacy.ino - no more support since 6.6.0.14 feature3 |= 0x00000020; // xsns_05_ds18x20_legacy.ino - no more support since 6.6.0.14
#endif #endif
#ifdef USE_DS18x20 #ifdef USE_DS18x20
feature_sns1 |= 0x00000040; // xsns_05_ds18x20.ino feature3 |= 0x00000040; // xsns_05_ds18x20.ino
#endif #endif
#ifdef USE_DHT #ifdef USE_DHT
feature_sns1 |= 0x00000080; // xsns_06_dht.ino feature3 |= 0x00000080; // xsns_06_dht.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_SHT) #if defined(USE_I2C) && defined(USE_SHT)
feature_sns1 |= 0x00000100; // xsns_07_sht1x.ino feature3 |= 0x00000100; // xsns_07_sht1x.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_HTU) #if defined(USE_I2C) && defined(USE_HTU)
feature_sns1 |= 0x00000200; // xsns_08_htu21.ino feature3 |= 0x00000200; // xsns_08_htu21.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_BMP) #if defined(USE_I2C) && defined(USE_BMP)
feature_sns1 |= 0x00000400; // xsns_09_bmp.ino feature3 |= 0x00000400; // xsns_09_bmp.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_BMP) && defined(USE_BME680) #if defined(USE_I2C) && defined(USE_BMP) && defined(USE_BME680)
feature_sns1 |= 0x00000800; // xsns_09_bmp.ino - BME680 feature3 |= 0x00000800; // xsns_09_bmp.ino - BME680
#endif #endif
#if defined(USE_I2C) && defined(USE_BH1750) #if defined(USE_I2C) && defined(USE_BH1750)
feature_sns1 |= 0x00001000; // xsns_10_bh1750.ino feature3 |= 0x00001000; // xsns_10_bh1750.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_VEML6070) #if defined(USE_I2C) && defined(USE_VEML6070)
feature_sns1 |= 0x00002000; // xsns_11_veml6070.ino feature3 |= 0x00002000; // xsns_11_veml6070.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_ADS1115_I2CDEV) #if defined(USE_I2C) && defined(USE_ADS1115_I2CDEV)
feature_sns1 |= 0x00004000; // xsns_12_ads1115_i2cdev.ino feature3 |= 0x00004000; // xsns_12_ads1115_i2cdev.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_ADS1115) #if defined(USE_I2C) && defined(USE_ADS1115)
feature_sns1 |= 0x00008000; // xsns_12_ads1115.ino feature3 |= 0x00008000; // xsns_12_ads1115.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_INA219) #if defined(USE_I2C) && defined(USE_INA219)
feature_sns1 |= 0x00010000; // xsns_13_ina219.ino feature3 |= 0x00010000; // xsns_13_ina219.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_SHT3X) #if defined(USE_I2C) && defined(USE_SHT3X)
feature_sns1 |= 0x00020000; // xsns_14_sht3x.ino feature3 |= 0x00020000; // xsns_14_sht3x.ino
#endif #endif
#ifdef USE_MHZ19 #ifdef USE_MHZ19
feature_sns1 |= 0x00040000; // xsns_15_mhz19.ino feature3 |= 0x00040000; // xsns_15_mhz19.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_TSL2561) #if defined(USE_I2C) && defined(USE_TSL2561)
feature_sns1 |= 0x00080000; // xsns_16_tsl2561.ino feature3 |= 0x00080000; // xsns_16_tsl2561.ino
#endif #endif
#ifdef USE_SENSEAIR #ifdef USE_SENSEAIR
feature_sns1 |= 0x00100000; // xsns_17_senseair.ino feature3 |= 0x00100000; // xsns_17_senseair.ino
#endif #endif
#ifdef USE_PMS5003 #ifdef USE_PMS5003
feature_sns1 |= 0x00200000; // xsns_18_pms5003.ino feature3 |= 0x00200000; // xsns_18_pms5003.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_MGS) #if defined(USE_I2C) && defined(USE_MGS)
feature_sns1 |= 0x00400000; // xsns_19_mgs.ino feature3 |= 0x00400000; // xsns_19_mgs.ino
#endif #endif
#ifdef USE_NOVA_SDS #ifdef USE_NOVA_SDS
feature_sns1 |= 0x00800000; // xsns_20_novasds.ino feature3 |= 0x00800000; // xsns_20_novasds.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_SGP30) #if defined(USE_I2C) && defined(USE_SGP30)
feature_sns1 |= 0x01000000; // xsns_21_sgp30.ino feature3 |= 0x01000000; // xsns_21_sgp30.ino
#endif #endif
#ifdef USE_SR04 #ifdef USE_SR04
feature_sns1 |= 0x02000000; // xsns_22_sr04.ino feature3 |= 0x02000000; // xsns_22_sr04.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_SDM120) #if defined(USE_ENERGY_SENSOR) && defined(USE_SDM120)
feature_sns1 |= 0x04000000; // xnrg_08_sdm120.ino feature3 |= 0x04000000; // xnrg_08_sdm120.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_SI1145) #if defined(USE_I2C) && defined(USE_SI1145)
feature_sns1 |= 0x08000000; // xsns_24_si1145.ino feature3 |= 0x08000000; // xsns_24_si1145.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_SDM630) #if defined(USE_ENERGY_SENSOR) && defined(USE_SDM630)
feature_sns1 |= 0x10000000; // xnrg_10_sdm630.ino feature3 |= 0x10000000; // xnrg_10_sdm630.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_LM75AD) #if defined(USE_I2C) && defined(USE_LM75AD)
feature_sns1 |= 0x20000000; // xsns_26_lm75ad.ino feature3 |= 0x20000000; // xsns_26_lm75ad.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_APDS9960) #if defined(USE_I2C) && defined(USE_APDS9960)
feature_sns1 |= 0x40000000; // xsns_27_apds9960.ino feature3 |= 0x40000000; // xsns_27_apds9960.ino
#endif #endif
#ifdef USE_TM1638 #ifdef USE_TM1638
feature_sns1 |= 0x80000000; // xsns_28_tm1638.ino feature3 |= 0x80000000; // xsns_28_tm1638.ino
#endif #endif
/*********************************************************************************************/ }
feature_sns2 = 0x00000000;
static uint32_t feature4 = 0x00000000;
if (!feature4) { // Only fill this once
#if defined(USE_I2C) && defined(USE_MCP230xx) #if defined(USE_I2C) && defined(USE_MCP230xx)
feature_sns2 |= 0x00000001; // xsns_29_mcp230xx.ino feature4 |= 0x00000001; // xsns_29_mcp230xx.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_MPR121) #if defined(USE_I2C) && defined(USE_MPR121)
feature_sns2 |= 0x00000002; // xsns_30_mpr121.ino feature4 |= 0x00000002; // xsns_30_mpr121.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_CCS811) #if defined(USE_I2C) && defined(USE_CCS811)
feature_sns2 |= 0x00000004; // xsns_31_ccs811.ino feature4 |= 0x00000004; // xsns_31_ccs811.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_MPU6050) #if defined(USE_I2C) && defined(USE_MPU6050)
feature_sns2 |= 0x00000008; // xsns_32_mpu6050.ino feature4 |= 0x00000008; // xsns_32_mpu6050.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_MCP230xx) && defined(USE_MCP230xx_OUTPUT) #if defined(USE_I2C) && defined(USE_MCP230xx) && defined(USE_MCP230xx_OUTPUT)
feature_sns2 |= 0x00000010; // xsns_29_mcp230xx.ino feature4 |= 0x00000010; // xsns_29_mcp230xx.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_MCP230xx) && defined(USE_MCP230xx_DISPLAYOUTPUT) #if defined(USE_I2C) && defined(USE_MCP230xx) && defined(USE_MCP230xx_DISPLAYOUTPUT)
feature_sns2 |= 0x00000020; // xsns_29_mcp230xx.ino feature4 |= 0x00000020; // xsns_29_mcp230xx.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_HLW8012) #if defined(USE_ENERGY_SENSOR) && defined(USE_HLW8012)
feature_sns2 |= 0x00000040; // xnrg_01_hlw8012.ino feature4 |= 0x00000040; // xnrg_01_hlw8012.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_CSE7766) #if defined(USE_ENERGY_SENSOR) && defined(USE_CSE7766)
feature_sns2 |= 0x00000080; // xnrg_02_cse7766.ino feature4 |= 0x00000080; // xnrg_02_cse7766.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_MCP39F501) #if defined(USE_ENERGY_SENSOR) && defined(USE_MCP39F501)
feature_sns2 |= 0x00000100; // xnrg_04_mcp39f501.ino feature4 |= 0x00000100; // xnrg_04_mcp39f501.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_PZEM_AC) #if defined(USE_ENERGY_SENSOR) && defined(USE_PZEM_AC)
feature_sns2 |= 0x00000200; // xnrg_05_pzem_ac.ino feature4 |= 0x00000200; // xnrg_05_pzem_ac.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_DS3231) #if defined(USE_I2C) && defined(USE_DS3231)
feature_sns2 |= 0x00000400; // xsns_33_ds3231.ino feature4 |= 0x00000400; // xsns_33_ds3231.ino
#endif #endif
#ifdef USE_HX711 #ifdef USE_HX711
feature_sns2 |= 0x00000800; // xsns_34_hx711.ino feature4 |= 0x00000800; // xsns_34_hx711.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_PZEM_DC) #if defined(USE_ENERGY_SENSOR) && defined(USE_PZEM_DC)
feature_sns2 |= 0x00001000; // xnrg_06_pzem_dc.ino feature4 |= 0x00001000; // xnrg_06_pzem_dc.ino
#endif #endif
#if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR) #if defined(USE_TX20_WIND_SENSOR) || defined(USE_TX23_WIND_SENSOR)
feature_sns2 |= 0x00002000; // xsns_35_tx20.ino feature4 |= 0x00002000; // xsns_35_tx20.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_MGC3130) #if defined(USE_I2C) && defined(USE_MGC3130)
feature_sns2 |= 0x00004000; // xsns_36_mgc3130.ino feature4 |= 0x00004000; // xsns_36_mgc3130.ino
#endif #endif
#ifdef USE_RF_SENSOR #ifdef USE_RF_SENSOR
feature_sns2 |= 0x00008000; // xsns_37_rfsensor.ino feature4 |= 0x00008000; // xsns_37_rfsensor.ino
#endif #endif
#if defined(USE_RF_SENSOR) && defined(USE_THEO_V2) #if defined(USE_RF_SENSOR) && defined(USE_THEO_V2)
feature_sns2 |= 0x00010000; // xsns_37_rfsensor.ino feature4 |= 0x00010000; // xsns_37_rfsensor.ino
#endif #endif
#if defined(USE_RF_SENSOR) && defined(USE_ALECTO_V2) #if defined(USE_RF_SENSOR) && defined(USE_ALECTO_V2)
feature_sns2 |= 0x00020000; // xsns_37_rfsensor.ino feature4 |= 0x00020000; // xsns_37_rfsensor.ino
#endif #endif
#ifdef USE_AZ7798 #ifdef USE_AZ7798
feature_sns2 |= 0x00040000; // xsns_38_az7798.ino feature4 |= 0x00040000; // xsns_38_az7798.ino
#endif #endif
#ifdef USE_MAX31855 #ifdef USE_MAX31855
feature_sns2 |= 0x00080000; // xsns_39_max31855.ino feature4 |= 0x00080000; // xsns_39_max31855.ino
#endif #endif
#ifdef USE_PN532_HSU #ifdef USE_PN532_HSU
feature_sns2 |= 0x00100000; // xsns_40_pn532.ino feature4 |= 0x00100000; // xsns_40_pn532.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_MAX44009) #if defined(USE_I2C) && defined(USE_MAX44009)
feature_sns2 |= 0x00200000; // xsns_41_max44009.ino feature4 |= 0x00200000; // xsns_41_max44009.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_SCD30) #if defined(USE_I2C) && defined(USE_SCD30)
feature_sns2 |= 0x00400000; // xsns_42_scd30.ino feature4 |= 0x00400000; // xsns_42_scd30.ino
#endif #endif
#ifdef USE_HRE #ifdef USE_HRE
feature_sns2 |= 0x00800000; // xsns_43_hre.ino feature4 |= 0x00800000; // xsns_43_hre.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_ADE7953) #if defined(USE_ENERGY_SENSOR) && defined(USE_ADE7953)
feature_sns2 |= 0x01000000; // xnrg_07_ade7953.ino feature4 |= 0x01000000; // xnrg_07_ade7953.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_SPS30) #if defined(USE_I2C) && defined(USE_SPS30)
feature_sns2 |= 0x02000000; // xsns_44_sps30.ino feature4 |= 0x02000000; // xsns_44_sps30.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_VL53L0X) #if defined(USE_I2C) && defined(USE_VL53L0X)
feature_sns2 |= 0x04000000; // xsns_45_vl53l0x.ino feature4 |= 0x04000000; // xsns_45_vl53l0x.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_MLX90614) #if defined(USE_I2C) && defined(USE_MLX90614)
feature_sns2 |= 0x08000000; // xsns_46_MLX90614.ino feature4 |= 0x08000000; // xsns_46_MLX90614.ino
#endif #endif
#ifdef USE_MAX31865 #ifdef USE_MAX31865
feature_sns2 |= 0x10000000; // xsns_47-max31865.ino feature4 |= 0x10000000; // xsns_47-max31865.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_CHIRP) #if defined(USE_I2C) && defined(USE_CHIRP)
feature_sns2 |= 0x20000000; // xsns_48_chirp.ino feature4 |= 0x20000000; // xsns_48_chirp.ino
#endif #endif
#if defined(USE_ENERGY_SENSOR) && defined(USE_SOLAX_X1) #if defined(USE_ENERGY_SENSOR) && defined(USE_SOLAX_X1)
feature_sns2 |= 0x40000000; // xnrg_12_solaxX1.ino feature4 |= 0x40000000; // xnrg_12_solaxX1.ino
#endif #endif
#if defined(USE_I2C) && defined(USE_PAJ7620) #if defined(USE_I2C) && defined(USE_PAJ7620)
feature_sns2 |= 0x80000000; // xsns_50_paj7620.ino feature4 |= 0x80000000; // xsns_50_paj7620.ino
#endif #endif
}
/*********************************************************************************************/ static uint32_t feature5 = 0x00000000;
if (!feature5) { // Only fill this once
feature5 = 0x00000000;
#ifdef USE_BUZZER #ifdef USE_BUZZER
feature5 |= 0x00000001; // xdrv_24_buzzer.ino feature5 |= 0x00000001; // xdrv_24_buzzer.ino
#endif #endif
@ -524,11 +521,10 @@ void GetFeatures(void)
#ifdef USE_PWM_DIMMER #ifdef USE_PWM_DIMMER
feature5 |= 0x80000000; // xdrv_35_pwm_dimmer feature5 |= 0x80000000; // xdrv_35_pwm_dimmer
#endif #endif
}
/*********************************************************************************************/ static uint32_t feature6 = 0x00000000;
if (!feature6) { // Only fill this once
feature6 = 0x00000000;
#ifdef USE_KEELOQ #ifdef USE_KEELOQ
feature6 |= 0x00000001; // xdrv_36_keeloq.ino feature6 |= 0x00000001; // xdrv_36_keeloq.ino
#endif #endif
@ -625,11 +621,10 @@ void GetFeatures(void)
#if defined(ESP32) && defined(USE_WEBCAM) #if defined(ESP32) && defined(USE_WEBCAM)
feature6 |= 0x80000000; // xdrv_81_webcam.ino feature6 |= 0x80000000; // xdrv_81_webcam.ino
#endif #endif
}
/*********************************************************************************************/ static uint32_t feature7 = 0x00000000;
if (!feature7) { // Only fill this once
feature7 = 0x00000000;
#if defined(USE_I2C) && defined(USE_EZOORP) #if defined(USE_I2C) && defined(USE_EZOORP)
feature7 |= 0x00000001; // xsns_78_ezoorp.ino feature7 |= 0x00000001; // xsns_78_ezoorp.ino
#endif #endif
@ -645,7 +640,9 @@ void GetFeatures(void)
#if defined(USE_I2C) && defined(USE_EZOCO2) #if defined(USE_I2C) && defined(USE_EZOCO2)
feature7 |= 0x00000010; feature7 |= 0x00000010;
#endif #endif
// feature7 |= 0x00000020; #if defined(USE_I2C) && defined(USE_EZOO2)
feature7 |= 0x00000020;
#endif
// feature7 |= 0x00000040; // feature7 |= 0x00000040;
// feature7 |= 0x00000080; // feature7 |= 0x00000080;
@ -678,6 +675,10 @@ void GetFeatures(void)
// feature7 |= 0x20000000; // feature7 |= 0x20000000;
// feature7 |= 0x40000000; // feature7 |= 0x40000000;
// feature7 |= 0x80000000; // feature7 |= 0x80000000;
}
/*********************************************************************************************/
} // GetFeatures ResponseAppend_P(PSTR(",\"" D_JSON_FEATURES "\":[\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\"]"),
LANGUAGE_LCID, feature1, feature2, feature3, feature4, feature5, feature6, feature7);
}

View File

@ -77,13 +77,6 @@
WiFiUDP PortUdp; // UDP Syslog and Alexa WiFiUDP PortUdp; // UDP Syslog and Alexa
unsigned long feature_drv1; // Compiled driver feature map
unsigned long feature_drv2; // Compiled driver feature map
unsigned long feature_sns1; // Compiled sensor feature map
unsigned long feature_sns2; // Compiled sensor feature map
unsigned long feature5; // Compiled feature map
unsigned long feature6; // Compiled feature map
unsigned long feature7; // Compiled feature map
unsigned long serial_polling_window = 0; // Serial polling window unsigned long serial_polling_window = 0; // Serial polling window
unsigned long state_second = 0; // State second timer unsigned long state_second = 0; // State second timer
unsigned long state_50msecond = 0; // State 50msecond timer unsigned long state_50msecond = 0; // State 50msecond timer
@ -224,8 +217,6 @@ void setup(void) {
OsWatchInit(); OsWatchInit();
GetFeatures();
if (1 == RtcReboot.fast_reboot_count) { // Allow setting override only when all is well if (1 == RtcReboot.fast_reboot_count) { // Allow setting override only when all is well
UpdateQuickPowerCycle(true); UpdateQuickPowerCycle(true);
XdrvCall(FUNC_SETTINGS_OVERRIDE); XdrvCall(FUNC_SETTINGS_OVERRIDE);

View File

@ -234,7 +234,7 @@ a_features = [[
"USE_EZOPH","USE_TTGO_WATCH","USE_ETHERNET","USE_WEBCAM" "USE_EZOPH","USE_TTGO_WATCH","USE_ETHERNET","USE_WEBCAM"
],[ ],[
"USE_EZOORP","USE_EZORTD","USE_EZOHUM","USE_EZOEC", "USE_EZOORP","USE_EZORTD","USE_EZOHUM","USE_EZOEC",
"","","","", "USE_EZOCO2","USE_EZOO2","","",
"","","","", "","","","",
"","","","", "","","","",
"","","","", "","","","",
@ -268,7 +268,7 @@ else:
obj = json.load(fp) obj = json.load(fp)
def StartDecode(): def StartDecode():
print ("\n*** decode-status.py v20201025 by Theo Arends and Jacek Ziolkowski ***") print ("\n*** decode-status.py v20201028 by Theo Arends and Jacek Ziolkowski ***")
# print("Decoding\n{}".format(obj)) # print("Decoding\n{}".format(obj))