mirror of
https://github.com/esphome/esphome.git
synced 2025-07-30 23:26:36 +00:00
Compare commits
No commits in common. "e5b7e3039a8ffc19ad6d60b693ee037e6329e5cf" and "0c3daab64908b1588535751ee2123e7259b4e7af" have entirely different histories.
e5b7e3039a
...
0c3daab649
@ -1,8 +1,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
#include "psram.h"
|
||||
#include <esp_idf_version.h>
|
||||
#if defined(USE_ESP_IDF) && ESP_IDF_VERSION_MAJOR >= 5
|
||||
#ifdef USE_ESP_IDF
|
||||
#include <esp_psram.h>
|
||||
#endif // USE_ESP_IDF
|
||||
|
||||
@ -16,7 +15,7 @@ static const char *const TAG = "psram";
|
||||
|
||||
void PsramComponent::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "PSRAM:");
|
||||
#if defined(USE_ESP_IDF) && ESP_IDF_VERSION_MAJOR >= 5
|
||||
#ifdef USE_ESP_IDF
|
||||
bool available = esp_psram_is_initialized();
|
||||
|
||||
ESP_LOGCONFIG(TAG, " Available: %s", YESNO(available));
|
||||
|
@ -208,6 +208,7 @@ void RemoteReceiverComponent::loop() {
|
||||
this->store_.buffer_read = next_read;
|
||||
|
||||
if (!this->temp_.empty()) {
|
||||
this->temp_.push_back(-this->idle_us_);
|
||||
this->call_listeners_dumpers_();
|
||||
}
|
||||
}
|
||||
@ -218,9 +219,11 @@ void RemoteReceiverComponent::loop() {
|
||||
this->decode_rmt_(item, len / sizeof(rmt_item32_t));
|
||||
vRingbufferReturnItem(this->ringbuf_, item);
|
||||
|
||||
if (!this->temp_.empty()) {
|
||||
this->call_listeners_dumpers_();
|
||||
}
|
||||
if (this->temp_.empty())
|
||||
return;
|
||||
|
||||
this->temp_.push_back(-this->idle_us_);
|
||||
this->call_listeners_dumpers_();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -231,7 +234,6 @@ void RemoteReceiverComponent::decode_rmt_(rmt_symbol_word_t *item, size_t item_c
|
||||
void RemoteReceiverComponent::decode_rmt_(rmt_item32_t *item, size_t item_count) {
|
||||
#endif
|
||||
bool prev_level = false;
|
||||
bool idle_level = false;
|
||||
uint32_t prev_length = 0;
|
||||
this->temp_.clear();
|
||||
int32_t multiplier = this->pin_->is_inverted() ? -1 : 1;
|
||||
@ -264,7 +266,7 @@ void RemoteReceiverComponent::decode_rmt_(rmt_item32_t *item, size_t item_count)
|
||||
} else if ((bool(item[i].level0) == prev_level) || (item[i].duration0 < filter_ticks)) {
|
||||
prev_length += item[i].duration0;
|
||||
} else {
|
||||
if (prev_length >= filter_ticks) {
|
||||
if (prev_length > 0) {
|
||||
if (prev_level) {
|
||||
this->temp_.push_back(this->to_microseconds_(prev_length) * multiplier);
|
||||
} else {
|
||||
@ -274,7 +276,6 @@ void RemoteReceiverComponent::decode_rmt_(rmt_item32_t *item, size_t item_count)
|
||||
prev_level = bool(item[i].level0);
|
||||
prev_length = item[i].duration0;
|
||||
}
|
||||
idle_level = !bool(item[i].level0);
|
||||
|
||||
if (item[i].duration1 == 0u) {
|
||||
// EOF, sometimes garbage follows, break early
|
||||
@ -282,7 +283,7 @@ void RemoteReceiverComponent::decode_rmt_(rmt_item32_t *item, size_t item_count)
|
||||
} else if ((bool(item[i].level1) == prev_level) || (item[i].duration1 < filter_ticks)) {
|
||||
prev_length += item[i].duration1;
|
||||
} else {
|
||||
if (prev_length >= filter_ticks) {
|
||||
if (prev_length > 0) {
|
||||
if (prev_level) {
|
||||
this->temp_.push_back(this->to_microseconds_(prev_length) * multiplier);
|
||||
} else {
|
||||
@ -292,22 +293,14 @@ void RemoteReceiverComponent::decode_rmt_(rmt_item32_t *item, size_t item_count)
|
||||
prev_level = bool(item[i].level1);
|
||||
prev_length = item[i].duration1;
|
||||
}
|
||||
idle_level = !bool(item[i].level1);
|
||||
}
|
||||
if (prev_length >= filter_ticks && prev_level != idle_level) {
|
||||
if (prev_length > 0) {
|
||||
if (prev_level) {
|
||||
this->temp_.push_back(this->to_microseconds_(prev_length) * multiplier);
|
||||
} else {
|
||||
this->temp_.push_back(-int32_t(this->to_microseconds_(prev_length)) * multiplier);
|
||||
}
|
||||
}
|
||||
if (!this->temp_.empty()) {
|
||||
if (idle_level) {
|
||||
this->temp_.push_back(this->idle_us_ * multiplier);
|
||||
} else {
|
||||
this->temp_.push_back(-int32_t(this->idle_us_) * multiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace remote_receiver
|
||||
|
Loading…
x
Reference in New Issue
Block a user