Skip to main content
2 of 2
More usage details.
Edgar Bonet
  • 45.2k
  • 4
  • 42
  • 81

No, these macros expand to calls to __builtin_avr_delay_cycles(), which are compiled into delay loops. It should be noted that:

  • the arguments to these macros should be compile-time constants, they can be floating point
  • the macros are cycle-accurate, e.g. _delay_us(0.125) will take exactly two CPU cycles on an Uno
  • whereas the CPU time used by the call is exactly what you ask for, the physical time will be larger if the call gets interrupted.
Edgar Bonet
  • 45.2k
  • 4
  • 42
  • 81