mirror of
https://github.com/esphome/esphome.git
synced 2025-10-11 14:23:47 +01:00
Merge remote-tracking branch 'upstream/esp32_opentherm_cleanup' into common_bus_grouping
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include "opentherm.h"
|
#include "opentherm.h"
|
||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
#ifdef ESP32
|
#ifdef USE_ESP32
|
||||||
#include "driver/timer.h"
|
#include "driver/timer.h"
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -31,7 +31,7 @@ OpenTherm *OpenTherm::instance = nullptr;
|
|||||||
OpenTherm::OpenTherm(InternalGPIOPin *in_pin, InternalGPIOPin *out_pin, int32_t device_timeout)
|
OpenTherm::OpenTherm(InternalGPIOPin *in_pin, InternalGPIOPin *out_pin, int32_t device_timeout)
|
||||||
: in_pin_(in_pin),
|
: in_pin_(in_pin),
|
||||||
out_pin_(out_pin),
|
out_pin_(out_pin),
|
||||||
#ifdef ESP32
|
#ifdef USE_ESP32
|
||||||
timer_group_(TIMER_GROUP_0),
|
timer_group_(TIMER_GROUP_0),
|
||||||
timer_idx_(TIMER_0),
|
timer_idx_(TIMER_0),
|
||||||
#endif
|
#endif
|
||||||
@@ -57,7 +57,7 @@ bool OpenTherm::initialize() {
|
|||||||
this->out_pin_->setup();
|
this->out_pin_->setup();
|
||||||
this->out_pin_->digital_write(true);
|
this->out_pin_->digital_write(true);
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef USE_ESP32
|
||||||
return this->init_esp32_timer_();
|
return this->init_esp32_timer_();
|
||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
@@ -238,7 +238,7 @@ void IRAM_ATTR OpenTherm::write_bit_(uint8_t high, uint8_t clock) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef USE_ESP32
|
||||||
|
|
||||||
bool OpenTherm::init_esp32_timer_() {
|
bool OpenTherm::init_esp32_timer_() {
|
||||||
// Search for a free timer. Maybe unstable, we'll see.
|
// Search for a free timer. Maybe unstable, we'll see.
|
||||||
@@ -365,7 +365,7 @@ void IRAM_ATTR OpenTherm::stop_timer_() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ESP32
|
#endif // USE_ESP32
|
||||||
|
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
// 5 kHz timer_
|
// 5 kHz timer_
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef USE_ESP32
|
||||||
#include "driver/timer.h"
|
#include "driver/timer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ class OpenTherm {
|
|||||||
ISRInternalGPIOPin isr_in_pin_;
|
ISRInternalGPIOPin isr_in_pin_;
|
||||||
ISRInternalGPIOPin isr_out_pin_;
|
ISRInternalGPIOPin isr_out_pin_;
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef USE_ESP32
|
||||||
timer_group_t timer_group_;
|
timer_group_t timer_group_;
|
||||||
timer_idx_t timer_idx_;
|
timer_idx_t timer_idx_;
|
||||||
#endif
|
#endif
|
||||||
@@ -370,7 +370,7 @@ class OpenTherm {
|
|||||||
int32_t timeout_counter_; // <0 no timeout
|
int32_t timeout_counter_; // <0 no timeout
|
||||||
int32_t device_timeout_;
|
int32_t device_timeout_;
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef USE_ESP32
|
||||||
esp_err_t timer_error_ = ESP_OK;
|
esp_err_t timer_error_ = ESP_OK;
|
||||||
TimerErrorType timer_error_type_ = TimerErrorType::NO_TIMER_ERROR;
|
TimerErrorType timer_error_type_ = TimerErrorType::NO_TIMER_ERROR;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user