mirror of
https://github.com/pschatzmann/arduino-audio-tools.git
synced 2024-09-21 02:17:31 +00:00
Compile errors in IDF
This commit is contained in:
parent
6c784824cb
commit
e5c04b5c44
@ -4,12 +4,12 @@ if (DEFINED ESP_PLATFORM)
|
||||
|
||||
# idf component
|
||||
idf_component_register(
|
||||
SRC_DIRS src
|
||||
# SRC_DIRS src
|
||||
INCLUDE_DIRS src
|
||||
REQUIRES bt esp_common freertos hal log nvs_flash driver
|
||||
)
|
||||
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC -DESP32_CMAKE=1 -Wno-error -Wno-format -fpermissive)
|
||||
target_compile_options(${COMPONENT_LIB} INTERFACE -DESP32_CMAKE=1 -Wno-error -Wno-format -fpermissive)
|
||||
|
||||
else()
|
||||
|
||||
|
@ -276,7 +276,7 @@ protected:
|
||||
// LOGI("adc_continuous_read request:%d samples %d bytes requested", samples_requested, (uint32_t)(samples_requested * sizeof(adc_digi_output_data_t)));
|
||||
if (adc_continuous_read(self->adc_handle, (uint8_t *)result_data, (uint32_t)(samples_requested * sizeof(adc_digi_output_data_t)), &bytes_read, (uint32_t)self->cfg.timeout) == ESP_OK) {
|
||||
samples_read = bytes_read / sizeof(adc_digi_output_data_t);
|
||||
LOGD("adc_continuous_read -> %u bytes / %d samples of %d bytes requested", (unsigned)bytes_read, samples_read, (uint32_t)(samples_requested * sizeof(adc_digi_output_data_t)));
|
||||
LOGD("adc_continuous_read -> %u bytes / %d samples of %d bytes requested", (unsigned)bytes_read, samples_read, (int)(samples_requested * sizeof(adc_digi_output_data_t)));
|
||||
|
||||
// Parse and store data in FIFO buffers
|
||||
for (int i = 0; i < samples_read; i++) {
|
||||
@ -297,10 +297,10 @@ protected:
|
||||
if (self->fifo_buffers[idx]->push(data)) {
|
||||
LOGD("Sample %d, FIFO %d, ch %u, d %u", i, idx, chan_num, data);
|
||||
} else {
|
||||
LOGE("Sample %d, FIFO buffer is full, ch %u, d %u", i, idx, chan_num, data);
|
||||
LOGE("Sample %d, FIFO buffer is full, ch %u, d %u", i, (unsigned)chan_num, data);
|
||||
}
|
||||
} else {
|
||||
LOGE("Sample %d, ch %u not found in configuration, d: %u", i, chan_num, data);
|
||||
LOGE("Sample %d, ch %u not found in configuration, d: %u", i, (unsigned)chan_num, data);
|
||||
for (int k = 0; k < self->cfg.channels; ++k) {
|
||||
LOGE("Available config ch: %u", self->cfg.adc_channels[k]);
|
||||
}
|
||||
@ -349,7 +349,7 @@ protected:
|
||||
if (self->fifo_buffers[idx]->push(data)) {
|
||||
LOGD("Top Off Sample %d, FIFO %d, ch %u, d %u", i, idx, chan_num, data);
|
||||
} else {
|
||||
LOGE("Top Off Sample %d, FIFO buffer is full, ch %u, d %u", i, idx, chan_num, data);
|
||||
LOGE("Top Off Sample %d, FIFO buffer is full, ch %u, d %u", i, chan_num, data);
|
||||
}
|
||||
} else {
|
||||
LOGE("Top Off Sample %d, ch %u not found in configuration, d %u", i, chan_num, data);
|
||||
|
@ -178,8 +178,8 @@ class I2SDriverESP32V1 {
|
||||
case I2SChannelSelect::Right:
|
||||
result.slot_mask = I2S_STD_SLOT_RIGHT;
|
||||
break;
|
||||
case I2SChannelSelect::Stereo:
|
||||
LOGW("Invalid channel_format: %d", cfg.channel_format);
|
||||
default:
|
||||
LOGW("Invalid channel_format: %d", (int)cfg.channel_format);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1649,7 +1649,7 @@ public:
|
||||
if (p_out!=nullptr){
|
||||
result = p_out->write(data, len);
|
||||
}
|
||||
return len;
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t readBytes(uint8_t *data, size_t len){
|
||||
|
@ -859,7 +859,10 @@ class ChannelDiffT : public BaseConverter {
|
||||
T *p_source = (T *)src;
|
||||
|
||||
for (int i = 0; i < sample_count; i++) {
|
||||
*p_result++ = *p_source++ - *p_source++;
|
||||
// *p_result++ = *p_source++ - *p_source++;
|
||||
auto tmp = *p_source++;
|
||||
tmp -= *p_source++;
|
||||
*p_result++ = tmp;
|
||||
}
|
||||
|
||||
return sizeof(T) * sample_count;
|
||||
@ -936,7 +939,10 @@ class ChannelAvgT : public BaseConverter {
|
||||
T *p_source = (T *)src;
|
||||
|
||||
for (int i = 0; i < sample_count; i++) {
|
||||
*p_result++ = (*p_source++ + *p_source++) / 2; // Average the pair of channels
|
||||
// *p_result++ = (*p_source++ + *p_source++) / 2; // Average the pair of channels
|
||||
auto tmp = *p_source++;
|
||||
tmp += *p_source++;
|
||||
*p_result++ = tmp / 2;
|
||||
}
|
||||
|
||||
LOGD("channel average %d samples, %d bytes", sample_count, size);
|
||||
|
Loading…
Reference in New Issue
Block a user