Skip to content

[I2S] hardcoded initial rate in i2s_rxtx_begin() #6066

Closed
@Martin-Laclaustra

Description

@Martin-Laclaustra
  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.

Platform

Irrelevant

Settings in IDE

Irrelevant

Problem Description

In:

i2s_set_rate(44100);

the transfer rate is stablished within the i2s_rxtx_begin() (and thus also i2s_begin()). This overwrites any data rate or div ratios previously introduced.
I suggest to clearly document that data rate must be specified always AFTER begin().
Alternatively, a (one time only) flag could be set as soon as rate or div ratios functions are called stopping that line from changing them.
Current behavior might create confusion (at least to me). I spent several hours figuring out why the rate would not stick. I understood it only after reading the code line by line. I suggest to take some action that could avoid that for other programmers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions