I'm trying to upload this project on my ESP32 :
https://github.com/MhageGH/esp32_SoundRecorder I got an error in I2S.cpp file and based on what I found here: https://docs.espressif.com/projects/esp ... s/i2s.html
that i2s_read_bytes function that the project used is deprecated. and I should "Use ‘i2s_read’ instead."
but when I change it still gives me an error:
Code: Select all
In function 'int I2S_Read(char*, int)':
I2S.cpp:43:66: error: invalid conversion from 'TickType_t' {aka 'unsigned int'} to 'size_t*' {aka 'unsigned int*'} [-fpermissive]
return i2s_read(I2S_NUM_0, (char *)data, numData, portMAX_DELAY);
^
I2S.cpp:43:66: error: too few arguments to function 'esp_err_t i2s_read(i2s_port_t, void*, size_t, size_t*, TickType_t)'
from the documentation:
int i2s_read_bytes(i2s_port_ti2s_num, void *dest, size_t size, TickType_t ticks_to_wait)
Read data from I2S DMA receive buffer.
This function is deprecated. Use ‘i2s_read’ instead. This definition will be removed in a future release.
Return
The amount of bytes read, if timeout, bytes read will be less than the size passed in
ESP_FAIL Parameter error
esp_err_ti2s_read(i2s_port_ti2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait)
Read data from I2S DMA receive buffer.
Note
If the built-in ADC mode is enabled, we should call i2s_adc_start and i2s_adc_stop around the whole reading process, to prevent the data getting corrupted.
Return
ESP_OK Success
ESP_ERR_INVALID_ARG Parameter error
Parameters
i2s_num: I2S_NUM_0, I2S_NUM_1
dest: Destination address to read into
size: Size of data in bytes
bytes_read: Number of bytes read, if timeout, bytes read will be less than the size passed in.
ticks_to_wait: RX buffer wait timeout in RTOS ticks. If this many ticks pass without bytes becoming available in the DMA receive buffer, then the function will return (note that if data is read from the DMA buffer in pieces, the overall operation may still take longer than this timeout.) Pass portMAX_DELAY for no timeout.