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

'i2s_read_bytes' was not declared in this scope #3

Open
Voha888 opened this issue Mar 9, 2023 · 1 comment
Open

'i2s_read_bytes' was not declared in this scope #3

Voha888 opened this issue Mar 9, 2023 · 1 comment

Comments

@Voha888
Copy link

Voha888 commented Mar 9, 2023

If ESP32 version is 2.xx, the compiler print error: 'i2s_read_bytes' was not declared in this scope.
I think, its need new function i2s_read , but simple changing function neme

i2s_read(I2S_NUM_0, (char*)&i2s_buff[i * NUM_SAMPLES], NUM_SAMPLES * sizeof(uint16_t), portMAX_DELAY);

not helped me, i have error:

Compilation error: narrowing conversion of 'rate' from 'int' to 'uint32_t' {aka 'unsigned int'} inside { } [-Werror=narrowing]

@pauel3312
Copy link

pauel3312 commented Jul 16, 2024

That's because the new function doesnt have the same arguments. it needs an additional bytes_read value.
I replaced the function ADC_Sampling in i2s.ino with this:

void ADC_Sampling(uint16_t *i2s_buff){
  size_t bytes_read = sizeof(uint16_t);
  for (int i = 0; i < B_MULT; i++) {
    i2s_read(I2S_NUM_0, (char*)&i2s_buff[i * NUM_SAMPLES],  NUM_SAMPLES * sizeof(uint16_t), &bytes_read, portMAX_DELAY);    
  }
}

and now it compiles
can't be sure it works for now, I'm having other issues

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