mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-26 04:06:34 +00:00
Squeeze some bytes out of it
This commit is contained in:
parent
cf6de0ce31
commit
c6ca0ff10f
@ -18,10 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Fill feature list
|
* Feature list
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
|
||||||
constexpr uint32_t feature1 =
|
constexpr uint32_t feature[] = {
|
||||||
#if defined(USE_ENERGY_SENSOR) && defined(USE_ENERGY_MARGIN_DETECTION)
|
#if defined(USE_ENERGY_SENSOR) && defined(USE_ENERGY_MARGIN_DETECTION)
|
||||||
0x00000001 | // xdrv_03_energy.ino
|
0x00000001 | // xdrv_03_energy.ino
|
||||||
#endif
|
#endif
|
||||||
@ -118,9 +118,7 @@ constexpr uint32_t feature1 =
|
|||||||
#if defined(USE_ENERGY_SENSOR) && defined(USE_ENERGY_POWER_LIMIT)
|
#if defined(USE_ENERGY_SENSOR) && defined(USE_ENERGY_POWER_LIMIT)
|
||||||
0x80000000 | // xdrv_03_energy.ino
|
0x80000000 | // xdrv_03_energy.ino
|
||||||
#endif
|
#endif
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature2 =
|
|
||||||
#ifdef USE_CONFIG_OVERRIDE
|
#ifdef USE_CONFIG_OVERRIDE
|
||||||
0x00000001 | // user_config(_override).h
|
0x00000001 | // user_config(_override).h
|
||||||
#endif
|
#endif
|
||||||
@ -217,9 +215,7 @@ constexpr uint32_t feature2 =
|
|||||||
#ifdef USE_DEBUG_DRIVER
|
#ifdef USE_DEBUG_DRIVER
|
||||||
0x80000000 | // xdrv_99_debug.ino
|
0x80000000 | // xdrv_99_debug.ino
|
||||||
#endif
|
#endif
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature3 =
|
|
||||||
#ifdef USE_COUNTER
|
#ifdef USE_COUNTER
|
||||||
0x00000001 | // xsns_01_counter.ino
|
0x00000001 | // xsns_01_counter.ino
|
||||||
#endif
|
#endif
|
||||||
@ -316,9 +312,7 @@ constexpr uint32_t feature3 =
|
|||||||
#ifdef USE_TM1638
|
#ifdef USE_TM1638
|
||||||
0x80000000 | // xdrv_66_tm1638.ino
|
0x80000000 | // xdrv_66_tm1638.ino
|
||||||
#endif
|
#endif
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature4 =
|
|
||||||
#if defined(USE_I2C) && defined(USE_MCP230xx)
|
#if defined(USE_I2C) && defined(USE_MCP230xx)
|
||||||
0x00000001 | // xsns_29_mcp230xx.ino
|
0x00000001 | // xsns_29_mcp230xx.ino
|
||||||
#endif
|
#endif
|
||||||
@ -415,9 +409,7 @@ constexpr uint32_t feature4 =
|
|||||||
#if defined(USE_I2C) && defined(USE_PAJ7620)
|
#if defined(USE_I2C) && defined(USE_PAJ7620)
|
||||||
0x80000000 | // xsns_50_paj7620.ino
|
0x80000000 | // xsns_50_paj7620.ino
|
||||||
#endif
|
#endif
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature5 =
|
|
||||||
#ifdef USE_BUZZER
|
#ifdef USE_BUZZER
|
||||||
0x00000001 | // xdrv_24_buzzer.ino
|
0x00000001 | // xdrv_24_buzzer.ino
|
||||||
#endif
|
#endif
|
||||||
@ -514,10 +506,7 @@ constexpr uint32_t feature5 =
|
|||||||
#ifdef USE_PWM_DIMMER
|
#ifdef USE_PWM_DIMMER
|
||||||
0x80000000 | // xdrv_35_pwm_dimmer
|
0x80000000 | // xdrv_35_pwm_dimmer
|
||||||
#endif
|
#endif
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature6 =
|
|
||||||
// Only fill this once
|
|
||||||
#ifdef USE_KEELOQ
|
#ifdef USE_KEELOQ
|
||||||
0x00000001 | // xdrv_36_keeloq.ino
|
0x00000001 | // xdrv_36_keeloq.ino
|
||||||
#endif
|
#endif
|
||||||
@ -614,9 +603,7 @@ constexpr uint32_t feature6 =
|
|||||||
#if defined(ESP32) && defined(USE_WEBCAM)
|
#if defined(ESP32) && defined(USE_WEBCAM)
|
||||||
0x80000000 | // xdrv_81_webcam.ino
|
0x80000000 | // xdrv_81_webcam.ino
|
||||||
#endif
|
#endif
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature7 =
|
|
||||||
#if defined(USE_I2C) && defined(USE_EZOORP)
|
#if defined(USE_I2C) && defined(USE_EZOORP)
|
||||||
0x00000001 | // xsns_78_ezoorp.ino
|
0x00000001 | // xsns_78_ezoorp.ino
|
||||||
#endif
|
#endif
|
||||||
@ -713,9 +700,7 @@ constexpr uint32_t feature7 =
|
|||||||
#ifdef USE_PROJECTOR_CTRL
|
#ifdef USE_PROJECTOR_CTRL
|
||||||
0x80000000 | // xdrv_53_projector_ctrl.ino
|
0x80000000 | // xdrv_53_projector_ctrl.ino
|
||||||
#endif
|
#endif
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature8 =
|
|
||||||
#if defined(USE_I2C) && defined(USE_MPU_ACCEL)
|
#if defined(USE_I2C) && defined(USE_MPU_ACCEL)
|
||||||
0x00000001 | // xsns_85_mpu6886.ino
|
0x00000001 | // xsns_85_mpu6886.ino
|
||||||
#endif
|
#endif
|
||||||
@ -812,9 +797,7 @@ constexpr uint32_t feature8 =
|
|||||||
#ifdef USE_DISPLAY_TM1621_SONOFF
|
#ifdef USE_DISPLAY_TM1621_SONOFF
|
||||||
0x80000000 | // xdrv_87_esp32_sonoff_tm1621.ino
|
0x80000000 | // xdrv_87_esp32_sonoff_tm1621.ino
|
||||||
#endif
|
#endif
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature9 =
|
|
||||||
#if defined(USE_I2C) && defined(USE_SGP40)
|
#if defined(USE_I2C) && defined(USE_SGP40)
|
||||||
0x00000001 | // xsns_98_sgp40.ino
|
0x00000001 | // xsns_98_sgp40.ino
|
||||||
#endif
|
#endif
|
||||||
@ -905,9 +888,7 @@ constexpr uint32_t feature9 =
|
|||||||
// 0x20000000 | //
|
// 0x20000000 | //
|
||||||
// 0x40000000 | //
|
// 0x40000000 | //
|
||||||
// 0x80000000 | //
|
// 0x80000000 | //
|
||||||
0;
|
0,
|
||||||
|
|
||||||
constexpr uint32_t feature10 =
|
|
||||||
// 0x00000001 | //
|
// 0x00000001 | //
|
||||||
// 0x00000002 | //
|
// 0x00000002 | //
|
||||||
// 0x00000004 | //
|
// 0x00000004 | //
|
||||||
@ -940,11 +921,14 @@ constexpr uint32_t feature10 =
|
|||||||
// 0x20000000 | //
|
// 0x20000000 | //
|
||||||
// 0x40000000 | //
|
// 0x40000000 | //
|
||||||
// 0x80000000 | //
|
// 0x80000000 | //
|
||||||
0;
|
0 };
|
||||||
|
|
||||||
/*********************************************************************************************/
|
/*********************************************************************************************/
|
||||||
|
|
||||||
void ResponseAppendFeatures(void) {
|
void ResponseAppendFeatures(void) {
|
||||||
ResponseAppend_P(PSTR(",\"" D_JSON_FEATURES "\":[\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\"]"),
|
ResponseAppend_P(PSTR(",\"" D_JSON_FEATURES "\":[\"%08X\""), LANGUAGE_LCID);
|
||||||
LANGUAGE_LCID, feature1, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10);
|
for (uint32_t i = 0; i < (sizeof(feature) / sizeof(uint32_t)); i++) {
|
||||||
|
ResponseAppend_P(PSTR(",\"%08X\""), feature[i]);
|
||||||
|
}
|
||||||
|
ResponseAppend_P(PSTR("]"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user