mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
Use a while loop or the buffer can overflow in high noise enviroments
This commit is contained in:
parent
3233ce1181
commit
a24e9b849e
1 changed files with 1 additions and 1 deletions
|
@ -113,7 +113,7 @@ void RemoteReceiverComponent::loop() {
|
||||||
ESP_LOGW(TAG, "RMT buffer overflow!");
|
ESP_LOGW(TAG, "RMT buffer overflow!");
|
||||||
this->store_.overflow = false;
|
this->store_.overflow = false;
|
||||||
}
|
}
|
||||||
if (this->store_.buffer_write != this->store_.buffer_read) {
|
while (this->store_.buffer_write != this->store_.buffer_read) {
|
||||||
rmt_rx_done_event_data_t *event = (rmt_rx_done_event_data_t *) (this->store_.buffer + this->store_.buffer_read);
|
rmt_rx_done_event_data_t *event = (rmt_rx_done_event_data_t *) (this->store_.buffer + this->store_.buffer_read);
|
||||||
uint32_t event_size = sizeof(rmt_rx_done_event_data_t);
|
uint32_t event_size = sizeof(rmt_rx_done_event_data_t);
|
||||||
uint32_t next_read = this->store_.buffer_read + event_size + event->num_symbols * sizeof(rmt_symbol_word_t);
|
uint32_t next_read = this->store_.buffer_read + event_size + event->num_symbols * sizeof(rmt_symbol_word_t);
|
||||||
|
|
Loading…
Reference in a new issue