diff --git a/src/asm.rs b/src/asm.rs index ebd61b32..39cd8efd 100644 --- a/src/asm.rs +++ b/src/asm.rs @@ -26,13 +26,16 @@ pub fn bkpt() { /// Blocks the program for *at least* `n` instruction cycles /// -/// This is implemented in assembly so its execution time is the same regardless of the optimization -/// level. +/// This is implemented in assembly so its execution time is independent of the optimization +/// level, however it is dependent on the specific architecture and core configuration. /// -/// NOTE that the delay can take much longer if interrupts are serviced during its execution. +/// NOTE that the delay can take much longer if interrupts are serviced during its execution +/// and the execution time may vary with other factors. This delay is mainly useful for simple +/// timer-less initialization of peripherals if and only if accurate timing is not essential. In +/// any other case please use a more accurate method to produce a delay. #[inline] pub fn delay(_n: u32) { - // NOTE(divide by 4) is easier to compute than `/ 3` is it's just a shift (`>> 2`). + // NOTE(divide by 4) is easier to compute than `/ 3` because it's just a shift (`>> 2`). match () { #[cfg(all(cortex_m, feature = "inline-asm"))] () => unsafe {