Skip to content

[FEATURE] CONFIG_BOARD_LOOPSPERMSEC should not have a default value #17004

@linguini1

Description

@linguini1

Is your feature request related to a problem? Please describe.

The CONFIG_BOARD_LOOPSPERMSEC option has a default value of 5000, which is not applicable to any boards and is not a "sane default". This results in configurations missing the config option having completely incorrect results from the up_xdelay series of functions.

Describe the solution you'd like

I believe that the default value for this option should be set to -1, such that when compiling the code, if the value is -1 (checked at compile time), an error is thrown. This will force the user to set the configuration value themselves using something like calib_udelay and they will be aware of the issue.

The problem is that if it has a silent, incorrect default, users will have timing issues with some drivers and will try to debug driver failures instead of realizing this issue (the config option isn't super easy to know about without scouring documentation). This is especially frustrating on new board ports where many different things could be going wrong. The developer shouldn't waste time on a silent problem that is easily solvable.

Describe alternatives you've considered

No response

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions