mirror of
https://github.com/esphome/esphome.git
synced 2025-03-03 09:18:16 +00:00
Fix up some linter warnings
This commit is contained in:
parent
4e92f01770
commit
8b89b51d62
@ -1,5 +1,7 @@
|
||||
#include "spdif.h"
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
#include "esphome/core/defines.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
@ -88,3 +90,5 @@ esp_err_t SPDIF::write(const uint8_t *src, size_t size, TickType_t ticks_to_wait
|
||||
|
||||
} // namespace spdif_audio
|
||||
} // namespace esphome
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <freertos/FreeRTOS.h>
|
||||
@ -50,3 +52,5 @@ class SPDIF {
|
||||
|
||||
} // namespace spdif_audio
|
||||
} // namespace esphome
|
||||
|
||||
#endif
|
||||
|
@ -31,14 +31,18 @@ int16_t silence[SPDIF_BLOCK_SAMPLES * 2];
|
||||
void SPDIFSpeaker::i2s_event_task(void *params) {
|
||||
SPDIFSpeaker *this_speaker = (SPDIFSpeaker *) params;
|
||||
i2s_event_t i2s_event;
|
||||
#if SPDIF_DEBUG
|
||||
int64_t last_error_log_time = 0;
|
||||
int64_t last_overflow_log_time = 0;
|
||||
// 1 second in microseconds
|
||||
const int64_t min_log_interval_us = 1000000;
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
while (true) {
|
||||
if (xQueueReceive(this_speaker->i2s_event_queue_, &i2s_event, portMAX_DELAY)) {
|
||||
#if SPDIF_DEBUG
|
||||
int64_t current_time = esp_timer_get_time();
|
||||
#endif
|
||||
|
||||
if (i2s_event.type == I2S_EVENT_DMA_ERROR) {
|
||||
#if SPDIF_DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user