Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This code is not compiling in arduino ide #1

Open
moaz-azam opened this issue Feb 16, 2024 · 2 comments
Open

This code is not compiling in arduino ide #1

moaz-azam opened this issue Feb 16, 2024 · 2 comments

Comments

@moaz-azam
Copy link

C:\Users\moaza\Downloads\Compressed\huzzah_esp32_pdm_mic-master\huzzah_esp32_pdm_mic-master\pdm3\pdm3.ino: In function 'void process_samples(void*)':
C:\Users\moaza\Downloads\Compressed\huzzah_esp32_pdm_mic-master\huzzah_esp32_pdm_mic-master\pdm3\pdm3.ino:92:28: error: 'i2s_read_bytes' was not declared in this scope
int num_bytes_read = i2s_read_bytes(I2S_PORT,
^~~~~~~~~~~~~~
C:\Users\moaza\Downloads\Compressed\huzzah_esp32_pdm_mic-master\huzzah_esp32_pdm_mic-master\pdm3\pdm3.ino:92:28: note: suggested alternative: 'pgm_read_byte'
int num_bytes_read = i2s_read_bytes(I2S_PORT,
^~~~~~~~~~~~~~
pgm_read_byte

exit status 1

Compilation error: 'i2s_read_bytes' was not declared in this scope

nicolas-f added a commit that referenced this issue Feb 16, 2024
i2s_read_bytes  function is deprecated about #1
@nicolas-f
Copy link
Owner

Hello

This function has been removed from espressif sdk and replaced by i2s_read:

https://docs.espressif.com/projects/esp-idf/en/v3.3/api-reference/peripherals/i2s.html#_CPPv414i2s_read_bytes10i2s_port_tPv6size_t10TickType_t

@moaz-azam
Copy link
Author

C:\Users\moaza\Downloads\Compressed\huzzah_esp32_pdm_mic-master\huzzah_esp32_pdm_mic-master\pdm3\pdm3.ino: In function 'void process_samples(void*)':
C:\Users\moaza\Downloads\Compressed\huzzah_esp32_pdm_mic-master\huzzah_esp32_pdm_mic-master\pdm3\pdm3.ino:96:56: error: invalid conversion from 'TickType_t' {aka 'unsigned int'} to 'size_t*' {aka 'unsigned int*'} [-fpermissive]
portMAX_DELAY); // no timeout
^
C:\Users\moaza\Downloads\Compressed\huzzah_esp32_pdm_mic-master\huzzah_esp32_pdm_mic-master\pdm3\pdm3.ino:96:56: error: too few arguments to function 'esp_err_t i2s_read(i2s_port_t, void*, size_t, size_t*, TickType_t)'
In file included from C:\Users\moaza\Downloads\Compressed\huzzah_esp32_pdm_mic-master\huzzah_esp32_pdm_mic-master\pdm3\pdm3.ino:1:
C:\Users\moaza\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/driver/include/driver/i2s.h:330:11: note: declared here
esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait);
^~~~~~~~

exit status 1

Compilation error: invalid conversion from 'TickType_t' {aka 'unsigned int'} to 'size_t*' {aka 'unsigned int*'} [-fpermissive]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants