This modules provides helper functions for busy waiting on short intervals before timers are initialized, e.g. More...
This modules provides helper functions for busy waiting on short intervals before timers are initialized, e.g.
in board_init()
.
Macros | |
#define | CPU_CYCLES_PER_LOOP 3 |
CPU cycles per busy wait loop iteration. | |
Functions | |
static void | busy_wait (unsigned loops) |
Spin for a number of cycles. | |
static void | busy_wait_us (unsigned usec) |
Spin for a number of microseconds. | |
#define CPU_CYCLES_PER_LOOP 3 |
CPU cycles per busy wait loop iteration.
This can be used to roughly estimate the number of cycles for a given wait time.
Definition at line 39 of file busy_wait.h.
|
inlinestatic |
Spin for a number of cycles.
This will not take into account cycles spent on interrupts if they are enabled and occur.
loops | Number of loop iterations to take |
Definition at line 50 of file busy_wait.h.
|
inlinestatic |
Spin for a number of microseconds.
This will roughly try to match the requested delay time, but don't expect high accuracy.
This will not take into account cycles spent on interrupts if they are enabled and occur.
usec | Number of µs to spin for. |
Definition at line 77 of file busy_wait.h.