Skip to content

Commit ac64691

Browse files
committed
Better delay description
CC #236 Signed-off-by: Daniel Egger <[email protected]>
1 parent b01dcb4 commit ac64691

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/asm.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ pub fn bkpt() {
2626

2727
/// Blocks the program for *at least* `n` instruction cycles
2828
///
29-
/// This is implemented in assembly so its execution time is the same regardless of the optimization
30-
/// level.
29+
/// This is implemented in assembly so its execution time is independent of the optimization
30+
/// level, however it is dependent on the specific architecture and core configuration.
3131
///
32-
/// NOTE that the delay can take much longer if interrupts are serviced during its execution.
32+
/// NOTE that the delay can take much longer if interrupts are serviced during its execution
33+
/// and the execution time may wary with other factors. This delay is mainly useful for simple
34+
/// timer-less initialisation of peripherals iff accurate timing is not essential. In any other
35+
/// case please use more accurate methods to cause a delay.
3336
#[inline]
3437
pub fn delay(_n: u32) {
35-
// NOTE(divide by 4) is easier to compute than `/ 3` is it's just a shift (`>> 2`).
38+
// NOTE(divide by 4) is easier to compute than `/ 3` because it's just a shift (`>> 2`).
3639
match () {
3740
#[cfg(all(cortex_m, feature = "inline-asm"))]
3841
() => unsafe {

0 commit comments

Comments
 (0)