nuttx/Documentation/platforms/avr
Kerogit 0b5bf6c2c5 arch/avr/src/avrdx/avrdx_delay: add custom up_udelay function
NuttX builtin up_udelay function uses BOARD_LOOPSPERMSEC configuration
value to determine how many loops need to be done to cause requested
delay. This does not match well with AVR DA/DB microcontrollers
because the CPU clock frequency is configurable.

A board configuration could therefore provide BOARD_LOOPSPERMSEC
valid for one frequency but for other frequencies, the user would
be required to calibrate the value and would still get incorrect
result when changing the clock speed during runtime.

This patch therefore implements dynamic architecture-specific
up_udelay function which determines current clock settings
and infers required loop count from that.

New function was tested by simple application that used up_udelay
to put delays between printf calls.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
..
at32uc3 docs/platforms/avr/at32uc3/boards/avr32dev1: Migrate README.txt 2025-10-05 20:50:58 -03:00
at90usb docs/avr/at90usb: Migrate README.txt 2025-05-25 18:47:41 +08:00
atmega docs/avr/atmega/atmega1284p/boards/moteino-mega: Migrate README.txt 2025-10-05 20:50:58 -03:00
avrdx arch/avr/src/avrdx/avrdx_delay: add custom up_udelay function 2026-06-12 09:55:11 -04:00
common arch/avr/avrdx: do not copy const variables into RAM 2025-07-10 12:21:40 -03:00
index.rst Documentation/platforms/avr: move documents to fix table of contents 2025-05-19 22:29:58 +08:00