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>