mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-10-28 19:24:59 +00:00
Merge branch 'emsesp:dev' into feat/custom-sdkconfig
This commit is contained in:
+6
-6
@@ -31,17 +31,17 @@ namespace rgb_led {
|
||||
|
||||
namespace {
|
||||
|
||||
// durations in 100 ns ticks
|
||||
constexpr uint16_t T0H = 3; // 300 ns
|
||||
constexpr uint16_t T0L = 9; // 900 ns
|
||||
constexpr uint16_t T1H = 8; // 800 ns
|
||||
constexpr uint16_t T1L = 6; // 600 ns
|
||||
// durations in 12.5 ns ticks
|
||||
constexpr uint16_t T0H = 3.5 * 8; // 350 ns
|
||||
constexpr uint16_t T0L = 9 * 8; // 900 ns
|
||||
constexpr uint16_t T1H = 8 * 8; // 800 ns
|
||||
constexpr uint16_t T1L = 6 * 8; // 600 ns
|
||||
|
||||
// rmt_data_t.val layout: duration0:15, level0:1, duration1:15, level1:1 (high then low)
|
||||
constexpr uint32_t SYMBOL_0 = T0H | (1UL << 15) | (static_cast<uint32_t>(T0L) << 16);
|
||||
constexpr uint32_t SYMBOL_1 = T1H | (1UL << 15) | (static_cast<uint32_t>(T1L) << 16);
|
||||
|
||||
constexpr uint32_t RMT_FREQ_HZ = 10000000; // 10 MHz
|
||||
constexpr uint32_t RMT_FREQ_HZ = 80000000; // 80 MHz
|
||||
constexpr uint32_t RESET_US = 300;
|
||||
constexpr uint8_t NO_PIN = 0xFF;
|
||||
constexpr uint8_t MAX_PINS = 2; // status LED + an RGB analog sensor; the ESP32-C3 only has 2 RMT TX channels
|
||||
|
||||
+6
-1
@@ -3767,9 +3767,14 @@ void System::remove_optional_gpio(uint8_t pin) {
|
||||
|
||||
// set unused gpios to default state input high-Z
|
||||
void System::reset_unused_gpios() {
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
constexpr uint8_t tx0 = 1; // don't change tx0 pin
|
||||
#else
|
||||
constexpr uint8_t tx0 = 255; // no valid pin, chips have native USB, tx0 not connected to transceiver
|
||||
#endif
|
||||
for (const auto & pin : valid_system_gpios_) {
|
||||
auto it = std::find_if(used_gpios_.begin(), used_gpios_.end(), [pin](const GpioUsage & usage) { return usage.pin == pin; });
|
||||
if (it == used_gpios_.end()) {
|
||||
if (it == used_gpios_.end() && pin != tx0) {
|
||||
LOG_DEBUG("reset pin %d", pin);
|
||||
pinMode(pin, INPUT);
|
||||
}
|
||||
|
||||
@@ -726,7 +726,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_device_value(DeviceValueTAG::TAG_DHW1,
|
||||
&maxHeatDhw_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_maxHeat2),
|
||||
FL_(enum_maxHeat1),
|
||||
FL_(maxHeatDhw),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_maxHeatDhw));
|
||||
@@ -994,16 +994,16 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
48,
|
||||
63);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DHW1, &wwComfDiffTemp_, DeviceValueType::UINT8, FL_(wwComfDiffTemp), DeviceValueUOM::K, MAKE_CF_CB(set_wwComfDiffTemp), 4, 15);
|
||||
DeviceValueTAG::TAG_DHW1, &wwComfDiffTemp_, DeviceValueType::UINT8, FL_(wwComfDiffTemp), DeviceValueUOM::K, MAKE_CF_CB(set_wwComfDiffTemp), 6, 18);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DHW1, &wwEcoDiffTemp_, DeviceValueType::UINT8, FL_(wwEcoDiffTemp), DeviceValueUOM::K, MAKE_CF_CB(set_wwEcoDiffTemp), 4, 15);
|
||||
DeviceValueTAG::TAG_DHW1, &wwEcoDiffTemp_, DeviceValueType::UINT8, FL_(wwEcoDiffTemp), DeviceValueUOM::K, MAKE_CF_CB(set_wwEcoDiffTemp), 6, 18);
|
||||
register_device_value(DeviceValueTAG::TAG_DHW1,
|
||||
&wwEcoPlusDiffTemp_,
|
||||
DeviceValueType::UINT8,
|
||||
FL_(wwEcoPlusDiffTemp),
|
||||
DeviceValueUOM::K,
|
||||
MAKE_CF_CB(set_wwEcoPlusDiffTemp),
|
||||
4,
|
||||
6,
|
||||
15);
|
||||
register_device_value(DeviceValueTAG::TAG_DHW1,
|
||||
&wwComfStopTemp_,
|
||||
@@ -1873,7 +1873,7 @@ void Boiler::process_HpHeaterConfig(const std::shared_ptr<const Telegram> & tele
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_CS6800) {
|
||||
has_enumupdate(telegram, maxHeatComp_, 2, {0, 2, 4, 5});
|
||||
has_enumupdate(telegram, maxHeatHeat_, 3, {2, 4, 5});
|
||||
has_enumupdate(telegram, maxHeatDhw_, 4, {2, 4, 5});
|
||||
has_enumupdate(telegram, maxHeatDhw_, 4, {0, 2, 4, 5});
|
||||
return;
|
||||
}
|
||||
has_update(telegram, maxHeatComp_, 2);
|
||||
@@ -3238,7 +3238,7 @@ bool Boiler::set_HpInLogic(const char * value, const int8_t id) {
|
||||
bool Boiler::set_maxHeat(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (model() == EMSdevice::EMS_DEVICE_FLAG_CS6800) {
|
||||
if (id == 0) {
|
||||
if (id == 2 || id == 4) { // maxHeatComp, maxHeatDhw
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_maxHeat1), {0, 2, 4, 5})) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
|
||||
// RF remote sensor seen at 0x40, maybe this is also for different hc with id 0x40 - 0x47? emsesp.cpp maps only 0x40
|
||||
if (device_id >= 0x40 && device_id <= 0x47) {
|
||||
register_telegram_type(0x0435, "RFTemp", false, MAKE_PF_CB(process_RemoteTemp));
|
||||
register_device_values();
|
||||
return;
|
||||
}
|
||||
// remote thermostats with humidity: RC100H remote, each thermostat is for one hc
|
||||
|
||||
Reference in New Issue
Block a user