Skip to content

[FEATURE] Remove CONFIG_BOARD_LOOPSPERMSEC references in applicationsΒ #3345

@linguini1

Description

@linguini1

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

Some tests, such as ostest and the SMP test, contain references to CONFIG_BOARD_LOOPSPERMSEC. I am currently attempting to improve the usage of this macro (apache/nuttx#17011) by:

  • Causing a build error when the macro isn't defined but is necessary for proper delays
  • Not compiling delay logic that requires this value when the board/architecture defines a more accurate delay method (i.e. arch_timer, arch_alarm).

There is a conflict where some of the platforms that get their delay implementations from arch_alarm/arch_timer also have configuration defined that uses ostest/smp test. These platforms don't define CONFIG_BOARD_LOOPSPERMSEC (and never did) which made the results of these busy-delay tests useless.

Describe the solution you'd like

I would like to remove the dependency on this macro from these two tests, but I'm not sure of a better alternative for hogging the CPU with some busy loop. Any suggestions are welcome.

Describe alternatives you've considered

I considered raising a warning when CONFIG_BOARD_LOOPSPERMSEC is undefined for these tests so that the user can be informed that they should calibrate and set the value for their platform (since these values are useless for simulators that vary in speed depending on the host). However, the tests are compiled with -Werr so those warnings cause compilation to fail.

Another option is just to use the #info macro, but I'm not sure that it adheres to the NuttX C standard.

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